diff --git a/src/generic/mem/rom1p1r.sv b/src/generic/mem/rom1p1r.sv index 229e481eb..17485af8a 100644 --- a/src/generic/mem/rom1p1r.sv +++ b/src/generic/mem/rom1p1r.sv @@ -26,13 +26,6 @@ // This model actually works correctly with vivado. -`ifdef VERILATOR - import "DPI-C" function string getenvval(input string env_name); - string WALLY_DIR = getenvval("WALLY"); -`else - string WALLY_DIR = "$WALLY"; -`endif - module rom1p1r #(parameter ADDR_WIDTH = 8, DATA_WIDTH = 32, PRELOAD_ENABLED = 0) (input logic clk, input logic ce, @@ -40,6 +33,14 @@ module rom1p1r #(parameter ADDR_WIDTH = 8, DATA_WIDTH = 32, PRELOAD_ENABLED = 0) output logic [DATA_WIDTH-1:0] dout ); +`ifdef VERILATOR + import "DPI-C" function string getenvval(input string env_name); +// string WALLY_DIR = getenvval("WALLY"); + string WALLY_DIR = "~/cvw"; +`else + string WALLY_DIR = "$WALLY"; +`endif + // Core Memory bit [DATA_WIDTH-1:0] ROM [(2**ADDR_WIDTH)-1:0]; diff --git a/testbench/testbench.sv b/testbench/testbench.sv index a126b4209..a92af4a08 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -33,12 +33,6 @@ `include "idv/idv.svh" `endif -`ifdef VERILATOR - import "DPI-C" function string getenvval(input string env_name); - string RISCV_DIR = getenvval("RISCV"); // "/opt/riscv"; -`else - string RISCV_DIR = "$RISCV"; // "/opt/riscv"; -`endif import cvw::*; @@ -57,7 +51,14 @@ module testbench; import idvApiPkg::*; `endif -`include "parameter-defs.vh" + `ifdef VERILATOR + import "DPI-C" function string getenvval(input string env_name); + string RISCV_DIR = getenvval("RISCV"); // "/opt/riscv"; + `else + string RISCV_DIR = "$RISCV"; // "/opt/riscv"; + `endif + + `include "parameter-defs.vh" logic clk; logic reset_ext, reset;