Intellectual Properties (IP)
Contents
Intellectual Properties (IP)¶
IP files can be stored anywhere in your repository or in submodules. However, particular care must be taken to avoid that files generated by Vivado or Quartus are kept separated and not committed to the repository, unless you want to keep the IP in a locked status.
To achieve this, these simple rules must be followed:
each ip file (
.xci
for Vivado) must be contained in a sub-folder called with the same name as the .xci file (extension excluded).only the ip file must be committed to the repository (e.g.
.xci
for Vivado,.ip
for Quartus)a
.gitignore
file must be used to tell git to ignore all non-ip files, a template is provided in theTemplates
directory.
Basically for each IP in your project run:
mkdir -p path_to_your_ips/ip_name/
cp ../old_repo/ip_name.xci path_to_your_ips/ip_name/
Then you must add the .xci
files to the .src list file you want, in this case we will use a separate file called IP.src
. You can use the following script if you like:
for i in $( ls path_to_your_ips/* ); do \
echo $i/$i.xci >> Top/myproject/list/myproject.src;
done
Note
There is no concept of library for the IPs, so we prefer to put them in a separate .src file. You can put them in the same list file as your other source files if you wish. Just open Top/myproject/list/myproject.src
with a text editor and add them there.
As usual, you can check that the files are correctly picked up by regenerating the project ./Hog/CreateProject.sh myproject
If you are satisfied with the changes, you can commit your work.
git add path_to_your_ips
git add Top/myproject/list/IP.src
git commit -m "Adding IP Files"
Keep the IP locked (Vivado only)¶
Sometimes you might want an IP to be kept in a locked status, for example, when you are using an older version of the IP and want to prevent Vivado to update it.
This can be achieved by committing to the repository the entire folder where the .xci
file is located and by removing the dedicated .gitignore
. Then, in your .src
list file you can specify the locked property for your IP as following.
IP/ip1.xci locked
You can achieve the same result, by unticking the IS_MANAGED property of your IP in the Vivado GUI.
IP initialisation files (.coe, .mif)¶
Please note that the .gitignore
template provided by Hog adds constraints on the IP folder.
Out of all the files contained in repo/IP/, git will pick up only .xci files.
Files with different extensions will be ignored.
If you have .coe files for RAM initialization or analogous files please make sure that you store these files in a separate folder and point to them in the IP one by using a relative path.
Creating the IPs/BDs with a Tcl script (Hog > 2022.1, VIVADO ONLY)¶
Users can also create IPs or BDs after that the project has been created, using TCL scripts. In this case, the .xci
or .bd
files shall not be included in the .src
list files. The TCL scripts, on the other hand, should be listed with the property source
, as in the following example list.
mypath/file.vhd
mypath/script.tcl source
In this case, Hog will source the script script.tcl
after the creation of the project. Naturally, it is also possible to generate the IPs/BDs using the integrated post-creation.tcl
script (see here).