提交 8b3a144f 编写于 作者: Y Yinan Xu

ram: print wIdx when write out of bound

上级 6a9a0533
......@@ -215,7 +215,7 @@ void ram_finish() {
extern "C" uint64_t ram_read_helper(uint8_t en, uint64_t rIdx) {
if (en && rIdx >= RAMSIZE / sizeof(uint64_t)) {
printf("ERROR: ram idx = 0x%lx out of bound!\n", rIdx);
printf("ERROR: ram rIdx = 0x%lx out of bound!\n", rIdx);
assert(rIdx < RAMSIZE / sizeof(uint64_t));
}
return (en) ? ram[rIdx] : 0;
......@@ -223,6 +223,7 @@ extern "C" uint64_t ram_read_helper(uint8_t en, uint64_t rIdx) {
extern "C" void ram_write_helper(uint64_t wIdx, uint64_t wdata, uint64_t wmask, uint8_t wen) {
if (wen) {
printf("ERROR: ram wIdx = 0x%lx out of bound!\n", wIdx);
assert(wIdx < RAMSIZE / sizeof(uint64_t));
ram[wIdx] = (ram[wIdx] & ~wmask) | (wdata & wmask);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册