print('task compare_ref_syn;')
print(' input [7:0] i;')
print(' input [63:0] r, s;')
+ print(' reg [64*8-1:0] buffer;')
+ print(' integer j;')
print(' begin')
- print(' if (-3 < $signed(r-s) && $signed(r-s) < +3)')
- print(' $display("%d: %b %b", i, r, s);')
- print(' else')
- print(' $display("%d: %b %b %s", i, r, s, r !== s ? "TRIG" : "");')
+ print(' if (-1 <= $signed(r-s) && $signed(r-s) <= +1) begin')
+ print(' // $display("%d: %b %b", i, r, s);')
+ print(' end else if (r === s) begin ')
+ print(' // $display("%d: %b %b", i, r, s);')
+ print(' end else begin ')
+ print(' for (j = 0; j < 64; j = j+1)')
+ print(' buffer[j*8 +: 8] = r[j] !== s[j] ? "^" : " ";')
+ print(' $display("\\n%3d: %b %b", i, r, s);')
+ print(' $display(" %s %s", buffer, buffer);')
+ print(' end')
print(' end')
print('endtask')
print('initial begin #1;')