Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

lm32: fix test bench

If simulation run with caches disabled, the test bench will throw errors.
Fix this.

Signed-off-by: Michael Walle <michael@walle.cc>
  • Loading branch information...
commit 254f48b2e18bc66b0cc85009fe1f375cd8152465 1 parent abbad88
@mwalle mwalle authored sbourdeauducq committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 cores/lm32/test/tb_lm32.v
View
10 cores/lm32/test/tb_lm32.v
@@ -195,16 +195,26 @@ initial begin
end else
trace_enabled = 0;
end
+`ifdef CFG_ICACHE_ENABLED
assign icache_ready = lm32.cpu.instruction_unit.icache.state != 1;
+`else
+assign icache_ready = `TRUE;
+`endif
+`ifdef CFG_DCACHE_ENABLED
assign dcache_ready = lm32.cpu.load_store_unit.dcache.state != 1;
+`else
+assign dcache_ready = `TRUE;
+`endif
always @(posedge sys_clk) begin
// wait until icache and dcache init is done
if(!trace_started && icache_ready && dcache_ready)
trace_started = 1;
if(trace_enabled && trace_started) begin
$fwrite(tracefd, "%-d ", cycle);
+`ifdef CFG_ICACHE_ENABLED
$fwrite(tracefd, "%x ", {lm32.cpu.instruction_unit.pc_a, 2'b00});
$fwrite(tracefd, "%1d ", lm32.cpu.valid_a);
+`endif
$fwrite(tracefd, "%x ", {lm32.cpu.instruction_unit.pc_f, 2'b00});
$fwrite(tracefd, "%1d ", lm32.cpu.kill_f);
$fwrite(tracefd, "%1d ", lm32.cpu.valid_f);
Please sign in to comment.
Something went wrong with that request. Please try again.