Forum Discussion
Hi Paul,
Just to confirm, are you using Nios V?
Could you go into more details, for example PD system?
Best regards,
Sho
Hi Sho,
Thanks for your reply and I am using the Nios V and below is the Nios V and the corresponding Avalon_ext_bus_32x64k module with the port information in the previous post.
Best regards,
Paul
- Paul832 years ago
New Contributor
Hi Sho,
I try to make the thing simple. The connection my own module avalon_timeout2 to the Nios V CPU in the platform design as show in the pic (PD.png)
For the avalon_timeout2 is used to access the memory in below VHDL code (sorry that please ignore the name of the module "timeout", as I just quickly modify it)Then, in the Ashling IDE, I just try to write and read the memory. However, the output are also abnormal by this simple try.
IOWR_32DIRECT(AVALON_TIMEOUT2_0_BASE,0x0,0x00000001); //write address 0 with data 1
uint rddata = IORD_32DIRECT(AVALON_TIMEOUT2_0_BASE,0x0); //read address 0IOWR_32DIRECT(AVALON_TIMEOUT2_0_BASE,0x4,0x00000004); //write address 0x04 with data 0x04
rddata = IORD_32DIRECT(AVALON_TIMEOUT2_0_BASE,0x4); //read address 0x04when I run the 1st IOWR_32DIRECT(AVALON_TIMEOUT2_0_BASE,0x0,0x00000001), it seem the read pulse is triggered, address is changing.... (waveform.png)
when I run others 3 code. There are no trigger in the signal tap analyser. It make me confuse....Do you have any idea on this ?
Thanks
Paul
The VHDL code for avalong_timeout2
avalon_timeout2 :Library IEEE;use IEEE.std_logic_1164.all;use IEEE.numeric_std.all;entity AVALON_TIMEOUT2 isport(-- Clock/Reset interfaceclk : in std_logic;reset : in std_logic; -- an active high reset signal-- IO interface for read / write accesswrite : in std_logic;read : in std_logic;address : in std_logic_vector (15 downto 0); -- with 2 addresswritedata : in std_logic_vector(31 downto 0);readdata : out std_logic_vector(31 downto 0));end AVALON_TIMEOUT2;architecture RTL of AVALON_TIMEOUT2 istype memory_array is array (0 to 65535) of std_logic_vector (31 downto 0);signal memory : memory_array := (others => (others =>'0'));signal read_data : std_logic_vector(31 downto 0);beginCONTROL : process(reset, clk)beginif reset = '1' thenread_data <= (others => '0'); -- reset read_dataelsif Rising_Edge(clk) thenif write = '1' thenmemory(to_integer(unsigned(address))) <= writedata;end if;if read = '1' thenread_data <= memory(to_integer(unsigned(address)));end if;end if;readdata <= read_data;end process CONTROL;