Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Simple new Component in Sopc

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...

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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. )
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

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

    Can anyone give me some insights???
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.