1 // This file is Copyright (c) 2020 LambdaConcept <contact@lambdaconcept.com>
6 // GSR & PUR init requires for Lattice models
16 // Generate 100 Mhz clock
32 $dumpfile("simcrg.fst");
39 assert (top.crg_dramsync_rst == 1'b1) else $error("DRAM clock domain is not reset at t=0");
42 always @(negedge top.crg_dramsync_rst)
44 assert($time > 600000) else $error("DRAM sync got out of reset before 600us (too early)");
45 assert($time < 700000) else $error("DRAM sync got out of reset after 700us (too late)");
48 time last_dramsync_tick;
49 always @(posedge top.crg_dramsync_clk)
51 if (top.crg_dramsync_rst == 1'b0)
53 assert ($time - last_dramsync_tick == 10) else $error("dramsync isn't running at 100Mhz");
56 last_dramsync_tick = $time;
59 time last_sync2x_tick;
60 always @(posedge top.crg_sync2x_clk)
62 if (top.crg_dramsync_rst == 1'b0)
64 assert ($time - last_sync2x_tick == 5) else $error("sync2x isn't running at 200Mhz");
67 last_sync2x_tick = $time;