Skip to content

Commit 3c5b1bb

Browse files
authored
Merge pull request #1779 from rtwfroody/trigger_timing
For mcontrol6, default to BEFORE timing.
2 parents 3f556d6 + a1506ec commit 3c5b1bb

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)