cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ronnywebers
Advisor
Advisor
224 Views
Registered: ‎10-10-2014

how to apply a saved configuration of the Zynq MPSoC IP in a tcl script?

Jump to solution

while recreating my design using tcl, I'd like to use a (manually) saved configuration (i.e. config.tcl) to configure the settings in the MPSoC IP.

how can I kind of 'source' this tcl file in my script and apply it's contents to the Zynq MPSoC IP? Is there any example on how to do this?

Screenshot 2021-04-13 at 14.15.32.png

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
1 Solution

Accepted Solutions
florentw
Moderator
Moderator
205 Views
Registered: ‎11-09-2015

HI @ronnywebers 

I must admit this is not straight forward and it took me few iterations to find the correct way. This can be done in 2 tcl commands:

source ./zynqMP_config.tcl
set_property -dict [concat [apply_preset [get_bd_cells zynq_ultra_ps_e_0]]] [get_bd_cells zynq_ultra_ps_e_0]

 

Not sure if it is the "official" way but I did not find anything in the doc and this is working


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

3 Replies
florentw
Moderator
Moderator
206 Views
Registered: ‎11-09-2015

HI @ronnywebers 

I must admit this is not straight forward and it took me few iterations to find the correct way. This can be done in 2 tcl commands:

source ./zynqMP_config.tcl
set_property -dict [concat [apply_preset [get_bd_cells zynq_ultra_ps_e_0]]] [get_bd_cells zynq_ultra_ps_e_0]

 

Not sure if it is the "official" way but I did not find anything in the doc and this is working


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

ronnywebers
Advisor
Advisor
183 Views
Registered: ‎10-10-2014

thanks, I'm not a tcl expert, could not find it at all  

I'm trying to breakdown what that command actually does ... can you please correct me if I'm wrong?

1) it gets the bd_cells with the name zynq_ultra_ps_e0, which corresponds to the top level instance of the Zynq IP

2) calls apply_preset (proc defined in the config.tcl), with parameter the bd_cells ... however I don't see that the proc apply_preset does anything with that parameter ... but it seems to return a dict with all parameters/values

3) not sure what the concat does?? something with trimming whitespace / ensuring a single whitespace (?)

4) then all settings are contained in a dict, and that dict added by the 'setproperty -dict' to the zynq instance ? So adds new and/or overwrites any existing parameters at that point?

 

proc apply_preset {IPINST} {
  return [dict create \
    CONFIG.PSU__ACT_DDR_FREQ_MHZ {799.992004}  \
    CONFIG.PSU__PROTECTION__MASTERS {USB1:NonSecure;0|USB0:NonSecure;0|S_AXI_LPD:NA;0|S_AXI_HPC1_FPD:NA;0|S_AXI_HPC0_FPD:NA;0| ....

 

 

 

** kudo if the answer was helpful. Accept as solution if your question is answered **
0 Kudos
florentw
Moderator
Moderator
124 Views
Registered: ‎11-09-2015

HI @ronnywebers 

1) yes correct

2) The apply preset is only listing the parameters. To be honest I am not sure why it is called like that and why it requires to have the IP as parameter

3) I based this on the command executed from vivado when you change settings of an IP set_property -dict [ list ... ]. However using list was not working. When executing the command list apply preset and compared with list + parameters pasted from the apply preset command I noticed that the first one was applying brackets {} which was causing the full command to fail.

Looking at the list tcl command documentation I noticed that the concat command was avoiding the brackets this is why I used it.

For a generic answer, the purpose of concat is to join lists together

4) Yes correct, it should set all the parameters as returned by the apply preset


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**