Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Extract information from oasis file

Hello,

I need to extract these parameters from all cells present on oasis file:

bbox , x placement coordinate , y placement coordinate

Is possible run automatically a script directly on oasis file to do it?

Many thanks in advance and regards

Luciano

Comments

  • Hi Luciano,

    yes that's possible. Are all the cells on a single level of hierarchy (i.e. below the top cell)? And you don't need the orientation?

    Matthias

  • Hi Matthias,
    All cells are divided in a double level of hierarchy below the top cell.
    The orientation should be needed in the future but if It's possible extract also this data thanks to give me also the instruction for this one.

    Thanks

    Luciano

  • Hi Matthias,
    can You give me the code to extract the datas?
    Thanks

    Luciano

  • edited January 16

    Hi Luciano,

    please don't let me guess. There are too many variants of hierarchy, so there isn't a single answer. "Double layer of hierarchy" means there is a cell in between top cell and the one you're interested in? So you want the coordinates of all leaf cells? Paste a sketch, a screenshot, an example, code you've tried already, anything. Your description is too fuzzy to give an answer quickly.

    Matthias

  • edited January 16

    And for now, here is something new:

    ly = RBA::CellView::active.layout
    # for batch mode save this text to "this_script.rb" and use
    #  ly = RBA::Layout::new
    #  ly.read($input) 
    # and use "klayout -b -rd input=yourfile.oas ... -r this_script.rb" to set $input
    
    RBA::LayoutQuery::new("select cell.name, path_trans * cell.bbox, path_trans.disp.x, path_trans.disp.y from instances of ...*").each(ly) do |q|
      puts q.data.collect { |d| d.to_s }.join("\t")
    end
    

    This approach uses the LayoutQuery feature. It's the basis of the "search & replace" feature. The classic approach was to iterate the cells and indexes and dive down into the hierarchy recursively. The query does this for you.

    Matthias

  • edited March 15

    Hi Matthias, into our files We have a hierarchy like the one into the image.
    We need extract informations
    bbox , rotation , x placement coordinate , y placement coordinate
    for ALL structures placed under the CELL named "UXYZAB (Active IC)"

    Let me know if it's possible do it automatically on batch mode.

    Luciano

  • Hi Matthias, into our files We have a hierarchy like the one into the image.
    We need extract informations
    bbox , rotation , x placement coordinate , y placement coordinate
    for ALL structures placed under the CELL named "UXYZAB (Active IC)"

    Let me know if it's possible do it automatically on batch mode.

    Luciano

  • Hi Luciano,

    have you tried the script above?

    Matthias

  • edited March 19

    .

  • Hi Matthias,

    sorry, but it's not clear for me how modify your script to use it on batch mode.

    Luciano

  • The comment of the script explains how.

    Matthias

  • edited March 21

    I have modified the script on this way

    ===============================

    ly = RBA::CellView::active.layout

    for batch mode save this text to "this_script.rb" and use

    ly = RBA::Layout::new

    ly.read($input)

    and use "klayout -b -rd input=yourfile.oas ... -r this_script.rb" to set $input

    ly = RBA::Layout::new
    ly.read($input)

    RBA::LayoutQuery::new("select cell.name, path_trans * cell.bbox, path_trans.disp.x, path_trans.disp.y from instances of ...*").each(ly) do |q|
    puts q.data.collect { |d| d.to_s }.join("\t")
    end

    =================

    and run it using the command

    klayout -b -rd input=yourfile.oas -r the_script.rb

    I received this error message

    ***** ERROR: NameError: uninitialized constant RBA::LayoutQuery**

    thanks

    Luciano

  • Sorry Mathias.

    I have read the documentation.
    The problem was the version of klayout I used. The correct one in 0.25.

    I have inserted also the rotation

    path_trans.angle

    Now the script works correctly

    Thanks again

    Luciano
    
  • Hi Matthias,

    We have very big oasis file and the script run few hour before extract all the informations.
    It's possible modify the script in order to extract the datas only in a dedicated cell?

    Many thanks again

    Luciano

  • Hello,
    I wrote a script that should meet your need. You can study it and use it for your purpose.
    See: https://www.klayout.de/forum/discussion/992/accumulated-postion-of-an-instance
    Olivier

Sign In or Register to comment.