NovNov
Newbie level 3
- Joined
- Apr 25, 2017
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 47
I have a program in VHDL and I want to replace one of the processes with a rom implementation. I've created a 1 port ram using mega wizard but I'm not really sure how to proceed from here.
so my questions are:
1. do I write VHDL code for the process in the ram.vhd file like I would in the normal design entity file? e.g
2. how do I initialise ram in the main file?
3. how do I set the inputs and outputs of the ram?
4. how do I used the memory initialisation file for binary content?
so my questions are:
1. do I write VHDL code for the process in the ram.vhd file like I would in the normal design entity file? e.g
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY altera_mf; USE altera_mf.altera_mf_components.all; ENTITY RAM IS PORT ( address : IN STD_LOGIC_VECTOR (1 DOWNTO 0); clock : IN STD_LOGIC := '1'; data : IN STD_LOGIC_VECTOR (3 DOWNTO 0); wren : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (3 DOWNTO 0) ); END RAM; ARCHITECTURE SYN OF ram IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0); BEGIN q <= sub_wire0(3 DOWNTO 0); altsyncram_component : altsyncram GENERIC MAP ( clock_enable_input_a => "BYPASS", clock_enable_output_a => "BYPASS", init_file => "school.mif", intended_device_family => "Cyclone II", lpm_hint => "ENABLE_RUNTIME_MOD=NO", lpm_type => "altsyncram", numwords_a => 32, operation_mode => "SINGLE_PORT", outdata_aclr_a => "NONE", outdata_reg_a => "CLOCK0", power_up_uninitialized => "FALSE", widthad_a => 5, width_a => 4, width_byteena_a => 1 ) PORT MAP ( address_a => address, clock0 => clock, data_a => data, wren_a => wren, q_a => sub_wire0 ); process (...) begin if ... then ... end process; END SYN;
2. how do I initialise ram in the main file?
3. how do I set the inputs and outputs of the ram?
4. how do I used the memory initialisation file for binary content?
Last edited by a moderator: