output SUM;
output COUT;
-parameter ADD = 0;
-parameter SUB = 1;
-parameter ADDSUB = 2;
-parameter NE = 3;
-parameter GE = 4;
-parameter LE = 5;
-parameter CUP = 6;
-parameter CDN = 7;
-parameter CUPCDN = 8;
-parameter MULT = 9;
+localparam ADD = 0;
+localparam SUB = 1;
+localparam ADDSUB = 2;
+localparam NE = 3;
+localparam GE = 4;
+localparam LE = 5;
+localparam CUP = 6;
+localparam CDN = 7;
+localparam CUPCDN = 8;
+localparam MULT = 9;
parameter ALU_MODE = 0;
assign SUM = S ^ CIN;
assign COUT = S? CIN : C;
-always @(I0, I1, I3,CIN) begin
+always @* begin
case (ALU_MODE)
ADD: begin
S = I0 ^ I1;
equiv_opt -assert -map +/gowin/cells_sim.v synth_gowin # equivalency check
design -load postopt # load the post-opt design (otherwise equiv_opt loads the pre-opt design)
cd mux16 # Constrain all select calls below inside the top module
-select -assert-count 9 t:LUT4
-select -assert-count 3 t:LUT3
+select -assert-count 10 t:LUT4
+select -assert-count 1 t:LUT3
select -assert-count 20 t:IBUF
select -assert-count 1 t:OBUF