blob: 012717df95b0748fd2e5b8ec6c11abd54ef0be7a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// AFFR # ( .WIDTH/.DTYPE() ) ff_ ( .q(), .d(), .en(), .clk() , .rst_l );
module AFFR
#(
parameter WIDTH = 1,
parameter type DTYPE = logic [WIDTH-1:0],
parameter logic [$bits(DTYPE)-1:0] RST_VALUE = '0
)
(
input logic clk,
input logic en,
input logic rst_l,
input DTYPE d,
output DTYPE q
);
always_ff @(posedge clk) begin
if (~rst_l) q <= DTYPE'(RST_VALUE);
else if (en) q <= d;
end
endmodule
|