From c2c3978db25482f2be8b3e6330bbe234692f6b4b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 14 Apr 2016 00:48:58 +0200 Subject: [PATCH] Improvements in dhrystone "make timing" --- dhrystone/Makefile | 7 +++++-- dhrystone/testbench.v | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dhrystone/Makefile b/dhrystone/Makefile index a4622f0..707a94f 100644 --- a/dhrystone/Makefile +++ b/dhrystone/Makefile @@ -6,9 +6,12 @@ TOOLCHAIN_PREFIX = riscv32-unknown-elf- test: testbench.exe dhry.hex vvp -N testbench.exe -timing: timing.exe dhry.hex +timing: timing.txt + grep '^##' timing.txt | gawk 'x != "" {print x,$$3-y;} {x=$$2;y=$$3;}' | sort | uniq -c | \ + gawk '{printf("%03d-%-7s %2d %-8s (%d)\n",$$3,$$2,$$3,$$2,$$1);}' | sort | cut -c13- + +timing.txt: timing.exe dhry.hex vvp -N timing.exe > timing.txt - grep '^##' timing.txt | gawk 'x != "" {print x,$$3-y;} {x=$$2;y=$$3;}' | sort | uniq -c | sort -k3 -n testbench.exe: testbench.v ../picorv32.v iverilog -o testbench.exe testbench.v ../picorv32.v diff --git a/dhrystone/testbench.v b/dhrystone/testbench.v index aa32619..a00e8f4 100644 --- a/dhrystone/testbench.v +++ b/dhrystone/testbench.v @@ -92,8 +92,8 @@ module testbench; $finish; end always @(posedge clk) begin - if (uut.decoder_trigger_q && !uut.decoder_pseudo_trigger_q) - $display("## %-s %d", uut.dbg_ascii_instr ? uut.dbg_ascii_instr : "x", uut.count_cycle); + if (uut.dbg_next) + $display("## %-s %d", uut.dbg_ascii_instr ? uut.dbg_ascii_instr : "pcpi", uut.count_cycle); end `endif endmodule