Skip to content

Commit a1506ec

Browse files
committed
For mcontrol6, default to BEFORE timing.
The existing implementation would end up using AFTER even for instruction execute and data store triggers, which is not desirable.
1 parent a8c9d9c commit a1506ec

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

riscv/triggers.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,14 @@ bool mcontrol_common_t::legalize_timing(reg_t val, reg_t timing_mask, reg_t sele
265265
return TIMING_AFTER;
266266
if (get_field(val, execute_mask))
267267
return TIMING_BEFORE;
268-
return get_field(val, timing_mask);
268+
if (timing_mask) {
269+
// Use the requested timing.
270+
return get_field(val, timing_mask);
271+
} else {
272+
// For mcontrol6 you can't request a timing. Default to before since that's
273+
// most useful to the user.
274+
return TIMING_BEFORE;
275+
}
269276
}
270277

271278
reg_t mcontrol6_t::tdata1_read(const processor_t * const proc) const noexcept {

0 commit comments

Comments
 (0)