-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdelay.v
More file actions
32 lines (28 loc) · 755 Bytes
/
delay.v
File metadata and controls
32 lines (28 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* simple delay element done with the use of LUT */
module delay # (
/* number of luts used */
parameter LENGTH = 1
)
(
/* input signal */
input wire a,
/* output signal */
output wire o
);
genvar i;
/* lut generation */
generate
for (i = 0; i < LENGTH; i = i + 1) begin : DELAY_ELEMS
wire z /* synthesis syn_keep=1 nomerge=""*/;
/* 1st element, uses 'a' as the input signal */
if (i == 0) begin
LUT4 # (.init(16'h0002)) I1 (.A(a), .B(1'b0), .C(1'b0), .D(1'b0), .Z(z));
/* evey other element uses _z signal as the input */
end else begin
LUT4 # (.init(16'h0002)) I1 (.A(DELAY_ELEMS[i-1].z), .B(1'b0), .C(1'b0), .D(1'b0), .Z(z));
end
end
endgenerate
/* assign output signals */
assign o = DELAY_ELEMS[LENGTH - 1].z;
endmodule