• 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. Custom IC SKILL
  3. Implementing flow control in rodCreatePath function

Stats

  • Locked Locked
  • Replies 12
  • Subscribers 145
  • Views 20186
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Implementing flow control in rodCreatePath function

infy
infy over 16 years ago

Hi,

Can we Implement flow control structures like if,while in rodCreatepath function to control the number of offset subpaths.

Regards,

Roy

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 16 years ago

    Roy,

    You didn't give the stack trace output, but it's fairly obvious from looking at the code that the function:

    procedure(CCSmetBusCB(cv width  layer points  "dfll")

    is expecting the 3rd argument to a layer purpose pair. The code as you sent it does not give an error - so I assume this was because you were calling this function:

            CCSmetBusCB(
              win->cellView
              form->width->value
    ;          form->number->value
              CCSgetLPPfromLayerCyclic(form->layer->value)
              points
            )

    with the number argument not commented?

    Clearly you would have to pass number into the CCSmetBusCB function, and update the argument list appropriately. I also think that it makes more sense for the number field to be an integer rather than float field (since you can't draw 2.5 bus wires!).

    Overall I've changed the code below:

    procedure(CCSmetBus()
      let( (form)
     if(boundp('CCSmetBusForm) && CCSmetBusForm then
          form = CCSmetBusForm
        else
          form = CCScreateMetBusForm()
        ); if
        when(hiIsForm(form)
          enterPath(
            ?prompts        list("Enter points for Metal Bus path")
            ?form           form
            ?points         nil
            ?doneProc       "CCSmetBusDoneProc"
            ?addPointProc   "CCSmetBusPoints"
            ?delPointProc   "CCSmetBusPoints"
            ?pathWidth      form->width->value
           ;?acceptString  form->number->value
            ?alwaysMap      t
            ?cmdName        "CCSmetBus"
          ); enterPath
        ); when the form exists
      ); let
    ); procedure CCSmetBus
    
    procedure(CCScreateMetBusForm()
      let( (width number layer snap snapModes form cv techId)
        if(cv = geGetEditCellView(hiGetCurrentWindow()) then
          if(techId = techGetTechFile(cv) then
     width = hiCreateFloatField(
              ?name 'width
              ?prompt "Width"
              ?value 1.0
              ?range list(0.3 2.0)
              ?callback "CCSchangeMetBusWidth()"
              ); hiCreateFloatField
    ;; ADB changed to integer field
     number = hiCreateIntField(
                ?name 'number
                ?prompt "Number"
                ?value 1
                ?range list(1 100)
    ;; ADB - I don't think this is really needed, as it doesn't affect
    ;; anything. It's not like the width, where you want the ghost image of
    ;; the path to change.
                ?callback "CCSchangeMetBusNumber()"
                ); hiCreateFloatField
    snapModes = list("orthogonal" "L90XFirst" "L90YFirst")
            snap = hiCreateCyclicField(
              ?name 'snap
              ?choices      snapModes
              ?prompt       "Snap mode"
              ?value        car(member(envGetVal("layout" "snapMode")
                              snapModes)) || "orthogonal"
              ?callback     "CCSchangeMetBusSnap()"
            ); hiCreateCyclicField
    layer = hiCreateLayerCyclicField(
              techId
              "Layer"
              ""
              leGetValidLayerList(techId) || list(leGetEntryLayer(techId))
              leGetEntryLayer(techId)
              'layer
            ); hiCreateLayerCyclicField
     form = hiCreateAppForm(
              ?name 'CCSmetBusForm
              ?formTitle "Metal Bus"
              ?formType     'options
              ?buttonLayout 'HideCancelDef
              ?fields list( list(width 0:0 100:30 50)
                list(snap 120:0 100:30 70)
                list(number 0:30 200:30 50)
               list(layer 0:90 200:30 50))
            ); hiCreateAppForm
     leSetFormSnapMode(form->snap->value)
            CCSshieldMetalForm = form
          else
            error("Could not obtain technology information")
          ); if the technology information can be obtained
        else
          error("Shield metal functions require a cellview to be current")
        ); if a current cellview exists
      ); let
    ); procedure CCScreateMetBusForm
    
    procedure(CCSchangeMetBusWidth()
      let( (origWidth)
        when(boundp('CCSmetBusForm) && CCSmetBusForm
          origWidth = CCSmetBusForm->width->value
          CCSmetBusForm->width->value = origWidth
          unless(CCSmetBusForm->currentWidth == CCSmetBusForm->width->value
            CCSmetBusForm->currentWidth = CCSmetBusForm->width->value
          ); unless
          changeEnterFun(
            'enterPath
            ?pathWidth      CCSmetBusForm->width->value
            ;?acceptString     CCSmetBusForm->number->value
            ?doneProc       "CCSmetBusDoneProc"
            ?points         CCSmetBusForm->points
            ?addPointProc   "CCSmetBusPoints"
            ?delPointProc   "CCSmetBusPoints"
            ?prompts        list("Enter points for Metal Bus path")
            ?form           CCSmetBusForm
          ); changeEnterFun
        ); when the form exists
      ); let
    ); procedure CCSchangeMetBusWidth
    
    procedure(CCSchangeMetBusNumber()
      let( (defaultNumber)
        when(boundp('CCSmetBusForm) && CCSmetBusForm
          defaultNumber= CCSmetBusForm->number->value
          CCSmetBusForm->number->value = defaultNumber
          unless(CCSmetBusForm->currentNumber == CCSmetBusForm->number->value
            CCSmetBusForm->currentNumber = CCSmetBusForm->number->value
          ); unless
          changeEnterFun(
            'enterPath
            ?pathWidth      CCSmetBusForm->width->value
            ;?acceptString     CCSmetBusForm->number->value
            ?doneProc       "CCSmetBusDoneProc"
            ?points         CCSmetBusForm->points
            ?addPointProc   "CCSmetBusPoints"
            ?delPointProc   "CCSmetBusPoints"
            ?prompts        list("Enter points for Metal Bus path")
            ?form           CCSmetBusForm
          ); changeEnterFun
        ); when the form exists
      ); let
    ); procedure CCSchangeMetBusNumber
    
    procedure(CCSchangeMetBusSnap()
      when(boundp('CCSmetBusForm) && CCSmetBusForm
        CCSmetBusForm->origSnap =
          leSetFormSnapMode(CCSmetBusForm->snap->value)
      ); when the form exists
    ); procedure CCSchangeMetBusSnap
    
    procedure(CCSmetBusPoints(win points "wl")
      when(windowp(win)
        ;; keep track of the points for when the enterFunction is changed
        CCSmetBusForm->points = points
      )
    ); procedure CCSmetBusPoints
    
    procedure(CCSmetBusDoneProc(win done points "wgl")
      let( ( form )
        when(boundp('CCSmetBusForm) && CCSmetBusForm
          form   = CCSmetBusForm
          if(done then
            ;; reset the currentWidth variable stored on the form
            ;; and reset the points list stored on the form
            form->currentWidth = nil
            form->currentNumber = nil
            form->points = nil
            CCSmetBusCB(
              win->cellView
              form->width->value
    ;; ADB - removed comment so that number is now passed
              form->number->value
              CCSgetLPPfromLayerCyclic(form->layer->value)
              points
            )
          else
            ;; put back the most recent previous snap mode
            when(CCSmetBusForm->origSnap
              leSetFormSnapMode(CCSmetBusForm->origSnap)
            ); when
          ); if done
        ); when form exists
      ); let
    ); procedure CCSmetBusDoneProc
    
    ;; ADB - Added number as a formal argument (x in type template)
    procedure(CCSmetBusCB(cv width number layer points  "dfxll")
    ;; ADB - some local variables here wouldn't go amiss! Try running through
    ;; SKILL Lint to see what it says
    if( (width >=  techGetSpacingRule(techGetTechFile(cv) "minWidth" layer)) then
    layerWidth = width
    );if
    layerSpace = techGetSpacingRule(techGetTechFile(cv) "minSpacing" layer)
    let((a b n)
    b = list()
    a = list()
    
    ;; ADB - removed hard coding of number
    ; number = 10
    
    n = number
    for(i 0 n-2
    a= list(
                                ?layer      layer
                                ?justification "left"
                                ?width layerWidth
                                ?sep  ( layerSpace * (i+1)) + ( layerWidth * i)
                                ?choppable  t
                               )
    b = cons(a b)
    );for
    b = reverse(b)
    rodCreatePath(
          ?cvId             cv
          ?layer            layer
          ?width            layerWidth
          ?pts              points
          ?justification "center"
          ?choppable  t
          ?offsetSubPath    b
       ); rodCreatePath
      );let
    ); procedure CCSmetBusCB
    
    procedure(CCSgetLPPfromLayerCyclic(layCyc "l")
      parseString(
        buildString(
          parseString(cadddr(layCyc) "()")
          ""
        )
      )
    ); procedure CCSgetLPPfromLayerCyclic
    
    

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Infy1
    Infy1 over 16 years ago

     hi,

    Thanks Andrew.It's working !!!!

    Regards,

    Roy

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
<

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