How to Make a instance in DRC script?

as the below DRC script , I can create a cell "Map"
can we do more script to make some cell instance into this cell?
such as
out_cell.insert(RBA::DCellInstArray::new(subcell_index, RBA::DTrans::new(locationx , locationy)))

layout = RBA::Application::instance.main_window.current_view.active_cellview.layout
top = layout.create_cell("Map")
l1 = layout.layer(1, 0)
dbu = layout.dbu.round(4)
map = 150000.00
polygon = 2000
ebrsize= map - 3000.00

mapsize = map / dbu
mapcenter = mapsize / 2.00
top.shapes(l1).insert(RBA::Box::new( -mapcenter , -mapcenter , mapcenter  , mapcenter ))

Comments

  • edited July 6

    This isn't a DRC script - it's a plain API script. Run that as "Ruby Macro".

    And yes, within such a script, you can generate cells and instances.

    Matthias

  • Hi Matthias,
    how to do DRC in Ruby scribe?
    here is my sample code ,
    but I can't do that in Ruby scribe ..
    in fact , I want to using DRC function to get some pattern location / then do some caculate and make instance base on the result.
    but look like that is not-work in Ruby (that is workable in DRC , but didn't work in Ruby...)

    ################################################
    include RBA
    main_window = RBA::Application::instance.main_window
    layout = RBA::CellView::active.layout
    layout_view = main_window.current_view
    layout = layout_view.active_cellview.layout
    layer = layout.layer(86, 0) 
    layer.each do |X| 
    ubmX1=X.bbox.p1.x
    ubmY1=X.bbox.p1.y
    puts "I am get answer #{ubmX1} and #{ubmY1}"
    end
    
  • Hi @jiunnweiyeh,

    here is some sample code how to do cell placement in DRC. It places a cell called "PLACEME" over all locations where layer 45/0 overlaps with layer 37/0:

    placeme = source.layout.cell("PLACEME")
    
    layer1 = input(45, 0)
    layer2 = input(37, 0)
    
    (layer1 & layer2).data.each do |poly|
    
      pos = poly.bbox.center
    
      source.cell_obj.insert(RBA::CellInstArray::new(placeme.cell_index, RBA::Trans::new(pos)))
    
    end
    

    You should place the cell instance generation at the end of the script - I'm not sure how the new cells will interact with input taken after placing them.

    Matthias

  • Hi Matthias,
    Thanks for your code , I will check it .

Sign In or Register to comment.