diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2022-02-21 17:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 17:57:44 +0100 |
commit | d0b72e75d95828743b38184ee977c3c56f259b38 (patch) | |
tree | d4cdb702831ad471a26c4f96f70900f701166a05 /tests/sim/tb/tb_dlatch.v | |
parent | d0f4d0b153572ddee5f19831f40b9c40eb480db0 (diff) | |
parent | fd3f08753a2c577bb87ad332329213c58d4a9326 (diff) | |
download | yosys-d0b72e75d95828743b38184ee977c3c56f259b38.tar.gz yosys-d0b72e75d95828743b38184ee977c3c56f259b38.tar.bz2 yosys-d0b72e75d95828743b38184ee977c3c56f259b38.zip |
Merge pull request #3203 from YosysHQ/micko/sim_ff
Simulation for various FF types
Diffstat (limited to 'tests/sim/tb/tb_dlatch.v')
-rwxr-xr-x | tests/sim/tb/tb_dlatch.v | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/sim/tb/tb_dlatch.v b/tests/sim/tb/tb_dlatch.v new file mode 100755 index 000000000..aea6cb0a3 --- /dev/null +++ b/tests/sim/tb/tb_dlatch.v @@ -0,0 +1,50 @@ +`timescale 1ns/1ns +module tb_dlatch(); + reg clk = 0; + reg en = 0; + reg d = 0; + wire q; + + dlatch uut(.d(d),.en(en),.q(q)); + + always + #(5) clk <= !clk; + + initial + begin + $dumpfile("tb_dlatch"); + $dumpvars(0,tb_dlatch); + #10 + d = 1; + #10 + d = 0; + #10 + d = 1; + #10 + d = 0; + #10 + d = 1; + #10 + d = 0; + #10 + en = 1; + #10 + d = 1; + #10 + d = 0; + #10 + d = 1; + #10 + d = 0; + #10 + d = 1; + #10 + d = 0; + #10 + d = 1; + #10 + d = 0; + #10 + $finish; + end +endmodule |