9 reg [7:0] rom [1023:0];
10 initial $readmemh("rom.hex", rom);
12 wire decode = address[15:13] == 0;
13 wire [7:0] odata = rom[address[10:0]];
14 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
15 //assign data = rd ? odata : 8'bzzzzzzzz;
18 module MiniRAM( /* XXX will need to go INSIDE the CPU for when we do DMA */
24 reg [7:0] ram [127:0];
26 wire decode = (address >= 16'hFF80) && (address <= 16'hFFFE);
28 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
32 if (decode) // This has to go this way. The only way XST knows how to do
33 begin // block ram is chip select, write enable, and always
34 if (wr) // reading. "else if rd" does not cut it ...
35 ram[address[6:0]] <= data;
36 odata <= ram[address[6:0]];
46 // synthesis attribute ram_style of ram is block
47 reg [7:0] ram [8191:0];
49 wire decode = address[15:13] == 3'b110;
51 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
55 if (decode) // This has to go this way. The only way XST knows how to do
56 begin // block ram is chip select, write enable, and always
57 if (wr) // reading. "else if rd" does not cut it ...
58 ram[address[12:0]] <= data;
59 odata <= ram[address[12:0]];
70 output reg [7:0] ledout = 0);
72 wire decode = address == 16'hFF51;
74 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
80 else if (decode && wr)
89 output wire [7:0] leds,
91 output wire [3:0] digits,
92 output wire [7:0] seven,
94 output wire [2:0] r, g,
97 wire xtalb, clk, vgaclk;
98 IBUFG iclkbuf(.O(xtalb), .I(xtal));
99 CPUDCM dcm (.CLKIN_IN(xtalb), .CLKFX_OUT(clk));
100 pixDCM pixdcm (.CLKIN_IN(xtalb), .CLKFX_OUT(vgaclk));
106 wire irq, tmrirq, lcdcirq, vblankirq;
127 wire lcdhs, lcdvs, lcdclk;
128 wire [2:0] lcdr, lcdg;
138 .vblankirq(vblankirq),
167 (state == 2'b00) ? 4'b0010 :
168 (state == 2'b01) ? 4'b0001 :
169 (state == 2'b10) ? 4'b1000 :
182 UART nouart ( /* no u */
243 always #62 clk <= ~clk;