Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Ram Problem, help me !!!!!!!!!

Status
Not open for further replies.

angjohn

Junior Member level 2
Joined
Aug 29, 2004
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
272
verilog lpm_ram_dq

can anyone help me translate following LPM_RAM_DQ module which is in VHDL into Verilog
Code:
-- LPM_RAM_DQ
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;

entity LPM_RAM_DQ is
	generic (
		Note: note := "RAM with Separate Input and Output Ports";
		LPM_WIDTH: integer := 16;
		LPM_TYPE: string := "LPM_RAM_DQ";
		LPM_WIDTHAD: integer := 9;
		LPM_NUMWORDS: string := "UNUSED";
		LPM_FILE: string := "UNUSED";
		LPM_INDATA: string := "REGISTERED";
		LPM_ADDRESS_CONTROL: string := "REGISTERED";
		LPM_OUTDATA: string := "UNREGISTERED";
		LPM_HINT: string := "UNUSED" 
	);
	port (
		DATA: in STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0);
		ADDRESS: in STD_LOGIC_VECTOR(LPM_WIDTHAD-1 downto 0);
		WE: in STD_LOGIC;-- := '1';
		INCLOCK: in STD_LOGIC;-- := '0';
		Q: out STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0)
	);
	type ENUM_LPM_INDATA is (REGISTERED, UNREGISTERED);
	type ENUM_LPM_ADDRESS_CONTROL is (REGISTERED, UNREGISTERED);
	type ENUM_LPM_OUTDATA is (REGISTERED, UNREGISTERED);
end LPM_RAM_DQ;

architecture LPM_RAM_DQ_arch of LPM_RAM_DQ is
begin
	-- Enter concurrent statements here
end LPM_RAM_DQ_arch;

-- LPM_RAM_DQ: Predefined module ended here



-- DataRam
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;

entity DataRam is
	port (
		data : in STD_LOGIC_VECTOR(15 downto 0);
		addr : in STD_LOGIC_VECTOR(8 downto 0);
		CLK : in STD_LOGIC;
		write : in STD_LOGIC;
		Q : out STD_LOGIC_VECTOR(15 downto 0)
	);
end DataRam;

architecture DataRam_arch of DataRam is

	signal high, low, lpm_write, nclk : STD_LOGIC;

	component LPM_RAM_DQ
	generic (
		LPM_WIDTH: integer := 16;
		LPM_TYPE: string := "LPM_RAM_DQ";
		LPM_WIDTHAD: integer := 9;
		LPM_NUMWORDS: string := "UNUSED";
		LPM_FILE: string := "UNUSED";
		LPM_INDATA: string := "REGISTERED";
		LPM_ADDRESS_CONTROL: string := "REGISTERED";
		LPM_OUTDATA: string := "UNREGISTERED";
		LPM_HINT: string := "UNUSED" 
	);
	port (
		DATA: in STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0);
		ADDRESS: in STD_LOGIC_VECTOR(LPM_WIDTHAD-1 downto 0);
		WE: in STD_LOGIC;-- := '1';
		INCLOCK: in STD_LOGIC;-- := '0';
		Q: out STD_LOGIC_VECTOR(LPM_WIDTH-1 downto 0)
	);
	end component;

begin
		high<='1'; low<='0';
		lpm_write <= write and clk;
		nclk <= not clk;
		U_LPM_RAM_DQ: LPM_RAM_DQ port map(data, addr, write, clk, Q);
		
		
		 		
end DataRam_arch;

this ram is target for altera MaxplusII software so can anyone help me out pls !!!!
 

how to know in the ram problem

did u check if the VHDL code is synthesizable!

there are shell level convertors i.e VHDL to verilog convertors.. synthesizable ones.. jes check the original codes.. and i shall try to get the url for the convertor.

with regards,
 

    angjohn

    Points: 2
    Helpful Answer Positive Rating
lpm_ram_dq vhdl

TRY XHDL for translation

**broken link removed**
 

2005 ram problems?

i already use the XHDL to translate the code into verilog but still the code got error when synthesis, any other suggestion ????
 

verilog defparam string

Ya.. you cant directly synthesise XHDL output..
But if u know verilog..u can modify the code without much effort to get a synthesisable code...
 

coding of ram problem

in DC take netlist as Verilog Netlist
 

ram problem codes

Hi,

The LPM_RAM_DQ is only a macrofunction for single port embedeed ram.
If your target is an altera, just declare your component and map it in Verilog.
If your target is an other component, you may code in verilog a similar bloc ram :
Look at this coming from Xilinx Templates :
module spblockram_v (clk, we, a, di, do);

input clk;
input we;
input [4:0] a;
input [3:0] di;
output [3:0] do;

reg [3:0] ram [31:0];
reg [4:0] read_a;

always @(posedge clk) begin
if (we)
ram[a] <= di;
read_a <= a;
end

assign do = ram[read_a];

endmodule


I hope this will help you
;)
 

i am targetting the RAM for Altera FPGA. i know about mapping it , i had write this following verilog code and it work
Code:
module RAM (
	address,
	we,
	clock,
	data,
	q);

	input	[7:0]  address;
	input	we;
	input	clock;
	input	[7:0]  data;
	output	[7:0]  q;

	wire [7:0] sub_wire0;
	wire [7:0] q = sub_wire0[7:0];

	lpm_ram_dq	lpm_ram_dq_component (
				.address (address),
				.inclock (clock),
				.data (data),
				.we (we),
				.q (sub_wire0));
	defparam
		lpm_ram_dq_component.intended_device_family = "FLEX10K",
		lpm_ram_dq_component.lpm_width = 8,
		lpm_ram_dq_component.lpm_widthad = 8,
		lpm_ram_dq_component.lpm_indata = "REGISTERED",
		lpm_ram_dq_component.lpm_address_control = "REGISTERED",
		lpm_ram_dq_component.lpm_outdata = "UNREGISTERED",
		lpm_ram_dq_component.use_eab = "ON",
		lpm_ram_dq_component.lpm_hint = "MAXIMUM_DEPTH=256",
		lpm_ram_dq_component.lpm_type = "LPM_RAM_DQ",
		lpm_ram_dq_component.lpm_file = "nabilcpu.mif";


endmodule
the problem is the above code can compile using Altera QuartusII only, but i wan to use Synopsys FPGA Express to synthesis it, but it cannot regconise the syntax defparam. so i wan to know is there anyway to replace that syntax defparam. thanks!!!
 

How do I use a library of parameterized modules (LPM) function (such as LPM_RAM_DQ) in Synopsys FPGA Express, i need to know how to implement in Verilog-HDL. the fpga express having difficulty synthesis the syntax "defparam" so i cannot use the Verilog code generate by Megawizard Plug in manager by altera. so please help me out with this !!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top