Skip to content

Commit ac62889

Browse files
authored
feat(cells): add DR flip-flop (dffr_cell)
1 parent cf88638 commit ac62889

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/cells.v

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ module dff_cell (
8888

8989
endmodule
9090

91+
(* keep_hierarchy *)
92+
module dffr_cell (
93+
input wire clk,
94+
input wire d,
95+
input wire r,
96+
output reg q,
97+
output wire notq
98+
);
99+
100+
assign notq = !q;
101+
102+
always @(posedge clk or posedge r) begin
103+
if (r)
104+
q <= 0;
105+
else
106+
q <= d;
107+
end
108+
endmodule
109+
91110
(* keep_hierarchy *)
92111
module dffsr_cell (
93112
input wire clk,

0 commit comments

Comments
 (0)