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.

Altera FPGA RAM example

Status
Not open for further replies.

shaiko

Advanced Member level 5
Joined
Aug 20, 2011
Messages
2,644
Helped
303
Reputation
608
Reaction score
297
Trophy points
1,363
Activity points
18,302
A single port VHDL RAM example from Altera:

Code:
process(clk)
begin
if(rising_edge(clk)) then
if(we = '1') then
ram(addr) <= data;
end if;		
[COLOR="#FF0000"]addr_reg <= addr[/COLOR]; -- Register the address for reading
end if;	
end process;

q <= ram(addr_reg);

my question:
why use "addr_reg" for reading? why not simply use:
Code:
q <= ram(addr);
 

because that would be an asynchronous read. If you look at the technology, it has an optional read_address register embedded in the memory part. This code uses that register, and will help improve the timings.

- - - Updated - - -

IIRC, in XILINX BRAMs you MUST use a registered version of the read address.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Yet it uses an unregistered version of the write address??
 

You can use the registered version if you want.. But what it's actually doing is loading the data into a pre-memory data register, and it will be registering the address as well (in the technology).

Check the technology map schematic.
 
  • Like
Reactions: shaiko

    shaiko

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top