From f0229e970b92e1bafb8c5c2a3706e74fda6ef2fe Mon Sep 17 00:00:00 2001 From: slmnemo Date: Sat, 20 Apr 2024 17:07:54 -0700 Subject: [PATCH] Fixed getenvvar verilator bug in rom1p1r, Removed unused system function from testbench. --- src/generic/mem/rom1p1r.sv | 6 ++++++ testbench/testbench.sv | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generic/mem/rom1p1r.sv b/src/generic/mem/rom1p1r.sv index 7a53c529e..5bb82f642 100644 --- a/src/generic/mem/rom1p1r.sv +++ b/src/generic/mem/rom1p1r.sv @@ -26,6 +26,12 @@ // 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) (input logic clk, input logic ce, diff --git a/testbench/testbench.sv b/testbench/testbench.sv index 958b2734c..b74827165 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -39,7 +39,6 @@ import "DPI-C" function string getenvval(input string env_name); `else import "DPI-C" function string getenv(input string env_name); `endif -import "DPI-C" function int system(input string env_name); module testbench; /* verilator lint_off WIDTHTRUNC */ @@ -329,8 +328,6 @@ module testbench; else assign EcallFaultM = 0; - // this is an unused integer for the return value of `system` - int unused_int; always @(posedge clk) begin //////////////////////////////////////////////////////////////////////////////// // Verify the test ran correctly by checking the memory against a known signature.