diff options
author | Tim Newsome <tim@sifive.com> | 2016-08-31 15:51:58 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2016-08-31 15:51:58 -0700 |
commit | 84f5c416bffb66c8b47fd94b90afa888af7e819e (patch) | |
tree | 3af886d265e79c7271b0a70e0edffdfbf4813f87 /riscv/processor.h | |
parent | 0bd33edd801b71d009642cb2bcbd8636f97b6aaa (diff) | |
download | spike-84f5c416bffb66c8b47fd94b90afa888af7e819e.zip spike-84f5c416bffb66c8b47fd94b90afa888af7e819e.tar.gz spike-84f5c416bffb66c8b47fd94b90afa888af7e819e.tar.bz2 |
Rename tdata[0-2] to tdata[1-3].
Add timing bit (but it doesn't do anything).
Implement dmode bit.
Diffstat (limited to 'riscv/processor.h')
-rw-r--r-- | riscv/processor.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/riscv/processor.h b/riscv/processor.h index 2eac770..d5e8bc0 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -65,9 +65,10 @@ typedef enum typedef struct { uint8_t type; + bool dmode; uint8_t maskmax; bool select; - bool dmode; + bool timing; mcontrol_action_t action; bool chain; mcontrol_match_t match; @@ -117,7 +118,7 @@ struct state_t dcsr_t dcsr; reg_t tselect; mcontrol_t mcontrol[num_triggers]; - reg_t tdata1[num_triggers]; + reg_t tdata2[num_triggers]; uint32_t fflags; uint32_t frm; @@ -231,42 +232,43 @@ public: switch (state.mcontrol[i].match) { case MATCH_EQUAL: - if (value != state.tdata1[i]) + if (value != state.tdata2[i]) continue; break; case MATCH_NAPOT: { - reg_t mask = ~((1 << cto(state.tdata1[i])) - 1); - if ((value & mask) != (state.tdata1[i] & mask)) + reg_t mask = ~((1 << cto(state.tdata2[i])) - 1); + if ((value & mask) != (state.tdata2[i] & mask)) continue; } break; case MATCH_GE: - if (value < state.tdata1[i]) + if (value < state.tdata2[i]) continue; break; case MATCH_LT: - if (value >= state.tdata1[i]) + if (value >= state.tdata2[i]) continue; break; case MATCH_MASK_LOW: { - reg_t mask = state.tdata1[i] >> (xlen/2); - if ((value & mask) != (state.tdata1[i] & mask)) + reg_t mask = state.tdata2[i] >> (xlen/2); + if ((value & mask) != (state.tdata2[i] & mask)) continue; } break; case MATCH_MASK_HIGH: { - reg_t mask = state.tdata1[i] >> (xlen/2); - if (((value >> (xlen/2)) & mask) != (state.tdata1[i] & mask)) + reg_t mask = state.tdata2[i] >> (xlen/2); + if (((value >> (xlen/2)) & mask) != (state.tdata2[i] & mask)) continue; } break; } - if (!state.mcontrol[i].chain) + if (!state.mcontrol[i].chain) { return i; + } chain_ok = true; } return -1; |