1 //===============================================================================
2 // FPGA MOONCRESTA & GALAXIAN
3 // FPGA BLOCK RAM I/F (ALTERA-CYCLONE & XILINX SPARTAN2E)
7 // Copyright(c) 2004 Katsumi Degawa , All rights reserved
11 // This program is freeware for non-commercial use.
12 // An author does no guarantee about this program.
13 // You can use this under your own risk.
15 // mc_col_rom(6L) added by k.Degawa
17 // 2004- 5- 6 first release.
18 // 2004- 8-23 Improvement with T80-IP. K.Degawa
19 // 2004- 9-18 added Xilinx Device K.Degawa
20 //================================================================================
21 `include "src/mc_conf.v"
43 assign O_D = I_OE ? W_D : 8'h00 ;
46 alt_ram_1024_8 CPURAM_ALT(
56 `ifdef DEVICE_SPARTAN2E
104 input [7:0]I_ADDRA,I_ADDRB;
107 input [7:0]I_DA,I_DB;
108 output [7:0]O_DA,O_DB;
110 `ifdef DEVICE_CYCLONE
111 alt_ram_256_8_8 OBJRAM(
129 `ifdef DEVICE_SPARTAN2E
133 .ADDRA({1'b0,I_ADDRA[7:0]}),
141 .ADDRB({1'b0,I_ADDRB[7:0]}),
173 input [9:0]I_ADDRA,I_ADDRB;
174 input [7:0]I_DA,I_DB;
177 output [7:0]O_DA,O_DB;
179 `ifdef DEVICE_CYCLONE
180 alt_ram_1024_8_8 VIDRAM(
198 `ifdef DEVICE_SPARTAN2E
199 RAMB4_S4_S4 VIDRAM_X1(
202 .ADDRA(I_ADDRA[9:0]),
210 .ADDRB(I_ADDRB[9:0]),
219 RAMB4_S4_S4 VIDRAM_X0(
222 .ADDRA(I_ADDRA[9:0]),
230 .ADDRB(I_ADDRB[9:0]),
260 `ifdef DEVICE_CYCLONE
274 `ifdef DEVICE_SPARTAN2E
276 always@(negedge I_CLK) O_Dn <= ~W_D[4:0] ;
281 .ADDR({1'b0,I_ADDR[7:0]}),
294 `ifdef DEVICE_CYCLONE
310 assign O_DO = I_OEn ? 8'h00 : W_DO ;