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,
36 reg [31:0] addr, raddr, next_regdata;
37 reg [3:0] next_regsel;
38 reg next_writeback, next_notdone, next_inc_next;
39 reg [31:0] align_s1, align_s2, align_rddata;
43 assign outstall = rw_wait | notdone;
51 wr_data = 32'hxxxxxxxx;
52 busaddr = 32'hxxxxxxxx;
56 next_regdata = 32'hxxxxxxxx;
59 `DECODE_LDRSTR_UNDEFINED: begin end
61 addr = insn[23] ? base + offset : base - offset; /* up/down select */
62 raddr = insn[24] ? base : addr;
63 busaddr = {raddr[31:2], 2'b0}; /* pre/post increment */
67 /* rotate to correct position */
68 align_s1 = raddr[1] ? {rd_data[15:0], rd_data[31:16]} : rd_data;
69 align_s2 = raddr[0] ? {align_s1[7:0], align_s1[31:8]} : align_s1;
70 /* select byte or word */
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; /* XXX need to actually store just a byte */
77 else if(!inc_next) begin
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;
105 inc_next <= next_inc_next;