1 `include "ARM_Constants.v"
12 output reg [31:0] busaddr,
16 output reg [31:0] wr_data,
19 /* regfile interface */
20 output reg [3:0] st_read,
23 /* writeback to base */
25 output reg [3:0] regsel,
26 output reg [31:0] regdata,
29 output reg [31:0] outpc,
30 output reg [31:0] newpc,
37 reg [31:0] addr, raddr, next_regdata, next_newpc;
38 reg [3:0] next_regsel;
39 reg next_writeback, next_notdone, next_inc_next;
40 reg [31:0] align_s1, align_s2, align_rddata;
44 assign outstall = rw_wait | notdone;
52 wr_data = 32'hxxxxxxxx;
53 busaddr = 32'hxxxxxxxx;
57 next_regdata = 32'hxxxxxxxx;
59 next_newpc = 32'hxxxxxxxx;
61 `DECODE_LDRSTR_UNDEFINED: begin end
63 addr = insn[23] ? base + offset : base - offset; /* up/down select */
64 raddr = insn[24] ? base : addr;
65 busaddr = {raddr[31:2], 2'b0}; /* pre/post increment */
69 align_s1 = raddr[1] ? {rd_data[15:0], rd_data[31:16]} : rd_data;
70 align_s2 = raddr[0] ? {align_s1[7:0], align_s1[31:8]} : align_s1;
71 align_rddata = insn[22] ? {24'b0, align_s2[7:0]} : align_s2;
74 st_read = insn[15:12];
75 wr_data = insn[22] ? {4{st_data[7:0]}} : st_data;
77 else if(!inc_next) begin /* store */
78 next_writeback = 1'b1;
79 next_regsel = insn[15:12];
80 next_regdata = align_rddata;
83 else if(insn[21]) begin
84 next_writeback = 1'b1;
85 next_regsel = insn[19:16];
88 next_notdone = rw_wait & insn[20] & insn[21];
100 outbubble <= rw_wait;
101 writeback <= next_writeback;
102 regsel <= next_regsel;
103 regdata <= next_regdata;
104 notdone <= next_notdone;
106 inc_next <= next_inc_next;