mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-03 02:05:21 +00:00
Merge pull request #730 from slmnemo/linux_local
Mitigated Verilator bug causing failures due to names for conditional generate and module being the same.
This commit is contained in:
commit
81be762392
@ -7,4 +7,4 @@ export OTHERFLAGS="+TRACE2LOG_ENABLE=1 +TRACE2LOG_AFTER=100"
|
||||
#export OTHERFLAGS="+TRACE2LOG_ENABLE=1 +TRACE2LOG_AFTER=10500000"
|
||||
#export OTHERFLAGS=""
|
||||
|
||||
vsim -c -do "do wally-linux-imperas.do buildroot buildroot $::env(RISCV) 0 0 0"
|
||||
vsim -c -do "do questa/wally-linux-imperas.do buildroot buildroot $::env(RISCV) 0 0 0"
|
@ -60,7 +60,7 @@ module uart_apb import cvw::*; #(parameter cvw_t P) (
|
||||
else assign PRDATA = {Dout, Dout, Dout, Dout};
|
||||
|
||||
logic BAUDOUTb; // loop tx clock BAUDOUTb back to rx clock RCLK
|
||||
uartPC16550D #(P.UART_PRESCALE) u(
|
||||
uartPC16550D #(P.UART_PRESCALE) uartPC(
|
||||
// Processor Interface
|
||||
.PCLK, .PRESETn,
|
||||
.A(entry), .Din,
|
||||
|
@ -139,7 +139,7 @@ module uncore import cvw::*; #(parameter cvw_t P)(
|
||||
end else begin : gpio
|
||||
assign GPIOOUT = 0; assign GPIOEN = 0; assign GPIOIntr = 0;
|
||||
end
|
||||
if (P.UART_SUPPORTED == 1) begin : uart
|
||||
if (P.UART_SUPPORTED == 1) begin : uartgen // Hack to work around Verilator bug https://github.com/verilator/verilator/issues/4769
|
||||
uart_apb #(P) uart(
|
||||
.PCLK, .PRESETn, .PSEL(PSEL[3]), .PADDR(PADDR[2:0]), .PWDATA, .PSTRB, .PWRITE, .PENABLE,
|
||||
.PRDATA(PRDATA[3]), .PREADY(PREADY[3]),
|
||||
|
@ -79,7 +79,7 @@ module wallypipelinedsoc import cvw::*; #(parameter cvw_t P) (
|
||||
);
|
||||
|
||||
// instantiate uncore if a bus interface exists
|
||||
if (P.BUS_SUPPORTED) begin : uncore
|
||||
if (P.BUS_SUPPORTED) begin : uncoregen // Hack to work around Verilator bug https://github.com/verilator/verilator/issues/4769
|
||||
uncore #(P) uncore(.HCLK, .HRESETn, .TIMECLK,
|
||||
.HADDR, .HWDATA, .HWSTRB, .HWRITE, .HSIZE, .HBURST, .HPROT, .HTRANS, .HMASTLOCK, .HRDATAEXT,
|
||||
.HREADYEXT, .HRESPEXT, .HRDATA, .HREADY, .HRESP, .HSELEXT, .HSELEXTSDC,
|
||||
|
@ -429,10 +429,10 @@ module testbench;
|
||||
string romfilename, sdcfilename;
|
||||
romfilename = {"../tests/custom/fpga-test-sdc/bin/fpga-test-sdc.memfile"};
|
||||
sdcfilename = {"../testbench/sdc/ramdisk2.hex"};
|
||||
//$readmemh(romfilename, dut.uncore.uncore.bootrom.bootrom.memory.ROM);
|
||||
//$readmemh(romfilename, dut.uncoregen.uncore.bootrom.bootrom.memory.ROM);
|
||||
//$readmemh(sdcfilename, sdcard.sdcard.FLASHmem);
|
||||
// shorten sdc timers for simulation
|
||||
//dut.uncore.uncore.sdc.SDC.LimitTimers = 1;
|
||||
//dut.uncoregen.uncore.sdc.SDC.LimitTimers = 1;
|
||||
end
|
||||
end
|
||||
end else if (P.IROM_SUPPORTED) begin
|
||||
@ -446,13 +446,13 @@ module testbench;
|
||||
if (LoadMem) begin
|
||||
if (TEST == "buildroot") begin
|
||||
memFile = $fopen(bootmemfilename, "rb");
|
||||
readResult = $fread(dut.uncore.uncore.bootrom.bootrom.memory.ROM, memFile);
|
||||
readResult = $fread(dut.uncoregen.uncore.bootrom.bootrom.memory.ROM, memFile);
|
||||
$fclose(memFile);
|
||||
memFile = $fopen(memfilename, "rb");
|
||||
readResult = $fread(dut.uncore.uncore.ram.ram.memory.RAM, memFile);
|
||||
readResult = $fread(dut.uncoregen.uncore.ram.ram.memory.RAM, memFile);
|
||||
$fclose(memFile);
|
||||
end else
|
||||
$readmemh(memfilename, dut.uncore.uncore.ram.ram.memory.RAM);
|
||||
$readmemh(memfilename, dut.uncoregen.uncore.ram.ram.memory.RAM);
|
||||
if (TEST == "embench") $display("Read memfile %s", memfilename);
|
||||
end
|
||||
if (CopyRAM) begin
|
||||
@ -461,7 +461,7 @@ module testbench;
|
||||
EndIndex = (end_signature_addr >> LogXLEN) + 8;
|
||||
BaseIndex = P.UNCORE_RAM_BASE >> LogXLEN;
|
||||
for(ShadowIndex = StartIndex; ShadowIndex <= EndIndex; ShadowIndex++) begin
|
||||
testbench.DCacheFlushFSM.ShadowRAM[ShadowIndex] = dut.uncore.uncore.ram.ram.memory.RAM[ShadowIndex - BaseIndex];
|
||||
testbench.DCacheFlushFSM.ShadowRAM[ShadowIndex] = dut.uncoregen.uncore.ram.ram.memory.RAM[ShadowIndex - BaseIndex];
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -489,7 +489,7 @@ module testbench;
|
||||
always @(posedge clk)
|
||||
if (ResetMem) // program memory is sometimes reset (e.g. for CoreMark, which needs zeroed memory)
|
||||
for (adrindex=0; adrindex<(P.UNCORE_RAM_RANGE>>1+(P.XLEN/32)); adrindex = adrindex+1)
|
||||
dut.uncore.uncore.ram.ram.memory.RAM[adrindex] = 0;
|
||||
dut.uncoregen.uncore.ram.ram.memory.RAM[adrindex] = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Actual hardware
|
||||
@ -580,15 +580,17 @@ module testbench;
|
||||
end
|
||||
|
||||
// Append UART output to file for tests
|
||||
if (P.UART_SUPPORTED) begin: uart_logger
|
||||
always @(posedge clk) begin
|
||||
if (P.UART_SUPPORTED & TEST == "buildroot") begin
|
||||
if (~dut.uncore.uncore.uart.uart.MEMWb & dut.uncore.uncore.uart.uart.u.A == 3'b000 & ~dut.uncore.uncore.uart.uart.u.DLAB) begin
|
||||
if (TEST == "buildroot") begin
|
||||
if (~dut.uncoregen.uncore.uartgen.uart.MEMWb & dut.uncoregen.uncore.uartgen.uart.uartPC.A == 3'b000 & ~dut.uncoregen.uncore.uartgen.uart.uartPC.DLAB) begin
|
||||
memFile = $fopen(uartoutfilename, "ab");
|
||||
$fwrite(memFile, "%c", dut.uncore.uncore.uart.uart.u.Din);
|
||||
$fwrite(memFile, "%c", dut.uncoregen.uncore.uartgen.uart.uartPC.Din);
|
||||
$fclose(memFile);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
// Termination condition
|
||||
// terminate on a specific ECALL after li x3,1 for old Imperas tests, *** remove this when old imperas tests are removed
|
||||
@ -857,9 +859,9 @@ end
|
||||
// **************************************
|
||||
// ***** BUG BUG BUG make sure RT undoes this.
|
||||
//if (P.DTIM_SUPPORTED) sig = testbench.dut.core.lsu.dtim.dtim.ram.RAM[testadrNoBase+i];
|
||||
//else if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncore.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncore.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
//if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncore.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
//else if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncoregen.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncoregen.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
//if (P.UNCORE_RAM_SUPPORTED) sig = testbench.dut.uncoregen.uncore.ram.ram.memory.RAM[testadrNoBase+i];
|
||||
//$display("signature[%h] = %h sig = %h", i, signature[i], sig);
|
||||
//if (signature[i] !== sig & (signature[i] !== testbench.DCacheFlushFSM.ShadowRAM[testadr+i])) begin
|
||||
if (signature[i] !== testbench.DCacheFlushFSM.ShadowRAM[testadr+i]) begin
|
||||
|
Loading…
Reference in New Issue
Block a user