{"id":28740,"date":"2021-12-10T06:26:46","date_gmt":"2021-12-10T14:26:46","guid":{"rendered":"https:\/\/www.digilent.com\/blog\/?p=28740"},"modified":"2023-02-07T17:04:06","modified_gmt":"2023-02-08T01:04:06","slug":"adding-buttons-to-vivado","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/adding-buttons-to-vivado\/","title":{"rendered":"Add Buttons to Fit Your Needs in Vivado"},"content":{"rendered":"<h2>How You Can Add Buttons to Vivado<\/h2>\n<p><span data-contrast=\"auto\">These step-by-step instructions will add a button to the Vivado application that changes the working directory of the TCL console to the directory containing whatever project you currently have open. The same steps can be used to add buttons that essentially do any task you want them to in Vivado. Every action you take in the GUI is translated into TCL commands which can be added to a script and turned into a button. This means that your most commonly replicated tasks can be turned into a single button click or even a hotkey. <\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>Before we continue on: you&#8217;re welcome.<\/p>\n<h2>Follow These Steps to Add a Button<\/h2>\n<p><span data-contrast=\"auto\">First, make sure you have a project open. Select Tools -&gt; Custom Commands -&gt; Customize Commands from the menu at the top of the screen.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28743\" src=\"https:\/\/www.digilent.com\/blog\/wp-content\/uploads\/2021\/12\/MicrosoftTeams-image.png\" alt=\"Adding Buttons to Vivado \" width=\"957\" height=\"676\" data-wp-pid=\"28743\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/12\/MicrosoftTeams-image.png 957w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/12\/MicrosoftTeams-image-600x424.png 600w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/h2>\n<p><span data-contrast=\"auto\">Next, click the \u201cAdd\u201d (+) button in the list to the left, give your command a name (CdToProject here), then press Enter.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">On the right, there are a bunch of options to configure the button. In the screenshot below, we can see that the button has been given a name and a description.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">No shortcut (hotkey combination) is given since this button will only really need to be used once per session in Vivado.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The following text is placed in the \u201cRun command\u201d text field, which is the TCL command that will be run when the button is pressed.\u00a0This is where you would substitute in your own command, whatever it happens to be.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<blockquote><p><span data-contrast=\"auto\">`cd [get_property DIRECTORY [current_project]]`<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p><\/blockquote>\n<p><span data-contrast=\"auto\">Alternatively, we could provide a path to a TCL script (a file containing a sequence of these commands) in the \u201cSource Tcl file\u201d field, if we needed to run more than the single command at a time.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">No arguments were defined (\u201cDefinte Args\u201d) in this case either. This option can be used to pass typed strings from a popup dialog to the command you are running with the button.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The \u201cAdd to the toolbar\u201d box needs to be checked, in order to actually put a button in the UI.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Lastly, the \u201cIcon file path\u201d just lists the image file used for the button, which in this case was snipped out of Vivado\u2019s file system navigator UI.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28742\" src=\"https:\/\/www.digilent.com\/blog\/wp-content\/uploads\/2021\/12\/MicrosoftTeams-image-2.png\" alt=\"Adding Buttons to Vivado \" width=\"950\" height=\"565\" data-wp-pid=\"28742\" \/><\/h2>\n<p>&nbsp;<\/p>\n<p><span class=\"TextRun SCXW24806903 BCX0\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"auto\"><span class=\"NormalTextRun SCXW24806903 BCX0\">After clicking OK, we can see the button in the UI, and after clicking on it, see that the command is performed.<\/span><\/span><span class=\"EOP SCXW24806903 BCX0\" data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-28741\" src=\"https:\/\/www.digilent.com\/blog\/wp-content\/uploads\/2021\/12\/MicrosoftTeams-image-3.png\" alt=\"Adding Buttons to Vivado \" width=\"802\" height=\"512\" data-wp-pid=\"28741\" \/><\/h2>\n<p><span data-contrast=\"auto\">This is somewhat of a simplified example, but having the button can save some time over typing the full path to whatever project you are working in in each session.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">In conclusion, Vivado can be modified extensively to fit your needs, so take advantage of its customizability. Learn how the TCL engine under the hood works, and you can do whatever you want through a couple of button clicks or console commands.<\/span><span data-ccp-props=\"{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p>Happy designing!<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-28740 jlk' data-task='like' data-post_id='28740' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-28740 lc'>+1<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-28740 jlk' data-task='unlike' data-post_id='28740' data-nonce='8896bc70a6' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-28740 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-28740 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>How You Can Add Buttons to Vivado These step-by-step instructions will add a button to the Vivado application that changes the working directory of the TCL console to the directory &hellip; <\/p>\n","protected":false},"author":52,"featured_media":28745,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[35,1563],"tags":[72,1662,453,36],"ppma_author":[4462],"class_list":["post-28740","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fpga","category-guide","tag-design","tag-fpga","tag-vivado","tag-xilinx"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2021\/12\/Buttons-in-Vivado-cover.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4462,"user_id":52,"is_guest":0,"slug":"abrown","display_name":"Arthur Brown","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/60e7f8e1b3a55e2e20ee541df1f393c2acbcee9fd05fd3e38d07e25a2e6fd237?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=28740"}],"version-history":[{"count":1,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28740\/revisions"}],"predecessor-version":[{"id":29613,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/28740\/revisions\/29613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/28745"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=28740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=28740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=28740"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=28740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}