From f945acf712b91f3d2d1d2769930aef4888291290 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Fri, 12 Aug 2016 16:58:22 -0700 Subject: [PATCH] rm race condition on trace_count --- vsrc/TestDriver.v | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/vsrc/TestDriver.v b/vsrc/TestDriver.v index f188c96e..02d2cd54 100644 --- a/vsrc/TestDriver.v +++ b/vsrc/TestDriver.v @@ -45,6 +45,13 @@ module TestDriver; integer stderr = 32'h80000002; always @(posedge clk) begin + trace_count = trace_count + 1; +`ifdef GATE_LEVEL + if (verbose) + begin + $fdisplay(stderr, "C: %10d", trace_count-1); + end +`endif if (!reset) begin if (max_cycles > 0 && trace_count > max_cycles) @@ -70,17 +77,6 @@ module TestDriver; end end - always @(posedge clk) - begin - trace_count = trace_count + 1; -`ifdef GATE_LEVEL - if (verbose) - begin - $fdisplay(stderr, "C: %10d", trace_count-1); - end -`endif - end - TestHarness testHarness( .clk(clk), .reset(reset),