Fixed getenvvar verilator bug in rom1p1r, Removed unused system function from testbench.

This commit is contained in:
slmnemo 2024-04-20 17:07:54 -07:00
parent 66a002d879
commit f0229e970b
2 changed files with 6 additions and 3 deletions

View File

@ -26,6 +26,12 @@
// This model actually works correctly with vivado. // This model actually works correctly with vivado.
`ifdef VERILATOR
import "DPI-C" function string getenvval(input string env_name);
`else
import "DPI-C" function string getenv(input string env_name);
`endif
module rom1p1r #(parameter ADDR_WIDTH = 8, DATA_WIDTH = 32, PRELOAD_ENABLED = 0) module rom1p1r #(parameter ADDR_WIDTH = 8, DATA_WIDTH = 32, PRELOAD_ENABLED = 0)
(input logic clk, (input logic clk,
input logic ce, input logic ce,

View File

@ -39,7 +39,6 @@ import "DPI-C" function string getenvval(input string env_name);
`else `else
import "DPI-C" function string getenv(input string env_name); import "DPI-C" function string getenv(input string env_name);
`endif `endif
import "DPI-C" function int system(input string env_name);
module testbench; module testbench;
/* verilator lint_off WIDTHTRUNC */ /* verilator lint_off WIDTHTRUNC */
@ -329,8 +328,6 @@ module testbench;
else else
assign EcallFaultM = 0; assign EcallFaultM = 0;
// this is an unused integer for the return value of `system`
int unused_int;
always @(posedge clk) begin always @(posedge clk) begin
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Verify the test ran correctly by checking the memory against a known signature. // Verify the test ran correctly by checking the memory against a known signature.