Fixed conflicts on getenv

This commit is contained in:
David Harris 2024-04-21 08:38:13 -07:00
parent 0419b5484a
commit be15a11622
2 changed files with 16 additions and 14 deletions

View File

@ -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];

View File

@ -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;