11 // synthesis attribute ram_style of rom is block
12 reg [7:0] rom [1023:0];
13 initial $readmemh("rom.hex", rom);
15 wire decode = address[15:13] == 0;
17 odata <= rom[address[10:0]];
18 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
27 reg [7:0] brom [255:0];
28 initial $readmemh("bootstrap.hex", brom);
30 wire decode = address[15:8] == 0;
31 wire [7:0] odata = brom[address[7:0]];
32 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
41 reg [7:0] ram [127:0];
43 wire decode = (address >= 16'hFF80) && (address <= 16'hFFFE);
45 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
49 if (decode) // This has to go this way. The only way XST knows how to do
50 begin // block ram is chip select, write enable, and always
51 if (wr) // reading. "else if rd" does not cut it ...
52 ram[address[6:0]] <= data;
53 odata <= ram[address[6:0]];
64 // synthesis attribute ram_style of ram is block
65 reg [7:0] ram [8191:0];
67 wire decode = address[15:13] == 3'b110;
69 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
73 if (decode) // This has to go this way. The only way XST knows how to do
74 begin // block ram is chip select, write enable, and always
75 if (wr) // reading. "else if rd" does not cut it ...
76 ram[address[12:0]] <= data;
77 odata <= ram[address[12:0]];
88 output reg [7:0] ledout = 0);
90 wire decode = address == 16'hFF51;
92 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
98 else if (decode && wr)
104 module Dumpable(input [2:0] r, g, input [1:0] b, input hs, vs, vgaclk);
110 output reg vgaclk = 0,
114 input [7:0] switches,
116 output wire [7:0] leds,
118 output wire [3:0] digits,
119 output wire [7:0] seven,
122 output wire [2:0] r, g,
124 output wire soundl, soundr);
127 always #62 clk <= ~clk;
128 always #100 vgaclk <= ~vgaclk;
130 Dumpable dump(r,g,b,hs,vs,vgaclk);
136 wire [7:0] switches = 8'b0;
137 wire [3:0] buttons = 4'b0;
139 wire xtalb, clk, vgaclk;
140 IBUFG iclkbuf(.O(xtalb), .I(xtal));
141 CPUDCM dcm (.CLKIN_IN(xtalb), .CLKFX_OUT(clk));
142 pixDCM pixdcm (.CLKIN_IN(xtalb), .CLKFX_OUT(vgaclk));
145 wire [15:0] addr [1:0];
146 wire [7:0] data [1:0];
147 wire wr [1:0], rd [1:0];
149 wire irq, tmrirq, lcdcirq, vblankirq;
155 .bus0address(addr[0]),
159 .bus1address(addr[1]),
181 wire lcdhs, lcdvs, lcdclk;
182 wire [2:0] lcdr, lcdg;
192 .vblankirq(vblankirq),
221 (state == 2'b00) ? 4'b0010 :
222 (state == 2'b01) ? 4'b0001 :
223 (state == 2'b10) ? 4'b1000 :
236 UART nouart ( /* no u */
291 .snd_data_r(soundr));