Can anyone please help in writing a code to create pcell.I would like to have these as the pcell parameters:3-4 rectangles(layers),width,length and type..Each rectangle should use different layer like layer1 ACTIVE,layer2 POLY etc...I want the layers to be created based on parameter "type".
Based on this parameter it should create these rectangles..eg: if type is case("Width")- it should create single layer like layer1.if case is "overlap" it should create 2 layers say layer1 and layer2.
Can anyone please help me out..
The interface to a pcell is through its parameters. The pcell is drawn based on the data input through those parameters. The code you write for the pcell reads the values of the parameters and then creates the pcell contents.
You have to first create a set of requirements for the pcell. What should it do and how should it be controlled? What are the inputs to the pcell and what are the results for each input? You want to have as complete requirements as you can before you start.
Once you have captured the requirements, you can map them to the pcell parameters. Be aware that the parameters for a pcell are fixed when the pcell is compiled, you cannot add parameters on the fly, you can only change the values. For your application, you may want to pass in data structures describing the rectangles to be built based on the type parameter or you can build the layers and default widths and lengths into the pcell itself.
I often structure the code so that the data creation function can be executed in any cellView for easier testing. I pass in the cellView ID (the variable pcCellView during the execution of a pcell) . The previous post is an example of that methodology.This is a good starting point for you.