Forum Discussion

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

Qsys Directory Structure

I'm working on a project using Qsys that has been split into a hierarchy . Some sections of the hierarchy are to be used on other projects, and I'm using a revsion control system (SVN) to pull these sections of the design into my project.

I have a directory structure for a subsytem that look something like:

  • Subsytem_X

  • IP

  • Component_A

  • Component_B

This works fine, and I can work on subsytem_X.qsys and instantiate Component_A and Component_B

The trouble starts when I try to pull this into my top level, I expected the following structure to work:

  • Top_Level

  • IP

  • Subsystem_X

  • IP

  • Component_A

  • Component_B

The problem is that Qsys only seems to search down one level of 'IP' folder. It doesn't look down into Subsystem_X's IP folder to find the two components when I try to instantiate Subsystem_X.

Seeing as being able to split a project up into a hierarchy is a big selling point of Qsys (it's what it's icon shows) this seems to be quite a short coming.

Any ideas on a better way to do this or any workarounds would be appreciated.

Thanks,

Mark

6 Replies

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

    Ted,

    Thanks for pointing me toward the .ipx file. I've now got this to work, but still doesn't seem to be as smooth as it could be.

    The lacking feature of the .ipx file is that you can't have a component that is a .qsys file. This seems rather odd as a .qsys file can be a component if it's on Qsys's search path. This means that I have to export my system as a _hw.tcl file before using the .ipx.

    I've also not had any luck using paths in the .ipx file, I've had to use the ip-make-ipx command to generate the file. I thought that something like this would work:

    <library>

    <path path="subSystemAFiles" />

    <path path="subSystemAFiles\IP" />

    </library>

    I have this in a folder subSystemA, and all works well if I use the ip-make-ipx command to list all the components, but replacing this with the file above I don't see any of the components. Is there any way that I can debug this? Doesn't seem that there is any way to see what's going wrong.

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

    .qsys files (and directories containing .qsys files) can definitely be added to the .ipx file and be picked up by Qsys.

    The .ipx can be used a couple different ways, but for you I think the easiest thing would be to simply use it to specify the search path. Assuming that "Top_Level" is where your project is located and where Qsys will run from, try creating a user_components.ipx file that looks like this:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <library>
      <path path="Subsystem_X/*" />
      <path path="Subsystem_X/IP/**/*" />
    </library>
    

    What that says is to first look in Subsystem_X (to pickup the .qsys subsystem there), and then the second line says to search all the subdirectories of "IP" (to pickup your components).

    You can actually avoid creating the .ipx file in your toplevel directory if you place your "Subsystem_X" directory inside an 'ip' directory, since it is in the default search path, but you would need to create a .ipx in the subdirectory since the search will stop recursing when it finds your .qsys subsystem. For example,

    /Top_Level/ip/Subsystem_X/subsystem_X.qsys

    /Top_Level/ip/Subsystem_X/subsystem_X_components.ipx

    /Top_Level/ip/Subsystem_X/IP/Component_A/Component_A_hw.tcl

    /Top_Level/ip/Subsystem_X/IP/Component_B/Component_B_hw.tcl

    I believe with that structure, the "subsystem_X_components.ipx" you could create with ip-make-ipx, telling it to index your Subsystem_X/IP directory.

    My suggestion would be to start with the simplest .ipx above to get oriented, and then get more complicated (more modular) from there.

    As far as debugging, you can leave Qsys running and use File->Refresh system to cause it to re-search. In the dialog box that pops up, you can scroll up and see where it has attempted to process the directories in your .ipx file and it will report counts of components, so you can have some hint that it is or is not finding your files.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks again Ted,

    I now have this working as wanted. I've put the .ipx file in the sub-component folder, and it points to the next folder down where the .qsys file is for the sub-component, and also added the path for the sub-components IP folder. It means that I've now got an extra folder level for the .ipx file, but it seems to work very well. I haven't tried it yet, but I expect that this would allow multiple levels of hierarchy to be nested.

    I still think the paragraph at the bottom of page 7-9 on the link you sent me is a bit misleading, as it seems to indicate that .qsys files wouldn't be picked up. Maybe Altera could update this at some point.

    Thanks again for all your help,

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

    --- Quote Start ---

    I still think the paragraph at the bottom of page 7-9 on the link you sent me is a bit misleading, as it seems to indicate that .qsys files wouldn't be picked up. Maybe Altera could update this at some point.

    --- Quote End ---

    That paragraph is describing the ip-make-ipx convenience utility, and "the problem" is that although Qsys and the .ipx file syntax support it, ip-make-ipx ignores .qsys subsystem files as it searches. Perhaps the utility dates from SOPC Builder days, as subsystems are new for Qsys.

    Working within the confines of what they have already given you, one workaround might be creating (.qsys, .ipx) file pairs where the .ipx file adds and describes only the .qsys "component", but I'm not really sure. I usually just use a version of the simplified file pasted earlier.

    Good luck.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    That paragraph is describing the ip-make-ipx convenience utility

    --- Quote End ---

    I take that back: the paragraph is not describing the utility, and is indeed misleading! (or, at least not accurately describing the behavior of the current software)