@@ -40,15 +40,15 @@ module zeroriscy_ex_block
4040
4141 // ALU signals from ID stage
4242 input logic [ALU_OP_WIDTH - 1 : 0 ] alu_operator_i,
43- input logic [1 : 0 ] mult_operator_i ,
44- input logic mult_en_i ,
43+ input logic [1 : 0 ] multdiv_operator_i ,
44+ input logic multdiv_en_i ,
4545
4646 input logic [31 : 0 ] alu_operand_a_i,
4747 input logic [31 : 0 ] alu_operand_b_i,
4848
49- input logic [1 : 0 ] mult_signed_mode_i ,
50- input logic [31 : 0 ] mult_operand_a_i ,
51- input logic [31 : 0 ] mult_operand_b_i ,
49+ input logic [1 : 0 ] multdiv_signed_mode_i ,
50+ input logic [31 : 0 ] multdiv_operand_a_i ,
51+ input logic [31 : 0 ] multdiv_operand_b_i ,
5252
5353 output logic [31 : 0 ] alu_adder_result_ex_o,
5454 output logic [31 : 0 ] regfile_wdata_ex_o,
@@ -66,18 +66,18 @@ module zeroriscy_ex_block
6666
6767 localparam MULT_TYPE = 0 ; // 0 is SLOW
6868
69- logic [31 : 0 ] alu_result, mult_result ;
69+ logic [31 : 0 ] alu_result, multdiv_result ;
7070
71- logic [32 : 0 ] mult_alu_operand_a_sel, mult_alu_operand_b_sel, mult_alu_operand_a, mult_alu_operand_b ;
71+ logic [32 : 0 ] multdiv_alu_operand_a_sel, multdiv_alu_operand_b_sel, multdiv_alu_operand_a, multdiv_alu_operand_b ;
7272 logic [33 : 0 ] alu_adder_result_ext;
7373 logic alu_cmp_result, alu_is_equal_result;
74- logic mult_ready, mult_en_sel ;
74+ logic multdiv_ready, multdiv_en_sel ;
7575
76- assign mult_en_sel = MULT_TYPE == 0 ? mult_en_i : 1'b0 ;
77- assign mult_alu_operand_a_sel = MULT_TYPE == 0 ? mult_alu_operand_a : alu_operand_a_i;
78- assign mult_alu_operand_b_sel = MULT_TYPE == 0 ? mult_alu_operand_b : alu_operand_b_i;
76+ assign multdiv_en_sel = MULT_TYPE == 0 ? multdiv_en_i : 1'b0 ;
77+ assign multdiv_alu_operand_a_sel = MULT_TYPE == 0 ? multdiv_alu_operand_a : alu_operand_a_i;
78+ assign multdiv_alu_operand_b_sel = MULT_TYPE == 0 ? multdiv_alu_operand_b : alu_operand_b_i;
7979
80- assign regfile_wdata_ex_o = mult_en_i ? mult_result : alu_result;
80+ assign regfile_wdata_ex_o = multdiv_en_i ? multdiv_result : alu_result;
8181
8282 // branch handling
8383 assign branch_decision_o = alu_cmp_result;
@@ -94,57 +94,57 @@ module zeroriscy_ex_block
9494
9595 zeroriscy_alu alu_i
9696 (
97- .operator_i ( alu_operator_i ),
98- .operand_a_i ( alu_operand_a_i ),
99- .operand_b_i ( alu_operand_b_i ),
100- .mult_operand_a_i ( mult_alu_operand_a_sel ),
101- .mult_operand_b_i ( mult_alu_operand_b_sel ),
102- .mult_en_i ( mult_en_sel ),
103- .adder_result_o ( alu_adder_result_ex_o ),
104- .adder_result_ext_o ( alu_adder_result_ext ),
105- .result_o ( alu_result ),
106- .comparison_result_o ( alu_cmp_result ),
107- .is_equal_result_o ( alu_is_equal_result )
97+ .operator_i ( alu_operator_i ),
98+ .operand_a_i ( alu_operand_a_i ),
99+ .operand_b_i ( alu_operand_b_i ),
100+ .multdiv_operand_a_i ( multdiv_alu_operand_a_sel ),
101+ .multdiv_operand_b_i ( multdiv_alu_operand_b_sel ),
102+ .multdiv_en_i ( multdiv_en_sel ),
103+ .adder_result_o ( alu_adder_result_ex_o ),
104+ .adder_result_ext_o ( alu_adder_result_ext ),
105+ .result_o ( alu_result ),
106+ .comparison_result_o ( alu_cmp_result ),
107+ .is_equal_result_o ( alu_is_equal_result )
108108 );
109109
110- if (MULT_TYPE == 0 ) begin : mult_slow
111- zeroriscy_mult_slow mult_i
110+ if (MULT_TYPE == 0 ) begin : multdiv_slow
111+ zeroriscy_multdiv_slow multdiv_i
112112 (
113- .clk ( clk ),
114- .rst_n ( rst_n ),
115- .mult_en_i ( mult_en_i ),
116- .operator_i ( mult_operator_i ),
117- .signed_mode_i ( mult_signed_mode_i ),
118- .op_a_i ( mult_operand_a_i ),
119- .op_b_i ( mult_operand_b_i ),
120- .alu_adder_ext_i ( alu_adder_result_ext ),
121- .alu_adder_i ( alu_adder_result_ex_o ),
122- .equal_to_zero ( alu_is_equal_result ),
123- .ready_o ( mult_ready ),
124- .alu_operand_a_o ( mult_alu_operand_a ),
125- .alu_operand_b_o ( mult_alu_operand_b ),
126- .mult_result_o ( mult_result )
113+ .clk ( clk ),
114+ .rst_n ( rst_n ),
115+ .multdiv_en_i ( multdiv_en_i ),
116+ .operator_i ( multdiv_operator_i ),
117+ .signed_mode_i ( multdiv_signed_mode_i ),
118+ .op_a_i ( multdiv_operand_a_i ),
119+ .op_b_i ( multdiv_operand_b_i ),
120+ .alu_adder_ext_i ( alu_adder_result_ext ),
121+ .alu_adder_i ( alu_adder_result_ex_o ),
122+ .equal_to_zero ( alu_is_equal_result ),
123+ .ready_o ( multdiv_ready ),
124+ .alu_operand_a_o ( multdiv_alu_operand_a ),
125+ .alu_operand_b_o ( multdiv_alu_operand_b ),
126+ .multdiv_result_o ( multdiv_result )
127127 );
128128 end else begin : mult_fast
129129 zeroriscy_mult_fast mult_i
130130 (
131- .clk ( clk ),
132- .rst_n ( rst_n ),
133- .mult_en_i ( mult_en_i ),
134- .operator_i ( mult_operator_i ),
135- .signed_mode_i ( mult_signed_mode_i ),
136- .op_a_i ( mult_operand_a_i ),
137- .op_b_i ( mult_operand_b_i ),
138- .ready_o ( mult_ready ),
139- .mult_result_o ( mult_result )
131+ .clk ( clk ),
132+ .rst_n ( rst_n ),
133+ .multdiv_en_i ( multdiv_en_i ),
134+ .operator_i ( multdiv_operator_i ),
135+ .signed_mode_i ( multdiv_signed_mode_i ),
136+ .op_a_i ( multdiv_operand_a_i ),
137+ .op_b_i ( multdiv_operand_b_i ),
138+ .ready_o ( multdiv_ready ),
139+ .multdiv_result_o ( multdiv_result )
140140 );
141141 end
142142
143143 always_comb
144144 begin
145145 unique case (1'b1 )
146- mult_en_i :
147- ex_ready_o = mult_ready ;
146+ multdiv_en_i :
147+ ex_ready_o = multdiv_ready ;
148148 lsu_en_i:
149149 ex_ready_o = lsu_ready_ex_i;
150150 default :
0 commit comments