mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-15 06:01:28 +00:00
Added adff2dff.v (for techmap -share_map)
This commit is contained in:
parent
d259abbda2
commit
312ee00c9e
2 changed files with 32 additions and 1 deletions
27
techlibs/common/adff2dff.v
Normal file
27
techlibs/common/adff2dff.v
Normal file
|
@ -0,0 +1,27 @@
|
|||
(* techmap_celltype = "$adff" *)
|
||||
module adff2dff (CLK, ARST, D, Q);
|
||||
parameter WIDTH = 1;
|
||||
parameter CLK_POLARITY = 1;
|
||||
parameter ARST_POLARITY = 1;
|
||||
parameter ARST_VALUE = 0;
|
||||
|
||||
input CLK, ARST;
|
||||
input [WIDTH-1:0] D;
|
||||
output reg [WIDTH-1:0] Q;
|
||||
wire reg [WIDTH-1:0] NEXT_Q;
|
||||
|
||||
wire [1023:0] _TECHMAP_DO_ = "proc;;";
|
||||
|
||||
always @*
|
||||
if (ARST == ARST_POLARITY)
|
||||
NEXT_Q <= ARST_VALUE;
|
||||
else
|
||||
NEXT_Q <= D;
|
||||
|
||||
if (CLK_POLARITY)
|
||||
always @(posedge CLK)
|
||||
Q <= NEXT_Q;
|
||||
else
|
||||
always @(negedge CLK)
|
||||
Q <= NEXT_Q;
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue