input clk,
input wr, rd);
+ reg [7:0] odata;
+
// synthesis attribute ram_style of rom is block
reg [7:0] rom [1023:0];
initial $readmemh("rom.hex", rom);
wire decode = address[15:13] == 0;
- wire [7:0] odata = rom[address[10:0]];
+ always @(posedge clk)
+ odata <= rom[address[10:0]];
assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
endmodule
input clk,
input wr, rd);
- reg [7:0] rom [255:0];
- initial $readmemh("bootstrap.hex", rom);
+ reg [7:0] brom [255:0];
+ initial $readmemh("bootstrap.hex", brom);
wire decode = address[15:8] == 0;
- wire [7:0] odata = rom[address[7:0]];
+ wire [7:0] odata = brom[address[7:0]];
assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
endmodule
reg [7:0] odata;
assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
- always @(negedge clk)
+ always @(posedge clk)
begin
if (decode) // This has to go this way. The only way XST knows how to do
begin // block ram is chip select, write enable, and always
reg [7:0] odata;
assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
- always @(negedge clk)
+ always @(posedge clk)
begin
if (decode) // This has to go this way. The only way XST knows how to do
begin // block ram is chip select, write enable, and always
reg [7:0] odata;
assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
- always @(negedge clk)
+ always @(posedge clk)
begin
if (decode && rd)
odata <= switches;