Commit fb6f11b
committed
[dv] Hold debug_req until the hart has halted
debug_seq pulsed debug_req for a fixed 75 cycles. A request that wakes
the core from WFI needs longer than that to reach the debug ROM: the
clock restarts, the instruction after the WFI is refetched into ID,
debug entry flushes it and the halt address is fetched. RVFI attaches a
captured request to the first instruction entering ID, which is the
flushed one, and the debug ROM's first instruction then reports the
live debug_req, already low. The cosim never learns of the request and
steps Spike past the WFI: riscv_debug_single_step_test seed 12 with
real stepping failed with "DUT retired 80000000 but the ISS retired
800035f4".
A debug module keeps haltreq asserted until the hart reports halted,
which the debug ROM does with its first instructions. Do the same:
after the pulse, keep debug_req high until RVFI has reported a
retirement that carries the request (debug_mode alone rises at debug
entry, before the halt address is fetched, so it is too early). Not
seeing one within 5000 cycles is an error. debug_new_seq is left
alone: its only user, riscv_assorted_traps_interrupts_debug_test, runs
with +no_wfi=1 and pulses for 3000-5000 cycles.
Signed-off-by: Kulan Palanichamy <kulan.palanichamy@opentitan.org>1 parent 200dbeb commit fb6f11b
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
178 | 181 | | |
179 | 182 | | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
| |||
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
191 | 213 | | |
192 | 214 | | |
193 | 215 | | |
| |||
0 commit comments