FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Component Editor

Honored Contributor II

Hi all, 


I am using the Altera DE2 board. I need to create custom peripherals using the component editor of sopc builder. 

I need help with a simple example to get me started: 

I am trying to create an adder( 8 bits wide) with 2 inputs and 1 output. 

how do i assign the interface to this adder so that I can instantiate it as a component in SOPC? 

I would greatly appreciate your help in this regard.
0 Kudos
2 Replies
Honored Contributor II

To make a connection to the cpu in the SOPC builder you will have to check the Avalon bus spec. to see how the interface works. The avalon bus is quite flexible and has a lot of different signals to choose from. You only need to implement those that are relevant for your component. The component editor give good tips of what is missing when starting to assign signals to the interface. 


First create the interface you need in the interface tab. Probably Avalon slave in your case. Then assign the port signals from your HDL-file to that interface. 


Most likely you will need a data bus in and one out, read and write enables, if using two input registers you will need at least a 1-bit address line. If you want signals to be available outside the sopc module then you assign your signal to the "global_signals" interface as type "export". 


But why are you doing an adder as a separate component? The Nios cpu already has an ALU. (Is it just for testing?)
Honored Contributor II

Also remember that your component can only accept one input at a time per Avalon-MM slave port. So if you are creating an adder you'll have to write each input separately (different address locations) or pack the to inputs into a wider data width that your component supports. 


Here's some documentation that'll help you out: