It looks like you're new here. If you want to get involved, click one of these buttons!
Hi sir,
This is my code , the working cell is "DIE_UBM"
As this code , I can get the information of first level instance .
How can I get more instance information of second level(UBM_0 in this case) or thrid level ?
celllayoutView = RBA::Application::instance.main_window.current_view.active_cellview.cell
data_base= (1 / dbu ).round(0)
x1=500*data_base
x2=-500*data_base
y1=500*data_base
y2=-500*data_base
iter = celllayoutView.each_overlapping_inst(RBA::Box::new(x1, y1, x2, y2))
count=0
iter.each do |inst|
locationx= (inst.cell_inst.trans.disp.x / data_base).round(3)
locationy= (inst.cell_inst.trans.disp.y / data_base).round(3)
puts "the instance cell is #{inst.cell.name} , location is :#{locationx} and #{locationy}"
count+=1
end
puts "final counts : #{count}"
another question is , how to using overlapping shape ? in this code,
I can't get the each shape in the area BBox I maked.
I knew the document shown that...
(1) Signature: [const,iter] Shape each_overlapping_shape (unsigned int layer_index, const Box box, unsigned int flags)
Description: Iterates over all shapes of a given layer that overlap the given box
flags:
An "or"-ed combination of the S.. constants of the Shapes class
box:
The box by which to query the shapes
layer_index:
The layer on which to run the query
But , the question is ...what is "Flags"? do you have an example for the full command ?
ubm_index=0
layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
layoutView.layer_indexes.each do |layer_index|
layer_info = layoutView.get_info(layer_index)
if layer_info.to_s.match("94/0") then
puts "The #{layer_index} mapping to #{layer_info}"
ubm_index=layer_info
end
end
celllayoutView = RBA::Application::instance.main_window.current_view.active_cellview.cell
data_base= (1 / dbu ).round(0)
x1=500*data_base
x2=-500*data_base
y1=500*data_base
y2=-500*data_base
iter = celllayoutView.each_overlapping_shape(ubm_index,RBA::Box::new(x1, y1, x2, y2))
count=0
iter.each do |inst|
count+=1
end
puts "final counts : #{count}"
Comments
Hi jiunnweiyeh
To get information for Inst in deeper hierarchy, you might need to use
begin_instances_rec_overlapping
instead ofeach_overlapping_inst
, following example should able to provide the info you need.Similar for shapes, if you like to list out all shapes use
begin_shapes_rec_overlapping
instead ofeach_overlapping_shapes
.Hi @RawrRanger
in this code , can I choose how deep for the instance level ?
that like this ...
in the below , I can choose how deep cell I can get ...start from 0 to level 10.
dbTraverse -cv $OpenCV -layer $cmp_layName -purpose $cmp_purName -startLevel 0 -stopLevel 10
Hi jiunnweiyeh
cell.begin_instances_rec_overlapping
returns aRecursiveInstanceIterator
which contains it's hier info from your current view cell to the end.
Following example provides the hier depth infor counting from
current view cell
, please notice this is a reletive depth level instead of a actual hier level if you are not viewed from a top cell.iter.path
returns a list of instElements[<InstElement xxx>, <InstElement xxx>, <InstElement xxx>]
, the length of the list is it's reletive level from view cell.