Forum Discussion
Altera_Forum
Honored Contributor
17 years agousing a ram megafunction
I am emulating a microprocessor on DE1 development kit. i heard that need to use ram megafunction to generate the ram only can simulate the microprocessor on DE1. so how can i create the ram using th...
Altera_Forum
Honored Contributor
17 years agoWhile Quartus may infer a RAM from this code, it's not using best practices.
First, you should be using ieee.numeric_std.all instead of std_logic_arith, and std_logic_unsigned. Second, your memory access process should have a sensitivity list and look something like this:
access_memory : process( clock )
begin
if( rising_edge(clock) ) then
dout <= ram( to_integer( addr ) ) ;
end if ;
end process ; -- access_memory
There are also some templates available inside of Quartus which may also be helpful.