• 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 14152
  • 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
Parents
  • 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
Reply
  • 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
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