Merge pull request #875 from ross144/main

This commit is contained in:
Jordan Carlin 2024-07-11 18:05:14 -07:00 committed by GitHub
commit a4967138b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -462,7 +462,7 @@ module testbench;
integer StartIndex; integer StartIndex;
integer EndIndex; integer EndIndex;
integer BaseIndex; integer BaseIndex;
integer memFile; integer memFile, uncoreMemFile;
integer readResult; integer readResult;
if (P.SDC_SUPPORTED) begin if (P.SDC_SUPPORTED) begin
always @(posedge clk) begin always @(posedge clk) begin
@ -505,8 +505,16 @@ module testbench;
end end
readResult = $fread(dut.uncoregen.uncore.ram.ram.memory.ram.RAM, memFile); readResult = $fread(dut.uncoregen.uncore.ram.ram.memory.ram.RAM, memFile);
$fclose(memFile); $fclose(memFile);
end else end else begin
$readmemh(memfilename, dut.uncoregen.uncore.ram.ram.memory.ram.RAM); uncoreMemFile = $fopen(memfilename, "r"); // Is there a better way to test if a file exists?
if (uncoreMemFile == 0) begin
$display("Error: Could not open file %s", memfilename);
$finish;
end else begin
$fclose(uncoreMemFile);
$readmemh(memfilename, dut.uncoregen.uncore.ram.ram.memory.ram.RAM);
end
end
if (TEST == "embench") $display("Read memfile %s", memfilename); if (TEST == "embench") $display("Read memfile %s", memfilename);
end end
if (CopyRAM) begin if (CopyRAM) begin