{"id":624,"date":"2015-03-25T09:52:17","date_gmt":"2015-03-25T17:52:17","guid":{"rendered":"http:\/\/www.beyond-circuits.com\/wordpress\/?p=624"},"modified":"2016-10-31T14:24:24","modified_gmt":"2016-10-31T22:24:24","slug":"putting-new-files-in-the-right-place-the-vivado-edition","status":"publish","type":"post","link":"https:\/\/www.beyond-circuits.com\/wordpress\/2015\/03\/putting-new-files-in-the-right-place-the-vivado-edition\/","title":{"rendered":"Putting New Files in the Right Place: The Vivado Edition"},"content":{"rendered":"<p>Vivado has the ability to create and manage your own IP, which is a good thing. But there are some real gotchas when doing something like this, the first being that it doesn&#8217;t seem to place HDL files in the correct locations.<\/p>\n<p>I have been running some FPGA workshops using the IP Packager in Vivado and having\u00a0been having a lot of problems when creating new files in the IP component. Here&#8217;s an example:<\/p>\n<p>From a Vivado project select <em>Tools\u2192Create and Package IP\u2026<\/em> Click <strong><em>Next<\/em><\/strong>, select <em>Create a new AXI4 peripheral<\/em>, click <strong><em>Next<\/em><\/strong>, just use the defaults for the next page, click <strong><em>Next<\/em><\/strong> again, use the defaults for the AXI information and click <strong><em>Next<\/em><\/strong> again, select <em>Edit IP<\/em>, then click <strong><em>Finish<\/em><\/strong>.<\/p>\n<p>This will put in an IP Packager project. Edit the top level file <em>myip_v1_0<\/em>. I&#8217;m using Verilog but it works the same for VHDL. Instantiate a new dummy module at the bottom of the file:<\/p>\n<pre>\/\/ Add user logic here\r\ndummy dummy (.clk(s00_axi_aclk));\r\n\/\/ User logic ends\r\n<\/pre>\n<p><a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-625 alignright\" src=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig1-300x90.png\" alt=\"files_fig1\" width=\"300\" height=\"90\" srcset=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig1-300x90.png 300w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig1.png 399w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Save the file and look at the design sources. You will see that there is now a new undefined module in the design called <em>dummy<\/em>. It should look like the figure to the right:<\/p>\n<p>Now, we would like to create the new module. So we go to <em>File\u2192Add Sources\u2026<\/em> and create the new source file. Select <em>Add or create design sources<\/em> and click <strong><em>Next<\/em><\/strong>. Click <em><strong>Create File\u00a0\u2026<\/strong><\/em>, type the file name <em>dummy<\/em> and click <strong><em>OK<\/em><\/strong>. Click <strong><em>Finish<\/em><\/strong>. When the <strong>Define Module<\/strong> dialog pops up, just click <strong><em>OK<\/em><\/strong>. Click <strong><em>Yes<\/em><\/strong> to the dialog saying you haven&#8217;t changed anything. You now have a file defined for your <em>dummy<\/em> module.<\/p>\n<p><a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-626 alignright\" src=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2-300x81.png\" alt=\"files_fig2\" width=\"300\" height=\"81\" srcset=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2-300x81.png 300w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2-1024x275.png 1024w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2-500x134.png 500w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig2.png 1151w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Ready to package that IP? Go to the <strong>Package IP<\/strong> tab in the <strong>Project Manager<\/strong> window. Then, select <strong>File Groups<\/strong> in the <strong>Packaging Steps <\/strong>window. You should see a window like the figure on the right.<\/p>\n<p>Now click on the <span style=\"text-decoration: underline;\">Merge changes from File Groups Wizard<\/span> link. You will then get a link saying <span style=\"text-decoration: underline;\">2 warnings<\/span>. Click on that, and you will see two warnings about your <em>dummy.v<\/em> file being on a path which is not relative to your IP root directory. What has happened is that Vivado placed the new file outside the IP component. If you go ahead and package your IP, you cannot use the packaged IP because it will be missing this file. Seems like a Vivado (2014.4) bug to me.<\/p>\n<p>So how should we fix this? I don&#8217;t know how to move files in Vivado, but we can create the file in a different location when we make the new file. To do that, first delete the dummy file and remove it from disk. Just select the file, then right-click and select <em>Remove File from Project<\/em>. Select the checkbox to also delete it from disk and click <strong><em>OK<\/em><\/strong>.<\/p>\n<p><a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig3.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-628 alignright\" src=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig3-300x199.png\" alt=\"files_fig3\" width=\"300\" height=\"199\" srcset=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig3-300x199.png 300w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig3.png 330w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Now go to Add Sources again, and after clicking <em>Create File\u2026<\/em>, specify the file name <em>dummy.v<\/em>, then select a new file location. <a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig4.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-medium wp-image-629 alignright\" src=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig4-300x192.png\" alt=\"files_fig4\" width=\"300\" height=\"192\" srcset=\"https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig4-300x192.png 300w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig4-468x300.png 468w, https:\/\/www.beyond-circuits.com\/wordpress\/wp-content\/uploads\/2015\/03\/files_fig4.png 546w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>Navigate to your <em>ip_repo<\/em> area and into <em>myip_1_0. <\/em>Select the <em>hdl<\/em> directory, and click <strong><em>Select<\/em><\/strong>. Then click <strong><em>OK<\/em><\/strong> and then <strong><em>Finish<\/em><\/strong> to create the file. This will place the file in the proper location in the IP repository.<\/p>\n<p>When you merge your changes in the <strong>File Groups<\/strong> step, you should not get any warnings. You can then package your IP and use it in your designs.<\/p>\n<p>Hopefully this will be fixed in the next release of Vivado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vivado has the ability to create and manage your own IP, which is a good thing. But there are some real gotchas when doing something like this, the first being that it doesn&#8217;t seem to place HDL files in the &hellip; <a href=\"https:\/\/www.beyond-circuits.com\/wordpress\/2015\/03\/putting-new-files-in-the-right-place-the-vivado-edition\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7,9,5],"tags":[],"class_list":["post-624","post","type-post","status-publish","format-standard","hentry","category-fpga","category-tools","category-vivado","category-xilinx"],"_links":{"self":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/posts\/624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/comments?post=624"}],"version-history":[{"count":4,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/posts\/624\/revisions"}],"predecessor-version":[{"id":1174,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/posts\/624\/revisions\/1174"}],"wp:attachment":[{"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/media?parent=624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/categories?post=624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beyond-circuits.com\/wordpress\/wp-json\/wp\/v2\/tags?post=624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}