• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - TCL
  3. Any way to "Global Modify" a property of a component with...

Stats

  • State Not Answered
  • Replies 1
  • Subscribers 12
  • Views 71
  • Members are here 0
More Content

Any way to "Global Modify" a property of a component with tcl in ASC?

Gelzone
Gelzone 1 day ago

I wrote a procedure to modify a property (e.g. PART_NUMBER) of a component (type: INST) page by page.
I met a issue that if a component is associated with different pages, then it will raise violation error.

Error message:

PKG1104 Physical part <PART_NAME>_<PACK_TYPE>-<VALUE>,<PART_NUMBER> cannot be assigned to package <modified_component_refdes>.

The package <modified_component_refdes> is associated with part name <PART_NAME>_<PACK_TYPE>-<VALUE>,<PART_NUMBER>-<JEDEC_TYPE>.

I guess the error occurs that I didn't modify all components (w/ same refdes) simultaneously.

And here is my code snippet, maybe there is something I can improve:

proc testMod {} {
# Read refdes & cpn mapping
puts "Processing mapping list..."
set refPropsFile "C:/temp/refdes_props.csv"
ReadFiles create readRefProps $refPropsFile "csv"  # This is just a class I created to read csv file
set refPropsList [readRefProps readFile "\t"]   # Return type is a list
set mapping {}
foreach eachMapping $refPropsList {
# Extract the key and value from the sublist
dict set mapping [lindex $eachMapping 0] [lrange $eachMapping 1 end]
}
readRefProps destroy

puts "Updating Properties..."
# Loading the schPageUtils pacakge.
package require schPageUtils
# Getting All Page Information.
set pageListDict [schPageUtils::getDesignPagesAllInfo]
# Reading Total Number of Pages
set size [schPageUtils::getPagesInfoSize $pageListDict]

set pageIter 1
while {$pageIter <= $size} {

set currTabSPath [cps::getSPathByTabIndex 1]
puts $pageIter
puts $currTabSPath
set pageId [sch::dbGetActivePage]
selectObject all
set selItem [sch::dbGetSelectedItems $pageId]
selectObject none
#set hasModified 0
foreach item $selItem {
set itemType [sch::dbGetType $item]
if {$itemType == $::sch::DBTInst} {
set ItemSpath [sch::dbGetSPath $item]
array set RefOrg [join [sch::dbxGetRefDesAndOriginFromInstSpath $ItemSpath]]
set location $RefOrg(refdes)
if {[dict exists $mapping $location]} {
#set hasModified 1
set props [dict get $mapping $location]
set pn [lindex $props 0]
set footprint [lindex $props 1]
puts $location
puts $pn
puts $footprint

sch::dbSelectObjectById $item $::sch::DBTrue
modifyProp -name PART_NUMBER -value $pn
modifyProp -name JEDEC_TYPE -value $footprint
puts "Properties modified."
saveAll
}
}
}
sch::nextPage
closeItem $currTabSPath
incr pageIter
}
puts "Done"
#saveAll
#sch::closeProject
#exit
}

  • Cancel
  • Sign in to reply
  • Gelzone
    0 Gelzone 1 day ago

    And there is another weird behavior while the procedure is running.

    For instance, if the process is modifying a component (e.g. at p.36), then the action should be: modify PART_NUMBER & JEDEC_TYPE -> save -> close the page -> open p.37.

    But the real scenario is: close p.36 -> open p.37 & p.36 again!

    So the following process will always open p.36, not the real page I want.

    I am not sure it's the side effect of the condition I mentioned in the article or it's a new problem. I need some help.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information