X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/8e2bb38447e731bbba10c39cfb995b9b4eccd22c..2854e3991ab66f6fb954aba96caf7875d049431e:/System.v diff --git a/System.v b/System.v index 8f54685..1872e51 100644 --- a/System.v +++ b/System.v @@ -6,12 +6,15 @@ module ROM( 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 @@ -21,11 +24,11 @@ module BootstrapROM( 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