diff --git a/tests/techmap/dfflibmap-sim.v b/tests/techmap/dfflibmap-sim.v index 1788a683b..42006a211 100644 --- a/tests/techmap/dfflibmap-sim.v +++ b/tests/techmap/dfflibmap-sim.v @@ -20,3 +20,12 @@ always @(posedge CLK, posedge CLEAR, posedge PRESET) assign QN = ~Q; endmodule + +module dffe(input CLK, EN, D, output reg Q, output QN); + +always @(negedge CLK) + if (EN) Q <= D; + +assign QN = ~Q; + +endmodule diff --git a/tests/techmap/dfflibmap.lib b/tests/techmap/dfflibmap.lib index ce460877e..fe5029aeb 100644 --- a/tests/techmap/dfflibmap.lib +++ b/tests/techmap/dfflibmap.lib @@ -52,4 +52,28 @@ library(test) { function : "IQN"; } } + cell (dffe) { + area : 6; + ff("IQ", "IQN") { + next_state : "(D&DE) | (IQ&!DE)"; + clocked_on : "!CLK"; + } + pin(D) { + direction : input; + } + pin(DE) { + direction : input; + } + pin(CLK) { + direction : input; + } + pin(Q) { + direction: output; + function : "IQ"; + } + pin(QN) { + direction: output; + function : "IQN"; + } + } } diff --git a/tests/techmap/dfflibmap.ys b/tests/techmap/dfflibmap.ys index e8b125456..a1f91d911 100644 --- a/tests/techmap/dfflibmap.ys +++ b/tests/techmap/dfflibmap.ys @@ -1,14 +1,15 @@ +# $_DFF_PP0_ ff1 (.C(C), .D(D), .R(R), .Q(Q[1])); +# $_DFF_PP1_ ff2 (.C(C), .D(D), .R(R), .Q(Q[2])); +# $_DFFSR_PPP_ ff3 (.C(C), .D(D), .R(R), .S(S), .Q(Q[3])); +# $_DFFSR_NNN_ ff4 (.C(C), .D(D), .R(R), .S(S), .Q(Q[4])); read_verilog -icells <