Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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,
 

frankchen00

Junior Member level 2
Joined
Dec 25, 2002
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
86
1. Choose the RAM type that you want.
2. Specify the RAM size.
3. Replace the RAM into your design.
 

ntxp

Member level 2
Joined
May 29, 2002
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
342
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
 

cuiyujie

Junior Member level 3
Joined
Apr 25, 2002
Messages
26
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
144
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.
 

linuxluo

Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
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.
 

Al Farouk

Full Member level 4
Joined
Jan 13, 2003
Messages
191
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,298
Location
Egypt
Activity points
1,854
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.
 

linuxluo

Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
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.
 

frankchen00

Junior Member level 2
Joined
Dec 25, 2002
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
86
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.
 

Nobody

Full Member level 3
Joined
Oct 4, 2001
Messages
165
Helped
9
Reputation
16
Reaction score
7
Trophy points
1,298
Location
Formosa
Activity points
1,593
The common IP provider deal the ram instantiate with wraper . That make you compile your IP both in asic and fpga enviroment more friendly.
 

Agent006

Member level 1
Joined
Feb 12, 2002
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
263
I have synthesized this VHDL code for RAM in a Xilinx FPGA
 

Agent006

Member level 1
Joined
Feb 12, 2002
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
263
Don't know why it didn't attached the file..however here it is again
 

Agent006

Member level 1
Joined
Feb 12, 2002
Messages
39
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
263
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top