Minor cleanup of the linux test bench.

This commit is contained in:
Ross Thompson 2021-08-12 11:14:55 -05:00
parent 565c01709d
commit 9ff9c4dff9

View File

@ -609,6 +609,7 @@ module testbench();
// ---------------- // ----------------
// PC Updater Macro // PC Updater Macro
// ---------------- // ----------------
/* -----\/----- EXCLUDED -----\/-----
`define SCAN_PC(DATAFILE,SCANFILE,PCTEXT,PCTEXT2,CHECKINSTR,PCEXPECTED) \ `define SCAN_PC(DATAFILE,SCANFILE,PCTEXT,PCTEXT2,CHECKINSTR,PCEXPECTED) \
SCANFILE = $fscanf(DATAFILE, "%s\n", PCTEXT); \ SCANFILE = $fscanf(DATAFILE, "%s\n", PCTEXT); \
PCTEXT2 = ""; \ PCTEXT2 = ""; \
@ -619,6 +620,7 @@ module testbench();
SCANFILE = $fscanf(DATAFILE, "%x\n", CHECKINSTR); \ SCANFILE = $fscanf(DATAFILE, "%x\n", CHECKINSTR); \
SCANFILE = $fscanf(DATAFILE, "%x\n", PCEXPECTED); SCANFILE = $fscanf(DATAFILE, "%x\n", PCEXPECTED);
-----/\----- EXCLUDED -----/\----- */
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
//////////////////////////////// Testbench Core /////////////////////////////// //////////////////////////////// Testbench Core ///////////////////////////////
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -935,6 +937,7 @@ module testbench();
// -------------- // --------------
// Initialization // Initialization
// -------------- // --------------
/* -----\/----- EXCLUDED -----\/-----
initial begin initial begin
data_file_memR = $fopen({`LINUX_TEST_VECTORS,"parsedMemRead.txt"}, "r"); data_file_memR = $fopen({`LINUX_TEST_VECTORS,"parsedMemRead.txt"}, "r");
if (data_file_memR == 0) begin if (data_file_memR == 0) begin
@ -949,6 +952,7 @@ module testbench();
$stop; $stop;
end end
end end
-----/\----- EXCLUDED -----/\----- */
// ------------ // ------------
// Read Checker // Read Checker
@ -1161,17 +1165,18 @@ module testbench();
// PCtextF, PCtextD are read from testvectors // PCtextF, PCtextD are read from testvectors
// You could just as well read the others from testvectors, // You could just as well read the others from testvectors,
// but I really like how the pipeline synchronizes with Wally so cleanly // but I really like how the pipeline synchronizes with Wally so cleanly
/* -----\/----- EXCLUDED -----\/-----
always_ff @(posedge clk, posedge reset) always_ff @(posedge clk, posedge reset)
if (reset) begin if (reset) begin
PCtextE = "(reset)"; PCtextE = "(reset)";
PCtextM = "(reset)"; PCtextM = "(reset)";
//PCtextW = "(reset)"; //PCtextW = "(reset)";
end else begin end else begin
/* -----\/----- EXCLUDED -----\/----- /-* -----\/----- EXCLUDED -----\/-----
if (~dut.hart.StallW) if (~dut.hart.StallW)
if (dut.hart.FlushW) PCtextW = "(flushed)"; if (dut.hart.FlushW) PCtextW = "(flushed)";
else PCtextW = PCtextM; else PCtextW = PCtextM;
-----/\----- EXCLUDED -----/\----- */ -----/\----- EXCLUDED -----/\----- *-/
if (~dut.hart.StallM) if (~dut.hart.StallM)
if (dut.hart.FlushM) PCtextM = "(flushed)"; if (dut.hart.FlushM) PCtextM = "(flushed)";
else PCtextM = PCtextE; else PCtextM = PCtextE;
@ -1180,6 +1185,7 @@ module testbench();
else PCtextE = PCtextD; else PCtextE = PCtextD;
end end
-----/\----- EXCLUDED -----/\----- */
// ------------------ // ------------------
// Address Translator // Address Translator
// ------------------ // ------------------