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;
24 // synthesis attribute ram_style of ram is block
25 reg [7:0] ram [8191:0];
27 wire decode = address[15:13] == 3'b110;
29 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
33 if (decode) // This has to go this way. The only way XST knows how to do
34 begin // block ram is chip select, write enable, and always
35 if (wr) // reading. "else if rd" does not cut it ...
36 ram[address[12:0]] <= data;
37 odata <= ram[address[12:0]];
48 output reg [7:0] ledout = 0);
50 wire decode = address == 16'hFF51;
52 assign data = (rd && decode) ? odata : 8'bzzzzzzzz;
58 else if (decode && wr)
67 output wire [7:0] leds,
69 output wire [3:0] digits,
70 output wire [7:0] seven,
72 output wire [2:0] r, g,
75 wire xtalb, clk, vgaclk;
76 IBUFG iclkbuf(.O(xtalb), .I(xtal));
77 CPUDCM dcm (.CLKIN_IN(xtalb), .CLKFX_OUT(clk));
78 pixDCM pixdcm (.CLKIN_IN(xtalb), .CLKFX_OUT(vgaclk));
84 wire irq, tmrirq, lcdcirq, vblankirq;
105 wire lcdhs, lcdvs, lcdclk;
106 wire [2:0] lcdr, lcdg;
116 .vblankirq(vblankirq),
145 (state == 2'b00) ? 4'b0010 :
146 (state == 2'b01) ? 4'b0001 :
147 (state == 2'b10) ? 4'b1000 :
160 UART nouart ( /* no u */
213 always #62 clk <= ~clk;