How to add TCL script to HDL Coder IP Core generation
9 views (last 30 days)
Show older comments
I use HDL Coder IP Core flow and I need to add a TCL script that I have to open Vivado, add the new IP core to the existing project and implement with it.
I tried "add additional sources" option in HDL Coder to point to my TCL script there. The TCL script was never executed.
Of course I can run the script manually after IP core is generated, but I want to have a pushbutton solution, such that I only start IP Core generation and everything else would work automatically.
One possible way would be to do everything (including IP core generation) in a TCL script, but I don't know how to make HDL coder to generate IP core in a TCL script.
Any suggestions?
Thank you, alex
0 Comments
Accepted Answer
Wang Chen
on 18 Sep 2023
Hi Alex,
To clarify, "add additional sources" option (in HDL Workflow Advisor "Generate RTL code and IP core" step) is intended to include additional source files into the generated IP core. It will not execute the supplied Tcl script.
If you want to "I have to open Vivado, add the new IP core to the existing project and implement with it.", have you tried to create a custom reference design in IP core generation workflow? The steps to select a reference design (existing project), and run build tasks are exactly doing what you described. After you create a custom reference design, there are also callback functions you could use to execute your customized Tcl script.
Example of the IP core generation workflow with reference deisgn/bitstream build tasks; https://www.mathworks.com/help/hdlcoder/ug/getting-started-with-hardware-software-codesign-workflow-for-zynq-ultrascale-mpsoc-devices.html
Document/Examples of creating a custom reference design to include your existing project into the workflow:
Callback functions available when define custom reference design (where you could execute your tcl):
Alternatively, if you only want to run IP core generation (without the later build steps). You could Export a script from HDL Workflow Advisor, and run the IP core generaiton workflow in command-line. This way you could then execute your Tcl using command line, so you can have one combined script to do both IP core generation and the Tcl execution.
Thanks,
Wang
More Answers (1)
Kiran Kintali
on 17 Sep 2023
Edited: Kiran Kintali
on 18 Sep 2023
In the HDL Workflow Advisor for Generic ASIC/FPGA workflow, in the FPGA Synthesis and Analysis > Create Project task, in the Additional source files field, enter the full path to the Tcl file manually, or by using the Add button. When HDL Coder™ creates the project, the specified Tcl script is executed to apply the synthesis project settings.
For your usecase custom reference design creation in IP core generation workflow would be more suitalbe. This workflow has steps for selecting a custom reference design and run build tasks which is what you are looking for. After Custom reference design creation you can execute additional callback functions to run Tcl scripts of your choice. See this example for additional details..
Can you reach out to tech support for additional features related to tcl specification? Thanks.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!