summaryrefslogtreecommitdiff
path: root/rtl/core/control/mul.sv
blob: 8d2351485ee80c88944cb3ef880d8afcc8fad96e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
`include "core/uarch.sv"

module core_control_mul
(
	input  logic           clk,

	input  datapath_decode dec,
	input  mul_decode      dec_mul,
	input  logic           mul_ready,

	input  ctrl_cycle      next_cycle,
	input  logic           issue,

	output logic           mul,
	                       mul_add,
	                       mul_long,
	                       mul_signed
);

	always_ff @(posedge clk)
		if(next_cycle == ISSUE && issue) begin
			mul <= dec.mul;
			mul_add <= dec_mul.add;
			mul_long <= dec_mul.long_mul;
			mul_signed <= dec_mul.signed_mul;
		end

	initial begin
		mul = 0;
		mul_add = 0;
		mul_long = 0;
		mul_signed = 0;
	end

endmodule