cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pfresch
Visitor
Visitor
544 Views
Registered: ‎10-01-2020

write_bd_tcl

Hi, 

I use the write_bd_tcl command with -include_layout option. I only use this tcl file in git (no .bd or ui folder). Less than minimal set up (as suggested in ch.5 of UG82) but so far so good untill...

I added a comment in our bd. In the generated tcl this comment resulted in some new lines:

# Add USER_COMMENTS on $design_name
  set_property USER_COMMENTS.comment_0 "Changelog:
  0  01-oct-2020  pf  Base Design Creation " [get_bd_designs $design_name]

 

But now, if I source the tcl in console (to recreate the bd) of an "emtpy" project folder (folder with only .xpr file as result from clean git clone from repo) it throws an error:

ERROR: [Common 17-55] 'set_property' expects at least one object.
Resolution: If [get_<value>] was used to populate the object, check to make sure this command returns at least one valid object.

 

If I comment out the line in the tcl file and source it, everyting goes ok (and the comment is regenerated in the bd!). I am able to use generate the wrapper of the bd and compile the top design (up to the bitstream). 

 

Is this a bug or am I doing something wrong?

 

Cheers,

Paolo 

0 Kudos
Reply
2 Replies
hwsteve
Observer
Observer
461 Views
Registered: ‎02-12-2019

See if this works any better:

set_property USER_COMMENTS.comment_0 {Changelog: your comments} [get_bd_designs $design_name]

 I'm guessing the string with the newline might be confusing tcl as to what that argument really is.

And triple check that [get_bd_designs $design_name] returns something but putting this just before it just for testing:

puts "DBG: [get_bd_designs $design_name]"
pfresch
Visitor
Visitor
394 Views
Registered: ‎10-01-2020

Thank you @hwsteve !

The error is caused by the status of the project when you source the tcl. 

You must have an IP Integrator design opened. As state in line 54 of the automatically generated tcl:

 

#If you do not already have an existing IP Integrator design open,

#you can create a design using the following command:

create bd_design $design_name

 

Uncomment the last line (if it is necessary to do so) and the error disappear (and the bd generates with no problem)!

EXTRA: if you are just updating a Block Design already opened/included in your project you must first remove it from the project otherwise the script will throws an error.

Is this the correct way to do so? 

0 Kudos
Reply