Altera_Forum
Honored Contributor
7 years agoCreate own Avalon MM-Slave
Hi there
I'm trying to create my first Avalon MM-Slave which should be accessible through a NIOS II softcore. In the end I just want a MM-Slave which has a conduit input and output for connecting to my custom logic. I am using a very simple MM-Slave which I have found on the internet to test how the slave behaves and how I have to build up my own slave with my needs. The slave works so far and I'm basically able to read from and wirte to the slave. But there is something I do not understand: The component uses the following entity:entity system_cpu_serial_interface_2 is port(
-- Avalon Clock interface
clk : in std_logic;
-- Avalon Reset interface
reset : in std_logic;
-- Avalon-MM Slave interface
address : in std_logic_vector(1 downto 0);
read : in std_logic;
write : in std_logic;
readdata : out std_logic_vector(31 downto 0);
writedata : in std_logic_vector(31 downto 0)
);
end system_cpu_serial_interface_2; When reading from the slave I use the following line in my NIOS II code: result = IORD_32DIRECT(SYSTEM_CPU_SERIAL_INTERFACE_2_0_BASE, 1); I was expecting that I see the chosen offset (which is in this case 1) on the address signal. But what I get is the following:https://alteraforum.com/forum/attachment.php?attachmentid=15023&stc=1 writedata changes to 0x00000001 during read and address stays 0x00 (see attachment read.jpg).https://alteraforum.com/forum/attachment.php?attachmentid=15028&stc=1 When I try to write to the slave, the behaviour is different. I use the following code in NIOS II: IOWR_32DIRECT(SYSTEM_CPU_SERIAL_INTERFACE_2_0_BASE, 2, 0xAAAAAAAA); In signal tap I can see that writedata now is 0xAAAAAAAA as expected but again, the address signal stays 0x00. I was expecting this time that address should be 0x02 since the offset was 2 (see attachment write.jpg). Can anyone tell me why the component behaves like this and how can I reach that i see the offset when reading or writing on the address signal? https://alteraforum.com/forum/attachment.php?attachmentid=15029&stc=1