Commit 47c8145d authored by Iulian Gheorghiu's avatar Iulian Gheorghiu

Add REGS module for Lattice Diamond compatibility, because Lattice Diamond does…

Add REGS module for Lattice Diamond compatibility, because Lattice Diamond does not know how to implement a RAM block with three address sources, because of this issue I manually implemented this module from individual distributed RAM cells.
parent e53e8f94
......@@ -23,8 +23,7 @@
module rom #(
parameter ADDR_ROM_BUS_WIDTH = 14, /* < in address lines */
parameter ROM_PATH = "",
parameter SYNCHRONOUS = "FALSE",
parameter PLATFORM = "XILINX"
parameter SYNCHRONOUS = "FALSE"
) (
input clk,
input [ADDR_ROM_BUS_WIDTH-1:0] a,
......@@ -43,24 +42,17 @@ reg [ADDR_ROM_BUS_WIDTH-1:0] a_int;
always @ (posedge clk)
begin
if (SYNCHRONOUS == "TRUE" && PLATFORM != "LATTICE")
if(SYNCHRONOUS == "TRUE")
begin
d <= mem[a];
end
if(PLATFORM == "LATTICE")
begin
a_int <= a;
end
end
always @ (*)
begin
if (SYNCHRONOUS != "TRUE" )
begin
if (PLATFORM == "LATTICE")
d <= mem[a_int];
else
d <= mem[a];
d <= mem[a];
end
end
endmodule
......
This diff is collapsed.
......@@ -19,7 +19,7 @@
*/
`timescale 1ns / 1ps
`include "ddr3_v.v"
//`include "ddr3_v.v"
/* For Attiny 26 */
//`define BUS_ADDR_PGM_LEN_SIM 11 /* < in address lines 2KWords */
//`define BUS_ADDR_DATA_LEN_SIM 8 /* < in address lines 256Bytes data address space */
......@@ -27,9 +27,9 @@
//`define DATA_ADDR_RESERVED_AT_BOTTOM_SIM 'd128 /* < in bytes ( 128 bytes to let space for IO usage )*/
/* For ATXmega */
`define BUS_ADDR_PGM_LEN_SIM 16 /* < in address lines 8KWords */
`define BUS_ADDR_DATA_LEN_SIM 16 /* < in address lines 16KBytes data address space */
`define DATA_MEM_SIZE_LEN_SIM 12 /* < in address lines 1KByte */
`define BUS_ADDR_PGM_LEN_SIM 16 /* < in address lines 64KWords */
`define BUS_ADDR_DATA_LEN_SIM 16 /* < in address lines 64KBytes data address space */
`define DATA_MEM_SIZE_LEN_SIM 12 /* < in address lines 4KByte */
`define DATA_ADDR_RESERVED_AT_BOTTOM_SIM 'd8192 /* < in bytes ( 8192 bytes is the standard atxmega reserved address for IO usage )*/
`define USE_HDMI_OUTPUT
......@@ -229,7 +229,7 @@ pio_s # (
.int(int_pio_c),
.int_rst(int_rst[3])
);
//`ifdef _0_
uart_s # (
.BAUDRATE_COUNTER_LENGTH(12),
.DINAMIC_BAUDRATE("TRUE"),
......@@ -390,7 +390,7 @@ hdmi_out # (
.lcd_de(lcd_de)
);
`endif
//`endif //!_0_
rom #(
.ADDR_ROM_BUS_WIDTH(`BUS_ADDR_PGM_LEN_SIM),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment