It looks like you're new here. If you want to get involved, click one of these buttons!
Hi Matthias,
I would like to instantiate the Basic "ROUND_PATH" Pcell with different parameter values by script (Ruby). How do I refer to the (internal) parameter names of the Pcell (in the "PCell parameters" tab they are called "Layer", "Radius" and "Number of points / full circle.")?
Thanks in advance.
Cheers,
Tomas
Comments
Hi Thomas,
here is a little script which you can apply to any PCell to get it's details:
In the case of the ROUND_PATH PCell it will print:
Kind regards,
Matthias
Hi Matthias,
Thank you for the code above. I'm struggling now to set the "path" parameter:
1) param = { "layer" => RBA::LayerInfo::new(4, 0), "radius" => 0.2, "npoints" => 16 }
This works fine but it uses the default path guiding shape ((0,0;0.2,0;0.2,0.2) w=0.1).
2) I don't get how to set the "path" parameter, I tried:
path_points = [Point.new(0,0), Point.new(20000,0), Point.new(20000,20000)]
path_width = 2000
path = Path.new(path_points, path_width)
param = { "layer" => RBA::LayerInfo::new(4, 0), "radius" => 5.0, "npoints" => 16, "path" => path}
The guiding shape is drawn as intended ((0,0;20.0,0;20.0,20.0) w=2.0), but no rounded path is generated on layer 4/0.
Cheers,
Tomas
PS: Is it possible to do the "Edit > Selection > Convert to Pcell" command by scripting?
Hi Thomas,
Well ... there is a pitfall.
Please you a DPath object with Micrometer values instead. So that would be
(small disclaimer: not tested). The idea of parameters is that they are independent from the layout details - specifically the DBU. Hence: LayerInfo instead of layer index, radius in micrometers instead of DBU and path in micrometer units instead of DBU. This applies to all shape types (DPolygon, DBox).
You see from the Default path that it's a µm version: "Default: (0,0;0.2,0;0.2,0.2) w=0.1 bx=0 ex=0 r=false".
I wasn't aware that the guiding shape is still drawn properly ...
Kind regards,
Matthias
P.S. "convert to PCell" is partially covered by PCellDeclaration#parameters_from_shape. But still you have to delete the shape and insert the PCell instance yourself.
Hi Matthias,
Thanks for the info! Works like a charm now. :-)
Would you advise to update "old" (but still working) code (for instance made before DCellInstArray was introduced)?
Kind regards,
Tomas
Hi Tomas,
You mean to keep the integer-unit objects such as Box, CellInstArray when working with the database API?
I'll keep the integer-unit objects forever, so you don't have to update :-)
Seriously, the integer-unit objects are somewhat more stable as no floating-point rounding issues are involved. So it makes sense to keep them.
Kind regards,
Matthias