From c2c5f4e859a48412482c30649a1983af4a91ef07 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 29 Jul 2020 16:46:25 +0200 Subject: [PATCH] Ensure sync2x and sync are in sync (fixes #20) --- gram/simulation/simcrgtb.sv | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gram/simulation/simcrgtb.sv b/gram/simulation/simcrgtb.sv index 289c9ec..4039581 100644 --- a/gram/simulation/simcrgtb.sv +++ b/gram/simulation/simcrgtb.sv @@ -66,4 +66,12 @@ module simcrgtb; last_sync2x_tick = $time; end + + always @(posedge top.crg_dramsync_clk) + begin + if (top.crg_dramsync_clk && $time > 700000) + begin + assert(top.crg_sync2x_clk == 1) else $error("dramsync and sync2x are out of sync"); + end + end endmodule -- 2.30.2