Altera_Forum
Honored Contributor
16 years agowrite/read sdram
hi, I have developed a system using sopc builder using my own component (processor) in addition to nios and other memory/peripheral devices. I am trying to write my regsiter file contents into memory(for debugging purpose). The vhdl code for this particular portion is
process(reg_debug, clock) begin if clock'event and clock = '1' then if reg_debug = '1' then if lock = '0' then reg_count <= reg_count + 1; end if; end if; end if; end process; --address hardcoded for now master_address_dmem(31 downto 0) <= "1000000100000001000000000000" & reg_count when reg_debug ='1' else .... master_writeddata_dmem <= op1_dc when reg_debug = '1' else here is the interface to data memory which is actually sdram master_address_dmem:OUT std_logic_vector(31 downto 0); master_read_dmem:OUT std_logic; master_write_dmem:OUT std_logic; master_readdata_dmem: IN std_logic_vector(15 downto 0); master_writeddata_dmem: OUT std_logic_vector(15 downto 0); master_waitrequest_dmem:IN std_logic; and I read by following for(i=0; i < 16; i++) { display_data = IORD_16DIRECT(SDRAM_0_BASE+0x00010000, i); printf (...); I always read ffff. I am not sure that whether I am unable to either read or write correctly or both. I would be really thankful if someone could help me in fixing this problem.