PCellDeclarationHelper debugging

Hi Matthias,

I am wondering if it is possible to programatically retrieve the error message that a PCell generates?

For example, I put in a statement inside produce_impl(self):

print(1/0)

and on the screen I get the error message:

But unless I have the debugger on, the error doesn't cause an Exception. I see you have in PCellDeclarationHelper in produce(), a try: self.produce_impl(), which prevents the Exception. How does your GUI catch the text?

Would it be possible to have a method that checks for PCell errors and gets the output error?

pcell = new_layout.create_cell(mm, all_params)
if pcell.error:
  print(pcell.errortext)

Thank you
Lukas

Comments

  • Hi Lukas,

    the "try" block does not catch the exception - it only inserts a "finally" block. The exception is forwarded to the system which places a text on the error layer.

    Basically the error layer is a valid layer inside the layout, but it is a hidden one. Once you know the layer index, you could read out the shapes and get the error message. Unfortunately as of now there is no API for getting the index of that layer, but it will be easy to add.

    Matthias

  • edited November 17

    Thank you.

    Similarly, I woud love to be able to configure the properties of the GUIDING_SHAPE layer, which also seems hidden.

         print(ly.layer('GUIDING_SHAPE'))  
    

    returns a blank

  • Hi Lukas,

    The guiding shape layer can be obtained through:

    ly.guiding_shape_layer()
    

    This is not a new feature. It has been there already.

    Error and guiding shape layers are hidden layers so they are clearly marked as not to be delivered when writing layouts. Hence there is no name by which they can be accessed.

    Matthias

Sign In or Register to comment.