3 input Nrst, /* XXX not used yet */
17 output reg outstall = 0,
18 output reg outbubble = 1,
19 output reg write_reg = 1'bx,
20 output reg [3:0] write_num = 4'bxxxx,
21 output reg [31:0] write_data = 32'hxxxxxxxx
25 reg [31:0] mult_acc0, mult_in0, mult_in1;
27 wire [31:0] mult_result;
29 Multiplier multiplier(
30 .clk(clk), .Nrst(Nrst),
31 .start(mult_start), .acc0(mult_acc0), .in0(mult_in0),
32 .in1(mult_in1), .done(mult_done), .result(mult_result));
37 input Nrst, /* XXX not used yet */
45 output reg [31:0] result);
48 reg [31:0] multiplicand;
59 bitfield <= {2'b00, bitfield[31:2]};
60 multiplicand <= {multiplicand[29:0], 2'b00};
62 (bitfield[0] ? multiplicand : 0) +
63 (bitfield[1] ? {multiplicand[30:0], 1'b0} : 0);
64 if (bitfield == 0) begin
72 /* XXX is the interface correct? */
75 input Nrst, /* XXX not used yet */
84 output reg [31:0] result,
85 output reg [31:0] cpsr_out,
89 wire flag_n, flag_z, flag_c, flag_v, setres;
90 wire [32:0] sum, diff, rdiff;
92 assign sum = {1'b0, in0} + {1'b0, in1};
93 assign diff = {1'b0, in0} - {1'b0, in1};
94 assign rdiff = {1'b0, in1} + {1'b0, in0};
96 /* TODO XXX flag_v not set correctly */
100 flag_c = cpsr[`CPSR_C];
101 flag_v = cpsr[`CPSR_V];
105 flag_c = shifter_carry;
110 flag_c = shifter_carry;
114 {flag_c, res} = diff;
118 {flag_c, res} = rdiff;
126 {flag_c, res} = sum + cpsr[`CPSR_C];
130 {flag_c, res} = diff - (~cpsr[`CPSR_C]);
134 {flag_c, res} = rdiff - (~cpsr[`CPSR_C]);
139 flag_c = shifter_carry;
144 flag_c = shifter_carry;
148 {flag_c, res} = diff;
157 flag_c = shifter_carry;
162 flag_c = shifter_carry;
167 flag_c = shifter_carry;
172 flag_c = shifter_carry;
183 always @(posedge clk) begin
185 cpsr_out <= setflags ? {flag_n, flag_z, flag_c, flag_v, cpsr[27:0]} : cpsr;