Xcore modules structure and guidelines

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Xcore modules structure and guidelines

Post by Folknology »

Having played with the new v12 IDE and tools/softip I am now resuming normal service by returning to my familiar commandline development. But this has raised a few issue I need to resolve before commencing with my SliceKit experiments:

1) Is there a recommended project structure (dir stucture etc) that I can use to be compatible with the new modular features (softip) both from using them and creating them perspectives?

2) What are the basic procedures for adding in an official module (ip), is it adding it to the parent dir :

Code: Select all

git clone git@github.com/xcore/sc_xxx ../
Then appending it in the makefile to USED_MODULES?

3) Are the modules on github exactly the same as those in softip or are there differences we need to understand.

4) is there any metadata associated with softip that we need to provide on gihub when adding or updating modules for softip inclusion?

I am sure I (and others here) will have more questions but I kind of need to get these answered before I proceed otherwise I may end up having to refactor/restructure later.

PS are there any project templates to help get started (unless I can just use xcommon with xcore_template)?

regards
Al
User avatar
afeher
New User
Posts: 2
Joined: Tue Feb 14, 2012 6:35 pm

Post by afeher »

I'm also waiting for an answer to this question. :) According to "Tools User Guide" the structure should be e.g.

_sw_
____app_
____module_

_sc_
____module_
____module_

but there is no option in XDE (TimeComposer) to create a parent sw_ or sc_, only app_ and module_. The SoftIP Explorer does not generate a parent project, it only generates a bunch of modules and a simple project (in same level) containing a Makefile including all the modules.
User avatar
davelacey
Experienced Member
Posts: 104
Joined: Fri Dec 11, 2009 8:29 pm

Post by davelacey »

I think the user guide may need updating. I'll raise a ticket on that.

How you should go about it depends on what you are doing. If you are using the xTIMEcomposer and just want to get going then I would just recommend creating projects using the new project wizard (it has an option for modules as well). The projects created this way can easily be moved into a github style repo without any changes to Makefiles etc. You can also import github project directly into the xTIMEcomposer studio using git (File->Import->Git) but this relies on the github repository having eclipse project files.

If you are just using the command line tools and/or are looking to commit back to github then you can use the xcore_template structure and that should all work nicely. Just clone the other repos in the same directory as your repo. So you will end up with::

Code: Select all

   working_dir/
        sc_myrepo/
              app_myapp/
              module_mymodule/
        sc_ethernet/
        ....
Dave
User avatar
davelacey
Experienced Member
Posts: 104
Joined: Fri Dec 11, 2009 8:29 pm

Post by davelacey »

Folknology wrote: 1) Is there a recommended project structure (dir stucture etc) that I can use to be compatible with the new modular features (softip) both from using them and creating them perspectives?
Yes. The same structure as the repos on github.
Folknology wrote: 2) What are the basic procedures for adding in an official module (ip), is it adding it to the parent dir :

Code: Select all

git clone git@github.com/xcore/sc_xxx ../
Then appending it in the makefile to USED_MODULES?

3) Are the modules on github exactly the same as those in softip or are there differences we need to understand.
It is easiest to answer these two questions together. The modules on github are the same. The ones in the xSOFTip explorer are just snapshot versions of the repos. You can download zips of these snapshots directly of the website as well (via https://www.xmos.com/resources/xsoftip).

If you are using the command line the way to get an "official" module is to download the zip from xmos.com, unzip it into your working directory and then add it to your USED_MODULES variable in the Makefile. This will get you the latest stable release. If you want the development head you can clone the github repo and work in exactly the same way.
Folknology wrote: 4) is there any metadata associated with softip that we need to provide on gihub when adding or updating modules for softip inclusion?
The answer is yes - but for the moment the process of getting modules into the xSOFTip list is managed by XMOS. We are looking into opening this up to include community modules in there as well. There is not much you need to do if you don't care about the resource estimation/code generation part. Basically you need to have READMEs in each app/module in a particular form. For example, see https://github.com/xcore/sc_sdram_burst ... README.rst. The title of this README along with the scope/description/keywords/boards fields give the metainformation required to present the software in the list.


Folknology wrote: PS are there any project templates to help get started (unless I can just use xcommon with xcore_template)?
You do not need xcommon (it is bundled with the tools). The xcore_template is still a good starting place for directory structure. It may be a bit out of date but not in a big way. I'll give it a review.

Dave
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Thanks Dave, I have been using xcommons and the xcore template, I wasn't aware that we no longer need xcommons. I can now see something in the build dir for xcommons in V12, are there specific make commons or some such to create a new project from the templates in there or do I use the existing python scripts from xcore repo?

What is the procedure for adding to the xcore repo, does one create a local project under one's own own github account and then request that Xmos pull it or do we get assigned privileges to create and or update them directly?

regards
Al