-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathE1_qadd_g.sv
44 lines (40 loc) · 956 Bytes
/
E1_qadd_g.sv
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
33
34
35
36
37
38
39
40
41
42
43
44
`timescale 1ps / 1ps
// qadd module group
module E1_qadd_g #(
parameter Q = 15,
parameter N = 64,
parameter NUM = 4 //content of the group
)
(
input clk,
input rst,
input [N * NUM - 1 : 0] a,
input a_en,
input [N * NUM - 1 : 0] b,
input b_en,
output [N * NUM - 1 : 0] c,
output c_valid
);
reg [NUM - 1 : 0] c_valid_g;
//instantiation of 4 qadd modules using "generate" statement
genvar i;
generate
for (i = 0; i < NUM; i = i + 1) begin : qadd_inst
E1_qadd #(
.Q(Q),
.N(N)
)
qadd (
.clk(clk),
.rst(rst),
.a(a[N * (i + 1) - 1 : N * i]),
.a_en(a_en),
.b(b[N * (i + 1) - 1 : N * i]),
.b_en(b_en),
.c(c[N * (i + 1) - 1 : N * i]),
.c_valid(c_valid_g[i])
);
end
endgenerate
assign c_valid = &c_valid_g;
endmodule