Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20688 Discussions

Simple new Component in Sopc

Altera_Forum
Honored Contributor II
1,040 Views

Hello, I'm a beginner with SOPC. 

The problem is: 

how can I create a SOPC component that interfaces to an external component, such as a full adder (x, y 8bit , sout 8bit, rout 1bit). 

This component has no interface avalon, so I have to create the component that should allow me to interface with it. 

The system includes the Nios. 

 

any help is good!!! 

 

Thanks, sorry if my English is not perfect...
0 Kudos
10 Replies
Altera_Forum
Honored Contributor II
364 Views

You have basically two ways:[list][*]Include your external IP inside your SOPC component by instantiating it, and provide an Avalon wrapper around it to make it compatible with SOPC builder[*]Put your IP outside the SOPC system and create a SOPC component with an Avalon slave interface on one side and a conduit (also called export) interface on the other. The conduit interface pins will appear as ports on the full SOPC system and they can be connected to your external component[/list] 

If possible, I think the first way is simpler.
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

I think you want the adder to connect to your nios core. 

 

You can simply use PIO to read and write, functions like IORD and IOWR are useful. 

You can also use HDL to write a driver, use avalon interface to help the driver connect to your nios core. ( avalon interface specifications is introduced in detail the usage of the avalon interface. )
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

In this case add an adder but is a way to try adding a custom device. 

I'm trying the second method proposed by daixiwen, I'll try the other. 

 

The main purpose is to access an external device to the system through NIOS. 

I will keep you updated .. 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

Can you point me at a tutorial or example of either approach. I have a similar problem as I want to put a dual port memory into SOPC with one MM_Avalon port and one external port. I've read the SOPC user guide but it assumes too much knowledge for a numpty like me.

0 Kudos
Altera_Forum
Honored Contributor II
364 Views

You can see other posts on this forum, there are also examples in VHDL, such as "avs_export". 

 

The ways to create an interface may be different and you do it in SOPC with hdl file or not, 

in that case you can see SOPC user guides, par 6-4 in case you want to create a component using HDL.
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

I'm staring at the SOPC user guide, 4-4 and 6-4 etc and it tells me what I need to do, but as a newbie I'm pretty lost without an example.

0 Kudos
Altera_Forum
Honored Contributor II
364 Views

You have this example (http://www.altera.com/support/examples/nios2/exm-checksum-acc.html) from Altera, but it may show a bit more than what you need.

0 Kudos
Altera_Forum
Honored Contributor II
364 Views

You are right, that's far to complicated for me.

0 Kudos
Altera_Forum
Honored Contributor II
364 Views

Hi,  

Did anyone in here get the new component working? Any tutorial?  

Can anyone give me some insights???
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

I recommend the following: 

 

1) Read the Avalon spec 

2) Generate a simple component in SOPC Builder/Qsys like the on-chip memory component 

3) Study the structure of the HDL to learn how to apply it to your own custom hardware 

 

Some recommendations: 

 

1) Put byte enables on your slave port (allows you to perform sub-word accesses without corrupting the rest of the word) 

2) Try to make the component fixed latency if possible (i.e. no need for wait request usually) 

3) Don't over design. If you can simplify your component by using multiple ports then do it and let the tools handle the rest for you.
0 Kudos
Reply