File tree Expand file tree Collapse file tree 10 files changed +131
-132
lines changed Expand file tree Collapse file tree 10 files changed +131
-132
lines changed Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// #############################################################################
6
6
7
- module la_vbuf #(parameter N = 1 , // width of data inputs
7
+ module la_vbuf #(parameter W = 1 , // width of data inputs
8
8
parameter PROP = "DEFAULT" // custom cell property
9
9
)
10
10
(
11
- input [N - 1 :0 ] a,
12
- output [N - 1 :0 ] z
11
+ input [W - 1 :0 ] a,
12
+ output [W - 1 :0 ] z
13
13
);
14
14
15
15
assign z = a;
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// #############################################################################
6
6
7
- module la_vinv #(
8
- parameter N = 1 , // width of data inputs
7
+ module la_vinv #(parameter W = 1 , // width of data inputs
9
8
parameter PROP = "DEFAULT" // custom cell property
10
9
)
11
10
(
12
- input [N - 1 :0 ] a,
13
- output [N - 1 :0 ] z
11
+ input [W - 1 :0 ] a,
12
+ output [W - 1 :0 ] z
14
13
);
15
14
16
15
assign z = ~ a;
Original file line number Diff line number Diff line change 5
5
// ############################################################################
6
6
7
7
module la_vmux #(parameter N = 1 , // number of ports
8
- parameter DW = 1 , // data width
8
+ parameter W = 1 , // data width
9
9
parameter PROP = "DEFAULT" // cell property
10
10
)
11
11
(
12
- input [N- 1 :0 ] sel, // select vector
13
- input [DW * N- 1 :0 ] in, // flattened input {.., in1[DW -1:0],in0[DW -1:0]}
14
- output reg [DW - 1 :0 ] out // output
12
+ input [N- 1 :0 ] sel, // select vector
13
+ input [W * N- 1 :0 ] in, // flattened input {.., in1[W -1:0],in0[W -1:0]}
14
+ output reg [W - 1 :0 ] out // output
15
15
);
16
16
17
17
integer i;
18
18
always @* begin
19
- out[DW - 1 :0 ] = 'b0;
19
+ out[W - 1 :0 ] = 'b0;
20
20
for (i = 0 ; i < N; i = i + 1 )
21
- out[DW - 1 :0 ] = out[DW - 1 :0 ] | {(DW ) {sel[i]}} & in[i* DW + :DW ];
21
+ out[W - 1 :0 ] = out[W - 1 :0 ] | {(W ) {sel[i]}} & in[i* W + :W ];
22
22
end
23
23
24
24
// TODO: Add One hot warning
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux2 #(parameter DW = 1 , // width of mux
7
+ module la_vmux2 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel1,
12
- input sel0,
13
- input [DW - 1 :0 ] in1,
14
- input [DW - 1 :0 ] in0,
15
- output [DW - 1 :0 ] out
11
+ input sel1,
12
+ input sel0,
13
+ input [W - 1 :0 ] in1,
14
+ input [W - 1 :0 ] in0,
15
+ output [W - 1 :0 ] out
16
16
);
17
17
18
- assign out[DW - 1 :0 ] = ({(DW ) {sel0}} & in0[DW - 1 :0 ] |
19
- {(DW ) {sel1}} & in1[DW - 1 :0 ]);
18
+ assign out[W - 1 :0 ] = ({(W ) {sel0}} & in0[W - 1 :0 ] |
19
+ {(W ) {sel1}} & in1[W - 1 :0 ]);
20
20
21
21
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux3 #(parameter DW = 1 , // width of mux
7
+ module la_vmux3 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel2,
12
- input sel1,
13
- input sel0,
14
- input [DW - 1 :0 ] in2,
15
- input [DW - 1 :0 ] in1,
16
- input [DW - 1 :0 ] in0,
17
- output [DW - 1 :0 ] out
11
+ input sel2,
12
+ input sel1,
13
+ input sel0,
14
+ input [W - 1 :0 ] in2,
15
+ input [W - 1 :0 ] in1,
16
+ input [W - 1 :0 ] in0,
17
+ output [W - 1 :0 ] out
18
18
);
19
19
20
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
21
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
22
- {(DW ){sel2}} & in2[DW - 1 :0 ]);
20
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
21
+ {(W ){sel1}} & in1[W - 1 :0 ] |
22
+ {(W ){sel2}} & in2[W - 1 :0 ]);
23
23
24
24
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux4 #(parameter DW = 1 , // width of mux
7
+ module la_vmux4 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel3,
12
- input sel2,
13
- input sel1,
14
- input sel0,
15
- input [DW - 1 :0 ] in3,
16
- input [DW - 1 :0 ] in2,
17
- input [DW - 1 :0 ] in1,
18
- input [DW - 1 :0 ] in0,
19
- output [DW - 1 :0 ] out
11
+ input sel3,
12
+ input sel2,
13
+ input sel1,
14
+ input sel0,
15
+ input [W - 1 :0 ] in3,
16
+ input [W - 1 :0 ] in2,
17
+ input [W - 1 :0 ] in1,
18
+ input [W - 1 :0 ] in0,
19
+ output [W - 1 :0 ] out
20
20
);
21
21
22
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
23
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
24
- {(DW ){sel2}} & in2[DW - 1 :0 ] |
25
- {(DW ){sel3}} & in3[DW - 1 :0 ]);
22
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
23
+ {(W ){sel1}} & in1[W - 1 :0 ] |
24
+ {(W ){sel2}} & in2[W - 1 :0 ] |
25
+ {(W ){sel3}} & in3[W - 1 :0 ]);
26
26
27
27
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux5 #(parameter DW = 1 , // width of mux
7
+ module la_vmux5 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel4,
12
- input sel3,
13
- input sel2,
14
- input sel1,
15
- input sel0,
16
- input [DW - 1 :0 ] in4,
17
- input [DW - 1 :0 ] in3,
18
- input [DW - 1 :0 ] in2,
19
- input [DW - 1 :0 ] in1,
20
- input [DW - 1 :0 ] in0,
21
- output [DW - 1 :0 ] out
11
+ input sel4,
12
+ input sel3,
13
+ input sel2,
14
+ input sel1,
15
+ input sel0,
16
+ input [W - 1 :0 ] in4,
17
+ input [W - 1 :0 ] in3,
18
+ input [W - 1 :0 ] in2,
19
+ input [W - 1 :0 ] in1,
20
+ input [W - 1 :0 ] in0,
21
+ output [W - 1 :0 ] out
22
22
);
23
23
24
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
25
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
26
- {(DW ){sel2}} & in2[DW - 1 :0 ] |
27
- {(DW ){sel3}} & in3[DW - 1 :0 ] |
28
- {(DW ){sel4}} & in4[DW - 1 :0 ]);
24
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
25
+ {(W ){sel1}} & in1[W - 1 :0 ] |
26
+ {(W ){sel2}} & in2[W - 1 :0 ] |
27
+ {(W ){sel3}} & in3[W - 1 :0 ] |
28
+ {(W ){sel4}} & in4[W - 1 :0 ]);
29
29
30
30
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux6 #(parameter DW = 1 , // width of mux
7
+ module la_vmux6 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel5,
12
- input sel4,
13
- input sel3,
14
- input sel2,
15
- input sel1,
16
- input sel0,
17
- input [DW - 1 :0 ] in5,
18
- input [DW - 1 :0 ] in4,
19
- input [DW - 1 :0 ] in3,
20
- input [DW - 1 :0 ] in2,
21
- input [DW - 1 :0 ] in1,
22
- input [DW - 1 :0 ] in0,
23
- output [DW - 1 :0 ] out // selected data output
11
+ input sel5,
12
+ input sel4,
13
+ input sel3,
14
+ input sel2,
15
+ input sel1,
16
+ input sel0,
17
+ input [W - 1 :0 ] in5,
18
+ input [W - 1 :0 ] in4,
19
+ input [W - 1 :0 ] in3,
20
+ input [W - 1 :0 ] in2,
21
+ input [W - 1 :0 ] in1,
22
+ input [W - 1 :0 ] in0,
23
+ output [W - 1 :0 ] out // selected data output
24
24
);
25
25
26
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
27
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
28
- {(DW ){sel2}} & in2[DW - 1 :0 ] |
29
- {(DW ){sel3}} & in3[DW - 1 :0 ] |
30
- {(DW ){sel4}} & in4[DW - 1 :0 ] |
31
- {(DW ){sel5}} & in5[DW - 1 :0 ]);
26
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
27
+ {(W ){sel1}} & in1[W - 1 :0 ] |
28
+ {(W ){sel2}} & in2[W - 1 :0 ] |
29
+ {(W ){sel3}} & in3[W - 1 :0 ] |
30
+ {(W ){sel4}} & in4[W - 1 :0 ] |
31
+ {(W ){sel5}} & in5[W - 1 :0 ]);
32
32
33
33
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux7 #(parameter DW = 1 , // width of mux
7
+ module la_vmux7 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel6,
12
- input sel5,
13
- input sel4,
14
- input sel3,
15
- input sel2,
16
- input sel1,
17
- input sel0,
18
- input [DW - 1 :0 ] in6,
19
- input [DW - 1 :0 ] in5,
20
- input [DW - 1 :0 ] in4,
21
- input [DW - 1 :0 ] in3,
22
- input [DW - 1 :0 ] in2,
23
- input [DW - 1 :0 ] in1,
24
- input [DW - 1 :0 ] in0,
25
- output [DW - 1 :0 ] out
11
+ input sel6,
12
+ input sel5,
13
+ input sel4,
14
+ input sel3,
15
+ input sel2,
16
+ input sel1,
17
+ input sel0,
18
+ input [W - 1 :0 ] in6,
19
+ input [W - 1 :0 ] in5,
20
+ input [W - 1 :0 ] in4,
21
+ input [W - 1 :0 ] in3,
22
+ input [W - 1 :0 ] in2,
23
+ input [W - 1 :0 ] in1,
24
+ input [W - 1 :0 ] in0,
25
+ output [W - 1 :0 ] out
26
26
);
27
27
28
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
29
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
30
- {(DW ){sel2}} & in2[DW - 1 :0 ] |
31
- {(DW ){sel3}} & in3[DW - 1 :0 ] |
32
- {(DW ){sel4}} & in4[DW - 1 :0 ] |
33
- {(DW ){sel5}} & in5[DW - 1 :0 ] |
34
- {(DW ){sel6}} & in6[DW - 1 :0 ]);
28
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
29
+ {(W ){sel1}} & in1[W - 1 :0 ] |
30
+ {(W ){sel2}} & in2[W - 1 :0 ] |
31
+ {(W ){sel3}} & in3[W - 1 :0 ] |
32
+ {(W ){sel4}} & in4[W - 1 :0 ] |
33
+ {(W ){sel5}} & in5[W - 1 :0 ] |
34
+ {(W ){sel6}} & in6[W - 1 :0 ]);
35
35
36
36
endmodule
Original file line number Diff line number Diff line change 4
4
// # License: MIT (see LICENSE file in Lambda repository) #
5
5
// ############################################################################
6
6
7
- module la_vmux8 #(parameter DW = 1 , // width of mux
7
+ module la_vmux8 #(parameter W = 1 , // width of mux
8
8
parameter PROP = "DEFAULT" // cell property
9
9
)
10
10
(
11
- input sel7,
12
- input sel6,
13
- input sel5,
14
- input sel4,
15
- input sel3,
16
- input sel2,
17
- input sel1,
18
- input sel0,
19
- input [DW - 1 :0 ] in7,
20
- input [DW - 1 :0 ] in6,
21
- input [DW - 1 :0 ] in5,
22
- input [DW - 1 :0 ] in4,
23
- input [DW - 1 :0 ] in3,
24
- input [DW - 1 :0 ] in2,
25
- input [DW - 1 :0 ] in1,
26
- input [DW - 1 :0 ] in0,
27
- output [DW - 1 :0 ] out
11
+ input sel7,
12
+ input sel6,
13
+ input sel5,
14
+ input sel4,
15
+ input sel3,
16
+ input sel2,
17
+ input sel1,
18
+ input sel0,
19
+ input [W - 1 :0 ] in7,
20
+ input [W - 1 :0 ] in6,
21
+ input [W - 1 :0 ] in5,
22
+ input [W - 1 :0 ] in4,
23
+ input [W - 1 :0 ] in3,
24
+ input [W - 1 :0 ] in2,
25
+ input [W - 1 :0 ] in1,
26
+ input [W - 1 :0 ] in0,
27
+ output [W - 1 :0 ] out
28
28
);
29
29
30
- assign out[DW - 1 :0 ] = ({(DW ){sel0}} & in0[DW - 1 :0 ] |
31
- {(DW ){sel1}} & in1[DW - 1 :0 ] |
32
- {(DW ){sel2}} & in2[DW - 1 :0 ] |
33
- {(DW ){sel3}} & in3[DW - 1 :0 ] |
34
- {(DW ){sel4}} & in4[DW - 1 :0 ] |
35
- {(DW ){sel5}} & in5[DW - 1 :0 ] |
36
- {(DW ){sel6}} & in6[DW - 1 :0 ] |
37
- {(DW ){sel7}} & in7[DW - 1 :0 ]);
30
+ assign out[W - 1 :0 ] = ({(W ){sel0}} & in0[W - 1 :0 ] |
31
+ {(W ){sel1}} & in1[W - 1 :0 ] |
32
+ {(W ){sel2}} & in2[W - 1 :0 ] |
33
+ {(W ){sel3}} & in3[W - 1 :0 ] |
34
+ {(W ){sel4}} & in4[W - 1 :0 ] |
35
+ {(W ){sel5}} & in5[W - 1 :0 ] |
36
+ {(W ){sel6}} & in6[W - 1 :0 ] |
37
+ {(W ){sel7}} & in7[W - 1 :0 ]);
38
38
39
39
endmodule
You can’t perform that action at this time.
0 commit comments