Can assign top cell as a circuit by ruby script?

edited October 2024 in Ruby Scripting

Hello Matthias

Is it possible to assign top cell as a circuit by ruby script, if I want to use those powerful feature in circuit class?
NetTrace class works well, but It's a pity that useful functions didn't come in handy, in package level.

I guess I can also set subcircuits in the layout if it become complex.

thanks
Vincent

Comments

  • I sorry, I think I need a little more explanation.

    What exactly are you trying to do?

    NetTrace is somewhat obsolete now. There is LayoutToNetlist which can turn all nets of a cell into a circuit including subcells. That is embedded into the DRC/LVS engine, so you can code layout to netlist tracers with a few lines of code. See for example here: https://www.klayout.de/forum/discussion/comment/11351.

    Matthias

  • Hello Matthias,

    I am sorry, it seems not that easy as I thought if the circuit/device class just be embedded into
    DRC & LVS engine. That's why I can not find out the relationship and build it by just Ruby script.

    NetTrace is a handy way, if someone want to do extra action after the mismatch was detected.
    for example, there is one net in the layout, and somehow the via is missing, then no element
    belongs to via layer will be found in that net, and via can be re-arrayed as below code

    tech = NetTracerConnectivity.new
    tech.connection("1/0", "2/0","3/0")
    
    tracer = NetTracer.new
    tracer.trace(tech, layout, cell , point , layer)
    for element in tracer.each_element
      if element.layer == via_layer
        area = element.shape.area
      end
      if area == 0 # area = 0 means via is missing
        cell.shapes(via_layer).insert(box) #  insert the box as a via you want to renovate the net 
      end
    end
    

    By NetTrace, you can do something intuitional if the situation you set happen
    thanks for your reply that circuit/device class features belong to DRC & LVS engine
    I can stop trying now... DRC & LVS engine are powerful, but I am still an amateur. :*

    thanks
    Vincent

Sign In or Register to comment.