Skip to content

Commit

Permalink
fix bug on error message when mode = 384
Browse files Browse the repository at this point in the history
  • Loading branch information
zkronos73 committed May 9, 2024
1 parent 56fbd9d commit 092f1ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sm/sm_main/sm_main_exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1168,11 +1168,12 @@ module.exports = async function execute(pols, input, rom, config = {}, metadata
(!Fr.eq(ctx.mem[memAddr][6], value[6])) ||
(!Fr.eq(ctx.mem[memAddr][7], value[7])))
{
const hlen = l.mode384 ? 12:8;
const memdata = ctx.mem[memAddr].slice().reverse().join(',');
const hmemdata = ctx.mem[memAddr].slice().reverse().map((x)=>x.toString(16).padStart(8,'0')).join('');
const hmemdata = ctx.mem[memAddr].slice().reverse().map((x)=>x.toString(16).padStart(hlen,'0')).join('');
const data = value.reverse();
const opdata = data.join(',');
const hopdata = data.map((x)=>x.toString(16).padStart(8,'0')).join('');
const hopdata = data.map((x)=>x.toString(16).padStart(hlen,'0')).join('');
throw new Error(`Memory Read does not match MEM[${memAddr}]=[${memdata}] OP=[${opdata}] ${sourceRef}\n${hmemdata}\n${hopdata}`);
}
} else {
Expand Down

0 comments on commit 092f1ea

Please sign in to comment.