mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
busybear: better NOPing out of float instructions
This commit is contained in:
parent
c780a25f92
commit
4a8b689f62
@ -187,8 +187,8 @@ module testbench_busybear();
|
|||||||
|
|
||||||
logic [`XLEN-1:0] readAdrExpected;
|
logic [`XLEN-1:0] readAdrExpected;
|
||||||
|
|
||||||
always @(dut.hart.MemRWM[1] or HADDR) begin
|
always @(dut.hart.MemRWM[1] or HADDR or dut.HRDATA) begin
|
||||||
if (dut.hart.MemRWM[1] && HADDR != dut.PCF) begin
|
if (dut.hart.MemRWM[1] && HADDR != dut.PCF && dut.HRDATA != {64{1'bx}}) begin
|
||||||
if($feof(data_file_memR)) begin
|
if($feof(data_file_memR)) begin
|
||||||
$display("no more memR data to read");
|
$display("no more memR data to read");
|
||||||
`ERROR
|
`ERROR
|
||||||
@ -202,7 +202,7 @@ module testbench_busybear();
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (((readMask & HRDATA) !== (readMask & dut.HRDATA)) && (HADDR >= 'h80000000 && HADDR <= 'h87FFFFFF)) begin
|
if (((readMask & HRDATA) !== (readMask & dut.HRDATA)) && (HADDR >= 'h80000000 && HADDR <= 'h87FFFFFF)) begin
|
||||||
$display("warning %0t ps, instr %0d: HRDATA does not equal dut.HRDATA: %x, %x from address %x, %x", $time, instrs, HRDATA, dut.HRDATA, HADDR, HSIZE);
|
$display("warning %0t ps, instr %0d: ExpectedHRDATA does not equal dut.HRDATA: %x, %x from address %x, %x", $time, instrs, HRDATA, dut.HRDATA, HADDR, HSIZE);
|
||||||
warningCount += 1;
|
warningCount += 1;
|
||||||
`ERROR
|
`ERROR
|
||||||
end
|
end
|
||||||
@ -355,6 +355,33 @@ module testbench_busybear();
|
|||||||
lastPC2 <= lastPC;
|
lastPC2 <= lastPC;
|
||||||
if (speculative && (lastPC != pcExpected)) begin
|
if (speculative && (lastPC != pcExpected)) begin
|
||||||
speculative = ~equal(dut.PCF,pcExpected,3);
|
speculative = ~equal(dut.PCF,pcExpected,3);
|
||||||
|
if(dut.PCF===pcExpected) begin
|
||||||
|
if(dut.hart.ifu.InstrF[6:0] == 7'b1010011) begin // for now, NOP out any float instrs
|
||||||
|
force CheckInstrF = 32'b0010011;
|
||||||
|
release CheckInstrF;
|
||||||
|
force dut.hart.ifu.InstrF = 32'b0010011;
|
||||||
|
#7;
|
||||||
|
release dut.hart.ifu.InstrF;
|
||||||
|
$display("warning: NOPing out %s at PC=%0x, instr %0d, time %0t", PCtext, dut.PCF, instrs, $time);
|
||||||
|
warningCount += 1;
|
||||||
|
forcedInstr = 1;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
if(dut.hart.ifu.InstrF[28:27] != 2'b11 && dut.hart.ifu.InstrF[6:0] == 7'b0101111) begin //for now, replace non-SC A instrs with LD
|
||||||
|
force CheckInstrF = {12'b0, CheckInstrF[19:7], 7'b0000011};
|
||||||
|
release CheckInstrF;
|
||||||
|
force dut.hart.ifu.InstrF = {12'b0, dut.hart.ifu.InstrF[19:7], 7'b0000011};
|
||||||
|
#7;
|
||||||
|
release dut.hart.ifu.InstrF;
|
||||||
|
$display("warning: replacing AMO instr %s at PC=%0x with ld", PCtext, dut.PCF);
|
||||||
|
warningCount += 1;
|
||||||
|
forcedInstr = 1;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
forcedInstr = 0;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if($feof(data_file_PC)) begin
|
if($feof(data_file_PC)) begin
|
||||||
@ -367,15 +394,24 @@ module testbench_busybear();
|
|||||||
PCtext = {PCtext, " ", PCtext2};
|
PCtext = {PCtext, " ", PCtext2};
|
||||||
end
|
end
|
||||||
scan_file_PC = $fscanf(data_file_PC, "%x\n", CheckInstrF);
|
scan_file_PC = $fscanf(data_file_PC, "%x\n", CheckInstrF);
|
||||||
if(CheckInstrF[6:0] == 7'b1010011) begin // for now, NOP out any float instrs
|
if(dut.PCF === pcExpected) begin
|
||||||
CheckInstrF = 32'b0010011;
|
if(dut.hart.ifu.InstrF[6:0] == 7'b1010011) begin // for now, NOP out any float instrs
|
||||||
$display("warning: NOPing out %s at PC=%0x", PCtext, dut.PCF);
|
force CheckInstrF = 32'b0010011;
|
||||||
|
release CheckInstrF;
|
||||||
|
force dut.hart.ifu.InstrF = 32'b0010011;
|
||||||
|
#7;
|
||||||
|
release dut.hart.ifu.InstrF;
|
||||||
|
$display("warning: NOPing out %s at PC=%0x, instr %0d, time %0t", PCtext, dut.PCF, instrs, $time);
|
||||||
warningCount += 1;
|
warningCount += 1;
|
||||||
forcedInstr = 1;
|
forcedInstr = 1;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if(CheckInstrF[28:27] != 2'b11 && CheckInstrF[6:0] == 7'b0101111) begin //for now, replace non-SC A instrs with LD
|
if(dut.hart.ifu.InstrF[28:27] != 2'b11 && dut.hart.ifu.InstrF[6:0] == 7'b0101111) begin //for now, replace non-SC A instrs with LD
|
||||||
CheckInstrF = {12'b0, CheckInstrF[19:7], 7'b0000011};
|
force CheckInstrF = {12'b0, CheckInstrF[19:7], 7'b0000011};
|
||||||
|
release CheckInstrF;
|
||||||
|
force dut.hart.ifu.InstrF = {12'b0, dut.hart.ifu.InstrF[19:7], 7'b0000011};
|
||||||
|
#7;
|
||||||
|
release dut.hart.ifu.InstrF;
|
||||||
$display("warning: replacing AMO instr %s at PC=%0x with ld", PCtext, dut.PCF);
|
$display("warning: replacing AMO instr %s at PC=%0x with ld", PCtext, dut.PCF);
|
||||||
warningCount += 1;
|
warningCount += 1;
|
||||||
forcedInstr = 1;
|
forcedInstr = 1;
|
||||||
@ -384,6 +420,7 @@ module testbench_busybear();
|
|||||||
forcedInstr = 0;
|
forcedInstr = 0;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
// then expected PC value
|
// then expected PC value
|
||||||
scan_file_PC = $fscanf(data_file_PC, "%x\n", pcExpected);
|
scan_file_PC = $fscanf(data_file_PC, "%x\n", pcExpected);
|
||||||
if (instrs <= 10 || (instrs <= 100 && instrs % 10 == 0) ||
|
if (instrs <= 10 || (instrs <= 100 && instrs % 10 == 0) ||
|
||||||
|
Loading…
Reference in New Issue
Block a user