Altera_Forum
Honored Contributor
21 years agoHow to use the avalon bus correctly?
I am using Quartus 4.1 with SOPC-builder and the Cyclone Development Board von Altera. My nios-system contains the nios2 processor, some memory and some other peripherals.
I created my own user logic which I want to connect to the avalon bus and access from software. I read the complete avalon bus specification but I was not able to find any real example there. Can somebody give me a simple example how to connect some user logic to the avalon bus correctly? And how to access it in software then? As a simple example we can take the following vhdl-code:library IEEE;
use IEEE.std_logic_1164.all;
ENTITY example IS PORT (
SIGNAL clk: IN STD_LOGIC;
SIGNAL input1: IN STD_LOGIC;
SIGNAL input2: IN STD_LOGIC;
SIGNAL output: OUT STD_LOGIC
);
END example;
ARCHITECTURE behavior OF example IS
BEGIN
PROCESS(clk)
BEGIN
IF clk'EVENT AND clk='1' THEN
output <= input1 AND input2;
END IF;
END PROCESS;
END behavior; How do I have change this vhdl-code in order to connect this user logic to the the avalon bus? Because I want to write to and read from the hardware module at least the signals chipselect, write (or write_n), writedata, read (or read_n), readdata and address must be there. Am I wright?