• 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. connecting multiple signals to component

Stats

  • State Suggested Answer
  • Replies 4
  • Answers 1
  • Subscribers 14
  • Views 3945
  • Members are here 0
More Content

connecting multiple signals to component

mikeyam
mikeyam over 2 years ago

Hello

I need to connect multiple signals for DDR memory to FPGA component.

I have list of signals in Excel with required FPGA pins it should be connected to. 

All the memory signal go to the same part of the FPGA component.

Its more than 100 signals and i have to do it for 4 banks, so its a lot of connectivity if done manually.

Is there any way to create such connectivity more automatically?

example, if we could generate some verilog like file from excel saying which signal name goes to which pin name.

Is there anything like this existing in Orcad?

Thank you in advance,

Michael

  • Sign in to reply
  • Cancel
  • rg13
    0 rg13 over 2 years ago

    Hi @Mikeyam, Directly using Capture's GUI, there is no automated way to connect thousands of signals from memory to FPGA. If already net connectivity is present for these connection and you want to change signal names, then you can use Import/export properties for nets.

    However, I am looking for feasibility if it is possible through TCL or not. If it is possible, will try to create sample custom script and will share it with you separately. It may take some time.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • avant
    0 avant over 2 years ago

    Maybe you can generate and then import a flat netlist from a spreadsheet..

    Here's the general format: 

    $PACKAGES

    CAP0201 ! 'CAP,4.7UF' ! '4.7UF' ; C29

    $NETS

    CLK_N ; J2.1 U1.3

    $END

    'CAP,4.7UF' is the device file

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rg13
    0 rg13 over 2 years ago

    I have created one TCL script which auto connects nets to all pins of any component including net aliases. 

    TCL script:

    ================= 

    # Tcl script to add wire and netalias to a selected component

    #proc to convert the user value to doc value
    proc ConvertUserToDoc { pPage pUser } {

    set lDocDouble [expr "$pUser/[$pPage GetPhysicalGranularity]"]
    return $lDocDouble
    }


    set lStatus [DboState]
    #Get Selected Object
    set lInst [GetSelectedObjects]
    # set pinCount [$lInst GetPinCount $lStatus]
    #Set counter
    set lcounter 0
    #Get Dbo Page
    set powner [$lInst GetOwner]
    #Set Pin Iteration
    set lIter [$lInst NewPinsIter $lStatus]
    set lNullObj NULL
    #Get the first pin of the part
    set lPin [$lIter NextPin $lStatus]


    while {$lPin !=$lNullObj } {
    #Get XY loaction of pin hotspot
    set XYLocation [$lPin GetOffsetHotSpot $lStatus]
    #Get x loaction of hotspot
    set pinxLocation [DboTclHelper_sGetCPointX $XYLocation]
    #Get y loaction of hotspot
    set pinyLocation [DboTclHelper_sGetCPointY $XYLocation]
    #create a CString
    set number [DboTclHelper_sMakeCString]
    #Get Startpoint of a pin.
    set startPoint [$lPin GetStartPoint $lStatus]
    #Get x value of startPoint
    set Startx [DboTclHelper_sGetCPointX $startPoint]
    # puts [ConvertUserToDoc $powner $pinxLocation]
    #Convert the x and y loaction to doc
    set lx1 [ConvertUserToDoc $powner $pinxLocation]
    set lx2 [ expr { [ConvertUserToDoc $powner $pinxLocation] + 0.3} ]
    set lx3 [ expr { [ConvertUserToDoc $powner $pinxLocation] - 0.3} ]
    # puts [ConvertUserToDoc $powner $pinyLocation]
    set ly1 [ConvertUserToDoc $powner $pinyLocation]
    set ly2 [ConvertUserToDoc $powner $pinyLocation]
    # puts $ly2
    #Get pin number
    $lPin GetPinNumber $number
    #Convert to tcl string
    set pinNumber [DboTclHelper_sGetConstCharPtr $number]
    #Get object type
    set objType [$lPin GetObjectType]
    # set pinvisible [$lPin GetIsNumberVisible $lStatus]
    #Check whether pin is visible(No Global pin)
    set pinvisible [$lPin GetIsVisible $lStatus]

    #Check object type is pin and visibility of pin is 1(not a global power/ground pin)
    if {$objType == 16 && $pinvisible == 1 } {

    if { $Startx == 0} {

    PlaceWire $lx1 $ly1 $lx3 $ly2
    PlaceNetAlias $lx3 $ly1 A$pinNumber
    # set lcounter [incr lcounter]

    } else {

    PlaceWire $lx1 $ly1 $lx2 $ly2
    PlaceNetAlias $lx2 $ly2 A$pinNumber
    # set lcounter [incr lcounter]

    }
    }

    #get the next pin of the part
    set lPin [$lIter NextPin $lStatus]
    }
    delete_DboPartInstPinsIter $lIter

    =============================== 

    Copy above content in one text file and save it with .tcl extension. Now open any Capture design and select any component at which you want to add connections.

    Apply following command in Capture's command window:

    source {<path to TCL>}

    NOTE: If you want to insert net names from any external excel file then you can modify the script accordingly.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • CadAP
    0 CadAP over 2 years ago

    # Tcl script to read the csv file to add wire and netalias to a selected component.

    #I have created a tcl script which read the csv file and add netalias to the respective pin number from the csv file.

    # Create a csv file name test.csv and put pin number in column 1(first column) and netname in column 2(second column). Save the test.csv file at the project location. Copy paste the below tcl code in text file and save it as .tcl. Select the component and source the save tcl file.

    package require csv
    package require struct::matrix


    #proc to convert the user value to doc value
    proc ConvertUserToDoc { pPage pUser } {

    set lDocDouble [expr "$pUser/[$pPage GetPhysicalGranularity]"]
    return $lDocDouble
    }


    proc readCsvFile {PinNumber} {

    struct::matrix::matrix m
    set fd [open "test.csv" r]
    csv::read2matrix $fd m , auto
    close $fd
    set chan [open "test1.csv" w]
    ::csv::writematrix m $chan
    close $chan
    set max_rows [m rows]
    set max_col [m columns]

    for {set i 0} {$i < $max_rows} {incr i} {

    if {[m get cell 0 $i] == $PinNumber} {

    set name [m get cell 1 $i]
    m destroy
    return $name
    # m destroy
    }


    }


    }


    set lStatus [DboState]
    #Get Selected Object
    set lInst [GetSelectedObjects]
    # set pinCount [$lInst GetPinCount $lStatus]
    #Set counter
    set lcounter 0
    #Get Dbo Page
    set powner [$lInst GetOwner]
    #Set Pin Iteration
    set lIter [$lInst NewPinsIter $lStatus]
    set lNullObj NULL
    #Get the first pin of the part
    set lPin [$lIter NextPin $lStatus]


    while {$lPin !=$lNullObj } {
    #Get XY loaction of pin hotspot
    set XYLocation [$lPin GetOffsetHotSpot $lStatus]
    #Get x loaction of hotspot
    set pinxLocation [DboTclHelper_sGetCPointX $XYLocation]
    #Get y loaction of hotspot
    set pinyLocation [DboTclHelper_sGetCPointY $XYLocation]
    #create a CString
    set number [DboTclHelper_sMakeCString]
    #Get Startpoint of a pin.
    set startPoint [$lPin GetStartPoint $lStatus]
    #Get x value of startPoint
    set Startx [DboTclHelper_sGetCPointX $startPoint]
    # puts [ConvertUserToDoc $powner $pinxLocation]
    #Convert the x and y loaction to doc
    set lx1 [ConvertUserToDoc $powner $pinxLocation]
    set lx2 [ expr { [ConvertUserToDoc $powner $pinxLocation] + 0.3} ]
    set lx3 [ expr { [ConvertUserToDoc $powner $pinxLocation] - 0.3} ]
    # puts [ConvertUserToDoc $powner $pinyLocation]
    set ly1 [ConvertUserToDoc $powner $pinyLocation]
    set ly2 [ConvertUserToDoc $powner $pinyLocation]
    # puts $ly2
    #Get pin number
    $lPin GetPinNumber $number
    #Convert to tcl string
    set pinNumber [DboTclHelper_sGetConstCharPtr $number]
    #Get object type
    set objType [$lPin GetObjectType]
    # set pinvisible [$lPin GetIsNumberVisible $lStatus]
    #Check whether pin is visible(No Global pin)
    set pinvisible [$lPin GetIsVisible $lStatus]

    #Check object type is pin and visibility of pin is 1(not a global power/ground pin)
    if {$objType == 16 && $pinvisible == 1 } {

    if { $Startx == 0} {

    set netName [ readCsvFile $pinNumber ]
    # puts $netName
    PlaceWire $lx1 $ly1 $lx3 $ly2
    PlaceNetAlias $lx3 $ly1 "$netName"
    # set lcounter [incr lcounter]

    } else {

    set netName [ readCsvFile $pinNumber ]
    # puts $netName
    PlaceWire $lx1 $ly1 $lx2 $ly2
    PlaceNetAlias $lx2 $ly2 "$netName"
    # set lcounter [incr lcounter]

    }
    }

    #get the next pin of the part
    set lPin [$lIter NextPin $lStatus]
    }
    delete_DboPartInstPinsIter $lIter

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject 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