aboutsummaryrefslogtreecommitdiffstats
path: root/tests/techmap/dfflibmap-sim.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/techmap/dfflibmap-sim.v')
-rw-r--r--tests/techmap/dfflibmap-sim.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/techmap/dfflibmap-sim.v b/tests/techmap/dfflibmap-sim.v
new file mode 100644
index 000000000..1788a683b
--- /dev/null
+++ b/tests/techmap/dfflibmap-sim.v
@@ -0,0 +1,22 @@
+module dffn(input CLK, D, output reg Q, output QN);
+
+always @(negedge CLK)
+ Q <= D;
+
+assign QN = ~Q;
+
+endmodule
+
+module dffsr(input CLK, D, CLEAR, PRESET, output reg Q, output QN);
+
+always @(posedge CLK, posedge CLEAR, posedge PRESET)
+ if (CLEAR)
+ Q <= 0;
+ else if (PRESET)
+ Q <= 1;
+ else
+ Q <= D;
+
+assign QN = ~Q;
+
+endmodule