• 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. Assigning Pcell parameters by reading vales from file

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 144
  • Views 14142
  • 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

Assigning Pcell parameters by reading vales from file

frasheed
frasheed over 10 years ago

Hello,

I wrote short code to read a file(CSV) and then I am storing the vlaues in a respecive variable.

Example:

CSV FILE:

w   1.1

l 0.9

grid 0.35

My code:

while( str = lineread(file)
case( car(str)


(w

  if(cdr(str)

  then

  w = cadr(str)
  else error("w not defined in %s file" file)
  ); end if

);w

(l

  if(cdr(str)

  then

  l = cadr(str)
  else error("l not defined in %s file" file)
  ); end if

);l

and then I will use these values to define the parameters in pcell with same variable 

;;FORMAL PARAMETERS

(

(w float w) ;; This is wrong, I want to skip this 

(l float w)

)

As the above method is not correct but I have already stored the value in "w" and "l" so how Can I define my formal parameters with the values that I have read from file ?

will this work:

(

(w)

(l)

)

or is there any way I create a database and directly create the object in database variable and store values like

 if(cdr(str)

  then

  myObj~>w = cadr(str)

and then while defining pCell parameters I can write

(

(w float myObj~>w)

(l float myObj~>l)

)

Which method is suitable can anyone guide me ?

Thanks and sorry for the bad explanation.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    It's not that obvious to me what you are trying to achieve here. Are you trying to define the default values of pcell parameters for pcells you are creating from a CSV file? Or are you trying to set parameters on an instance of a pcell to be based on the values read from a file?

    Perhaps if you clarified your overall objective, it would be easier to understand what you're trying to do...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • frasheed
    frasheed over 10 years ago

    Hello Andrew, In Pcell we define formal parameters like

    (

    (w float 0.9)

    (s int 10)

    (n int 1)

    )

    I want to set parameters values based on values read from file.

    What I am doing now is using ddId = ddGetObj(lib)

    ans susing case for every propertyvariable to read value from file

    setSGq(ddId cadr(str) w)

    and then setting papmeters fpr pcell

    (

    (w float ddId~>w)

    (l int ddId~>l)

    )

    Is this method ok or is there any better way to do that ??


    .

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    This should work fine (in IC61X at least; in IC5141 if I remember rightly, you couldn't have the default value being an expression when using pcDefinePCell - you had to use eval() to get around this).

    Similarly you could read the data from a CSV file into some data structure, and then reference the default values that way.

    Be aware though that the default values are only consumed at the time the pcell is created - this is because the default value is stored in the pcell cellView itself.

    You should also be very wary if you have CDF as well - having a CDF default different from a pcell default can lead to strange and confusing issues. Well, they're strange and confusing if you don't understand that normally CDF parameters don't store a property on an instance when the value is the same as the CDF default, and if there is no property on the instance, a pcell will use the pcell parameter default. So a discrepancy in the CDF default and pcell parameter default would lead to the edit properties form showing the CDF default, but the pcell actually using the pcell parameter default - and so what you see is not necessarily what you get.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • theopaone
    theopaone over 10 years ago

    In 5141 you could use an expression in the pcell parameter declaration.

    I would probably not store the defaults on the library (shared by all the cells) but either on the cell or if the cell has a CDF, on that.

    To get the default value, you first have to get the CDF ID before you define your pcell.

    cdfId = cdfGetBaseCellCDF( ddGetObj( "libName" "cellName" ) )

    pcDefinePCell( list(ddGetObj("libName") "cellName" "layout" "maskLayout" )

      ( ( w cdfId->w->defValue )

         ( l cdfId->l->defValue ) ...

         ...

      )

    ;; Body of pcell

    )

    Of course, substitute the library and cell names as appropriate.

    Ted

    • 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