9 // synthesis attribute ram_style of rom is block
10 reg [7:0] rom [1023:0];
11 initial $readmemh("rom.hex", rom);
13 wire decode = address[15:13] == 0;
14 wire [7:0] odata = rom[address[10:0]];
15 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
24 reg [7:0] rom [255:0];
25 initial $readmemh("bootstrap.hex", rom);
27 wire decode = address[15:8] == 0;
28 wire [7:0] odata = rom[address[7:0]];
29 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
38 reg [7:0] ram [127:0];
40 wire decode = (address >= 16'hFF80) && (address <= 16'hFFFE);
42 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
46 if (decode) // This has to go this way. The only way XST knows how to do
47 begin // block ram is chip select, write enable, and always
48 if (wr) // reading. "else if rd" does not cut it ...
49 ram[address[6:0]] <= data;
50 odata <= ram[address[6:0]];
61 // synthesis attribute ram_style of ram is block
62 reg [7:0] ram [8191:0];
64 wire decode = address[15:13] == 3'b110;
66 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
70 if (decode) // This has to go this way. The only way XST knows how to do
71 begin // block ram is chip select, write enable, and always
72 if (wr) // reading. "else if rd" does not cut it ...
73 ram[address[12:0]] <= data;
74 odata <= ram[address[12:0]];
85 output reg [7:0] ledout = 0);
87 wire decode = address == 16'hFF51;
89 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
95 else if (decode && wr)
101 module Dumpable(input [2:0] r, g, input [1:0] b, input hs, vs, vgaclk);
107 output reg vgaclk = 0,
111 input [7:0] switches,
113 output wire [7:0] leds,
115 output wire [3:0] digits,
116 output wire [7:0] seven,
119 output wire [2:0] r, g,
121 output wire soundl, soundr);
124 always #62 clk <= ~clk;
125 always #100 vgaclk <= ~vgaclk;
127 Dumpable dump(r,g,b,hs,vs,vgaclk);
133 wire [7:0] switches = 8'b0;
134 wire [3:0] buttons = 4'b0;
136 wire xtalb, clk, vgaclk;
137 IBUFG iclkbuf(.O(xtalb), .I(xtal));
138 CPUDCM dcm (.CLKIN_IN(xtalb), .CLKFX_OUT(clk));
139 pixDCM pixdcm (.CLKIN_IN(xtalb), .CLKFX_OUT(vgaclk));
142 wire [15:0] addr [1:0];
143 wire [7:0] data [1:0];
144 wire wr [1:0], rd [1:0];
146 wire irq, tmrirq, lcdcirq, vblankirq;
152 .bus0address(addr[0]),
156 .bus1address(addr[1]),
178 wire lcdhs, lcdvs, lcdclk;
179 wire [2:0] lcdr, lcdg;
189 .vblankirq(vblankirq),
218 (state == 2'b00) ? 4'b0010 :
219 (state == 2'b01) ? 4'b0001 :
220 (state == 2'b10) ? 4'b1000 :
233 UART nouart ( /* no u */
288 .snd_data_r(soundr));