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.

Help me write a code for extraction of static ram

Status
Not open for further replies.

PigiPigi

Member level 2
Joined
May 1, 2002
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
271
Synthesize Ram?

I want to write a vhdl code for a static ram, that every fpga synthesize tools extracts it and uses avilable ram in fpga instead it. Anybody can provide usefull information?
PigiPigi,
 

1. Choose the RAM type that you want.
2. Specify the RAM size.
3. Replace the RAM into your design.
 

if u want to use vhdl to describe a static ram for a fpga, you could explicitly instantiate the fpga's ram primitive, like blockRAM in Xiline.

if you want to use vhdl to describe a static ram for any type of fpga that use its primitves, I think you have problem doing it in a single description. Every synthesizer will infer SRAM in a bit different manner. If you don't care the to optimise the use of fpga's primitive, you could always write a SRAM description in VHDL and let the synthesizer to implement it using LUTs, however, it is not recommended for large SRAM size as it consumes too much LUTs that would be used for other uses.

ntxp
 

Simply write a behavioral array and write processes to define its rd/wr method, 1/2 port, etc. the synthesizer in FPGA will convert it to its own RAM, of course sometimes have performance degrade when it doesn't fit in the original one.
 

Hi,
If you want to use VHDL code to synthesis RAM , FPGA must convert it to its own RAM . And even if not converted, your result is not RAM, just Flipflop array.
 

writing VHDL code that descibe ram is possible for some synthesizers as (Leonardo) but from experince it consume large area. The best way to save area and achive fast design is to instatiate RAM that the vendore supply.
 

Hi, Al
I think whatever synthesis tool you use,such as synopsys dc, cadence ambit etc. ,you can't get RAM result from RTL. If you want a RAM ,you have to get suport from library vendor or foundry vendor and using silicon compiler tools specific to vendor.
 

I think that I do not mention clearly in the previous post.

First, You could write HDL to describe your RAM.
But the best way is to write according to a standard RAM style.
(For example, single-port RAM or two-port RAM)

Then, in FPGA, try to find the RAM that FPGA had provided to replace
the RAM that your design.

If you have the "Memory Compiler" (provided by the Fundry Vendor),
you could generate the HDL code for RAM directly from the compiler.
 

The common IP provider deal the ram instantiate with wraper . That make you compile your IP both in asic and fpga enviroment more friendly.
 

I have synthesized this VHDL code for RAM in a Xilinx FPGA
 

Don't know why it didn't attached the file..however here it is again
 

LIBRARY ieee;
USE ieee.std_logic_1164.ALL, IEEE.Std_logic_arith.all;
ENTITY ram_nxm IS
Generic(n: Positive:=3; m: Positive :=4);
PORT(address : IN Unsigned(n-1 DOWNTO 0);--unsigned is one dimensional array of values of type std_logic i.e. they effectively are std_logic_vector
Enable, RW: IN STD_LOGIC;
data : INOUT Unsigned(m-1 DOWNTO 0));
END ram_nxm;

ARCHITECTURE version1 OF ram_nxm IS

BEGIN
PROCESS(address, Enable, RW, data)
TYPE ram_array IS ARRAY (0 TO 2**n-1) OF Unsigned(m-1 DOWNTO 0); --This type is defined as Unsigned in numeric_std
VARIABLE index : INTEGER := 0;
VARIABLE ram_store : ram_array;
BEGIN

IF Enable = '1' THEN

IF RW = '0' THEN
--write to ram on rising edge of write pulse
ram_store(conv_integer(address)) := data;
ELSIF RW = '1' THEN
data <= ram_store(conv_integer(address));
ELSE
data(I) <= (Others => 'Z');
END IF;
ELSE
data(I) <= (Others => 'Z');
END IF;
END PROCESS;

END version1;
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top