It looks like you're new here. If you want to get involved, click one of these buttons!
Hello, I have a question regarding the TilingProcessor and expressions.
I have the following (shortened) setup:
tp = RBA::TilingProcessor::new
tp.frame = chip
tp.dbu = ly.dbu
tp.threads = threads
tp.tile_size(tile_size, tile_size)
tp.input("COMP", ly, top_cell.cell_index, COMP)
tp.input("Poly2", ly, top_cell.cell_index, Poly2)
tp.input("PMNDMY", ly, top_cell.cell_index, PMNDMY)
tp.var("space_to_COMP", 3.5 / ly.dbu)
tp.var("space_to_Poly2", 1.5 / ly.dbu)
tp.output("to_fill", TilingOperator::new(ly, top_cell, fill_cell.cell_index, fc_box_in_dbu, row_step_in_dbu, column_step_in_dbu, fc_origin_in_dbu))
tp.queue("
var COMP_20um_spacing = COMP.sized(20um).sized(-20um)
var fill_region = _tile & _frame - COMP_20um_spacing.sized(space_to_COMP) - Poly2.sized(space_to_Poly2) - PMNDMY;
_output(to_fill, fill_region)")
I get the following error:
ERROR: Worker thread: Length or area value with unit requires a layout context at line 3, position 36 (..20um).sized(-20um)
Which makes a lot of sense, however since the tiling processor has information about the dbu, shouldn't it be possible to convert the length value?
Or is there another way to supply the layout context?
As a workaround I can supply the constant as a variable like I did for the spacing:
tp.var("um20", 20 / ly.dbu)
Let me know if you need a full reproducible.
Thanks!
Comments
Hi Leo,
You're correct, the layout context is not there and it's not just the DBU, with a layout context for example you can obtain layer indexes using angle brackets (e.g. "<2/0>" turns into the layer index). Bottom line is: a "layout context" is really a layout and although the tiling process gets the DBU, the layout is a not readily accessible.
My recommendation was to turn the "20 µm" value into a variable like you suggested. I feel it's a good practice to define every physical value somewhere globally, so I would write:
(this is how I understand the intention of the code).
BTW: in case you're trying filling, have you seen this: https://www.klayout.de/forum/discussion/2620/fill-multiorigin-and-manufacturing-grid#latest ?
(and please use static origin, I am not happy with the auto_origin or multi_origin feature. Needs work
)
Best regards,
Matthias