pulp-platform / riscv-dbg

RISC-V Debug Support for our PULP RISC-V Cores
Other
219 stars 72 forks source link

add <WaitWriteValid> after <Write> in dmi_jtag state machine #72

Closed noytzach closed 3 years ago

noytzach commented 4 years ago

A fix for cases where the core clock is slower than jtag clock (TCK)

The old SM did not wait for resp after write. This can cause a READ following a WRITE to get the response of the WRITE in case the jtag clock is much faster than the core clock.

The fix adds a WaitWriteValid state (the enum already had this state, but it was not implemented), so the next command can be issued only after the previous write got its response.

bluewww commented 4 years ago

Doesn't this slow down the write speed?

noytzach commented 4 years ago

For cases where jtag is slower than internal speed ("the normal case"), it doesn't slow down, because the write will be over before the next operation, so the extra state change nothing.

For cases where jtag is faster, it does slow down but it solves the bug described above where the responses get out of sync.