4 output wire [31:0] bus_rdata,
5 input [31:0] bus_wdata,
11 /* This module is mapped in physical memory from 0x00000000 to
12 * 0x00004000. rdata and ready must be driven to zero if the
13 * address is not within the range of this module.
15 wire decode = (bus_addr & ~32'h00003FFF) == 32'h00000000;
16 /* verilator lint_off WIDTH */
17 wire [13:2] ramaddr = bus_addr & 32'h3FFC; /* mask off lower two bits
18 * for word alignment */
19 /* verilator lint_on WIDTH */
21 reg [31:0] data [0:(16384 / 4 - 1)];
25 assign bus_rdata = (bus_rd && decode) ? temprdata : 32'h0;
27 assign bus_ready = decode &&
28 (bus_wr || (bus_rd && (lastread == ramaddr)));
33 data[ramaddr] <= bus_wdata;
35 /* This is not allowed to be conditional -- stupid Xilinx
37 temprdata <= data[ramaddr];