1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-17 20:02:53 +08:00

Fixing concatenation bug

-Don't use concatenation for generators!
-Will failt for DW=1
This commit is contained in:
Andreas.Olofsson 2020-08-14 10:38:03 -04:00
parent 5c0df270c5
commit 76e6cd3c15

View File

@ -14,13 +14,14 @@ module oh_csa42 #( parameter DW = 1 // data width
input cin,//intra stage carry in
output cout, //intra stage carry out (2x sum)
output [DW-1:0] s, //sum
output [DW-1:0] c //carry (2x sum)
output [DW-1:0] c //carry (=2x sum)
);
wire [DW-1:0] sum_int;
wire [DW:0] carry_int;
//Edges
assign carry_int[0] = cin;
assign cout = carry_int[DW];
//Full Adders
@ -37,7 +38,7 @@ module oh_csa42 #( parameter DW = 1 // data width
fa1 (//inputs
.in0(in3[DW-1:0]),
.in1(sum_int[DW-1:0]),
.in2({carry_int[DW-1:1],cin}),
.in2(carry_int[DW-1:0]),
//outputs
.c(c[DW-1:0]),
.s(s[DW-1:0]));