diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 11:11:50 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-08-07 11:11:50 -0700 |
commit | e6d5147214bd157c457654dc46547775ec6ad324 (patch) | |
tree | 420b4e76aec5d70e2f83b2aa56a783ea5b461a66 /techlibs/anlogic/arith_map.v | |
parent | 0c78c62d6c043925293c0ff934c41f2df6932b85 (diff) | |
parent | 5545cd3c108ef240ccf6278b2734412acf81cd2a (diff) | |
download | yosys-e6d5147214bd157c457654dc46547775ec6ad324.tar.gz yosys-e6d5147214bd157c457654dc46547775ec6ad324.tar.bz2 yosys-e6d5147214bd157c457654dc46547775ec6ad324.zip |
Merge remote-tracking branch 'origin/master' into eddie/cleanup
Diffstat (limited to 'techlibs/anlogic/arith_map.v')
-rw-r--r-- | techlibs/anlogic/arith_map.v | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/techlibs/anlogic/arith_map.v b/techlibs/anlogic/arith_map.v index 11cd140ec..6d6a7ca37 100644 --- a/techlibs/anlogic/arith_map.v +++ b/techlibs/anlogic/arith_map.v @@ -42,10 +42,9 @@ module _80_anlogic_alu (A, B, CI, BI, X, Y, CO); wire [Y_WIDTH-1:0] AA = A_buf; wire [Y_WIDTH-1:0] BB = BI ? ~B_buf : B_buf; wire [Y_WIDTH+1:0] COx; - wire [Y_WIDTH+1:0] C = {COx, CI}; + wire [Y_WIDTH+2:0] C = {COx, CI}; wire dummy; - (* keep *) AL_MAP_ADDER #( .ALUTYPE("ADD_CARRY")) adder_cin ( @@ -55,19 +54,6 @@ module _80_anlogic_alu (A, B, CI, BI, X, Y, CO); genvar i; generate for (i = 0; i < Y_WIDTH; i = i + 1) begin: slice - if(i==Y_WIDTH-1) begin - (* keep *) - AL_MAP_ADDER #( - .ALUTYPE("ADD")) - adder_cout ( - .c(C[Y_WIDTH]), - .o(COx[Y_WIDTH]) - ); - assign CO = COx[Y_WIDTH]; - end - else - begin - (* keep *) AL_MAP_ADDER #( .ALUTYPE("ADD") ) adder_i ( @@ -76,9 +62,15 @@ module _80_anlogic_alu (A, B, CI, BI, X, Y, CO); .c(C[i+1]), .o({COx[i+1],Y[i]}) ); - end end: slice endgenerate /* End implementation */ + AL_MAP_ADDER #( + .ALUTYPE("ADD")) + adder_cout ( + .c(C[Y_WIDTH+1]), + .o(COx[Y_WIDTH+1]) + ); + assign CO = COx[Y_WIDTH+1]; assign X = AA ^ BB; endmodule
\ No newline at end of file |