Altera_Forum
Honored Contributor
18 years agoniosii + sdram connection problems
I customized a FPGA developing borad based on nios ii, I get vhdl design modules of sdram and flash.
but I got a problem: the nios ii generate cpu with vector ports like Addr[n-1..0],Data[n-1..0],but the sdram vhdl module has the ports like:Addr0,Addr1,Addr2......Addrn-1.Data0,Data0,....Datan-1. especially,when using tristate bus connect the cfi flash component ,the tristate address are not all in use so I think I should map the tristate address ports to flash compoent ports. how can I connect the flash,sdram to the nios ii cpu in above condition ? I tried to write a component as a relay and map ports like this: ENTITY flash_sel IS PORT{ Addr : IN STD_LOGIC_VECTOR(n-1 downto 0); Addr0 : OUT STD_LOGIC; ........... Addrn-1 : OUT STD_LOGIC; Data : IN STD_LOGIC_VECTOR(n-1 downto 0); Data0 : INOUT STD_LOGIC; ........... Datan-1 : INOUT STD_LOGIC } END flash_sel; ARCHITECTRUE behav of sdram_mux IS BEGIN Data0<=Data(0); ........ Datan-1<=Data(n-1); Addr0<=Addr(0); ........ Addrn-1<=Addr(n-1); ........ END behav; but the Data ports are birdirectional , I think this does not work correctly. could you give me some conduction on: how can I connect the flash,sdram to the nios ii cpu in above condition ? if a component is neccessry how should I write it? tks!