SI-RISCV / e200_opensource

Deprecated, please go to next generation Ultra-Low Power RISC-V Core https://github.com/riscv-mcu/e203_hbirdv2
https://github.com/riscv-mcu/e203_hbirdv2
Apache License 2.0
2.6k stars 1k forks source link

DTM NOP overwrites a word in Debug RAM #10

Open brabect1 opened 5 years ago

brabect1 commented 5 years ago

Modules accessed through DTM are chip selected based only on DTM address field. In case of Debug RAM, the other control signal is RD (read/not write). RD maps to DTM Read operation, meaning that any other operation (e.g. NOP) will cause a write into DRAM.

https://github.com/SI-RISCV/e200_opensource/blob/2ce55ea9b5b76e47a48865ea47f32e0d17190769/rtl/e203/debug/sirv_debug_module.v#L351

The issue exploits the case for the Debug RAM, but other components may be affected too.

The fix is to condition DTM chip selects by DTM valid read or write operation.