• 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. Reading a parametrized cdf parameter

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 17872
  • 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

Reading a parametrized cdf parameter

kglaros
kglaros over 12 years ago

Hi, 

I am trying to read the CDF parameters of a FET.

My problem is that some of them refer to other CDF parameters via iPar().

So if I do: p1=cdfGetInstCDF(inst)~>parameters

v1=car(parameters)~>value 

Then I get v1="iPar("\width\")", instead of the numerical value.

This is fair enough and expected, but I was wondering if there is an easy way to get the evaluated value of the parameter returned rather than the string?

I could write a function to do this iterating through the parameters, but I am currently extracting the values of several parameters via lists (setof) and so if there is a built-in function to do this it would be more convenient. 

 

Thanks for the help.

Kostas 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    This code will do what you want. Ifyou know the instance ID, and the parameter name (e.g. it is called "dc" or whatever) do: abIPar("dc" car(geGetSelSet()))

    Regards,

    Andrew.

     

    /* abIPar.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Aug 28, 2003 
    Modified   
    By         
    
    Function that can be used in an opParamExprList()
    CDF setup to get an instance's parameter value.
    
    Note, this is not the _simulated_ value necessarily...
    
    ***************************************************
    
    SCCS Info: @(#) abIPar.il 07/01/08.21:14:26 1.3
    
    */
    
    (procedure (abIPar paramName @optional (inst ilInst) (slot 'value))
      (let (env lineage session cdf unevaluated evaluated compiled top)
           (setq top (geGetTopLevelCellView))
           (getWarn)
           (unless top (error "Can't find parameter %s" paramName))
           ;-----------------------------------------------------------------
           ; Get the original parameter value
           ;-----------------------------------------------------------------
           (setq cdf (cdfGetInstCDF inst))
           (setq unevaluated (get (get cdf (concat paramName)) slot))
           ;-----------------------------------------------------------------
           ; If it is a string, evaluate it as an AEL expression
           ;-----------------------------------------------------------------
           (if (stringp unevaluated) 
               (progn
                (setq env (aelEnvCreate "f"))
                ;-----------------------------------------------------------
                ; set the path down to this element
                ;-----------------------------------------------------------
                (setq lineage (append1 (reverse 
                                        (mapcar 'car (geGetHierMemInst))) 
                                       top))
                (setq lineage (cons inst lineage))
                (aelSetLineage env lineage)
                ;-----------------------------------------------------------------
                ; Get the current session
                ;-----------------------------------------------------------------
                (setq session (asiGetSession (hiGetCurrentWindow)))
                ;-----------------------------------------------------------------
                ; define all the global variables
                ;-----------------------------------------------------------------
                (foreach designVar 
                         (or (and session (asiGetDesignVarList session))
                             (artGetCellViewDesignVarList top))
                         (aelEnvSetGlobals env (car designVar) (cadr designVar))
                         )
                ;-----------------------------------------------------------------
                ; Evaluate the expression
                ;-----------------------------------------------------------------
                (if (or (null unevaluated)
                        (equal unevaluated "")) 
                    (setq evaluated 0.0)
                    (progn
                     (setq compiled (aelEnvCompile env unevaluated))
                     (if compiled
                         (setq evaluated (aelNumber (aelEnvExecute compiled)))
                         (progn
                          (printf "*ERROR* %s " (aelEnvGetErrStr))
                          (setq evaluated nil)))
                     ))
                evaluated
                )
               ;-------------------------------------------------------------
               ; Otherwise, if not a string, return it as it is
               ;-------------------------------------------------------------
               unevaluated
               )
           )
      )
    
    

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 12 years ago

    This code will do what you want. Ifyou know the instance ID, and the parameter name (e.g. it is called "dc" or whatever) do: abIPar("dc" car(geGetSelSet()))

    Regards,

    Andrew.

     

    /* abIPar.il
    
    Author     A.D.Beckett
    Group      Custom IC (UK), Cadence Design Systems Ltd.
    Language   SKILL
    Date       Aug 28, 2003 
    Modified   
    By         
    
    Function that can be used in an opParamExprList()
    CDF setup to get an instance's parameter value.
    
    Note, this is not the _simulated_ value necessarily...
    
    ***************************************************
    
    SCCS Info: @(#) abIPar.il 07/01/08.21:14:26 1.3
    
    */
    
    (procedure (abIPar paramName @optional (inst ilInst) (slot 'value))
      (let (env lineage session cdf unevaluated evaluated compiled top)
           (setq top (geGetTopLevelCellView))
           (getWarn)
           (unless top (error "Can't find parameter %s" paramName))
           ;-----------------------------------------------------------------
           ; Get the original parameter value
           ;-----------------------------------------------------------------
           (setq cdf (cdfGetInstCDF inst))
           (setq unevaluated (get (get cdf (concat paramName)) slot))
           ;-----------------------------------------------------------------
           ; If it is a string, evaluate it as an AEL expression
           ;-----------------------------------------------------------------
           (if (stringp unevaluated) 
               (progn
                (setq env (aelEnvCreate "f"))
                ;-----------------------------------------------------------
                ; set the path down to this element
                ;-----------------------------------------------------------
                (setq lineage (append1 (reverse 
                                        (mapcar 'car (geGetHierMemInst))) 
                                       top))
                (setq lineage (cons inst lineage))
                (aelSetLineage env lineage)
                ;-----------------------------------------------------------------
                ; Get the current session
                ;-----------------------------------------------------------------
                (setq session (asiGetSession (hiGetCurrentWindow)))
                ;-----------------------------------------------------------------
                ; define all the global variables
                ;-----------------------------------------------------------------
                (foreach designVar 
                         (or (and session (asiGetDesignVarList session))
                             (artGetCellViewDesignVarList top))
                         (aelEnvSetGlobals env (car designVar) (cadr designVar))
                         )
                ;-----------------------------------------------------------------
                ; Evaluate the expression
                ;-----------------------------------------------------------------
                (if (or (null unevaluated)
                        (equal unevaluated "")) 
                    (setq evaluated 0.0)
                    (progn
                     (setq compiled (aelEnvCompile env unevaluated))
                     (if compiled
                         (setq evaluated (aelNumber (aelEnvExecute compiled)))
                         (progn
                          (printf "*ERROR* %s " (aelEnvGetErrStr))
                          (setq evaluated nil)))
                     ))
                evaluated
                )
               ;-------------------------------------------------------------
               ; Otherwise, if not a string, return it as it is
               ;-------------------------------------------------------------
               unevaluated
               )
           )
      )
    
    

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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