add speculative exception for compressed instructions

This commit is contained in:
Noah Boorstin 2021-01-28 14:40:35 -05:00
parent 27142f0fef
commit 0befdfacec
2 changed files with 13 additions and 6 deletions

View File

@ -130,6 +130,6 @@ add wave /testbench_busybear/InstrWName
#set DefaultRadix hexadecimal #set DefaultRadix hexadecimal
# #
#-- Run the Simulation #-- Run the Simulation
run 2220 run 2630
#run -all #run -all
##quit ##quit

View File

@ -163,15 +163,22 @@ module testbench_busybear();
scan_file_PC = $fscanf(data_file_PC, "%x\n", InstrF); scan_file_PC = $fscanf(data_file_PC, "%x\n", InstrF);
// 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 > 175 || instrs % 10 == 0) begin if (instrs < 10 || (instrs < 100 && instrs % 10 == 0) ||
(instrs < 1000 && instrs % 50 == 0) || instrs > 205) begin
$display("loaded %0d instructions", instrs); $display("loaded %0d instructions", instrs);
end end
instrs += 1; instrs += 1;
// are we at a branch/jump? // are we at a branch/jump?
case (lastInstrF[6:0]) //todo: add C versions of these casex (lastInstrF[15:0])
7'b1101111, //JAL 16'bXXXXXXXXX1101111, // JAL
7'b1100111, //JALR 16'bXXXXXXXXX1100111, // JALR
7'b1100011: //B 16'bXXXXXXXXX1100011, // B
16'b101XXXXXXXXXXX01: // C.J
speculative = 1;
16'b1001000000000010: // C.EBREAK:
speculative = 0; // tbh don't really know what should happen here
16'b1000XXXXX0000010, // C.JR
16'b1001XXXXX0000010: // C.JALR //this is RV64 only so no C.JAL
speculative = 1; speculative = 1;
default: default:
speculative = 0; speculative = 0;