5 output wire [31:0] rdata_0,
7 output wire [31:0] rdata_1,
9 output wire [31:0] rdata_2,
11 output wire [31:0] rdata_3,
12 output wire [31:0] spsr,
14 input [3:0] write_reg,
15 input [31:0] write_data
18 reg [31:0] regfile [0:15];
22 for (i = 0; i < 16; i = i + 1)
26 assign rdata_0 = ((read_0 == write_reg) && write) ? write_data : regfile[read_0];
27 assign rdata_1 = ((read_1 == write_reg) && write) ? write_data : regfile[read_1];
28 assign rdata_2 = ((read_2 == write_reg) && write) ? write_data : regfile[read_2];
29 assign rdata_3 = ((read_3 == write_reg) && write) ? write_data : regfile[read_3];
30 assign spsr = regfile[4'hF];
32 always @(posedge clk or negedge Nrst)
34 for (i = 0; i < 16; i = i + 1)
37 regfile[write_reg] <= write_data;