Hi,
Is there a way to use constant parameters and arithmetic in macro.cfg?
Such as
base_x = 500
base_y = 400
my_unit_1 base_x base_y
my_unit_2 base_x+100 base_y+100
Regards,
Burak Aykenar
09/19/2023, 8:37 AM
And I never seen any comment in macro.cfg file, is there any documentation regarding to macro.cfg telling it's syntax etc. ?
m
Mitch Bailey
09/19/2023, 11:22 AM
I think this is the code from
scripts/odbpy/manual_macro_place.py
Copy code
def manual_macro_place(reader, config, fixed):
"""
Places macros in positions and orientations specified by a config file
"""
db_units_per_micron = reader.block.getDbUnitsPerMicron()
# read config
macros = {}
with open(config, "r") as config_file:
for line in config_file:
# Discard comments and empty lines
line = line.split("#")[0].strip()
if not line:
continue
line = line.split()
macros[line[0]] = [
str(int(float(line[1]) * db_units_per_micron)),
str(int(float(line[2]) * db_units_per_micron)),
line[3],
]
print("Placing the following macros:")
print(macros)
So it looks like comments start with
#
and are ignored along with blank lines.
It doesn’t look like variables or equations would be processed as you suggested.
b
Burak Aykenar
09/19/2023, 11:44 AM
Thanks @Mitch Bailey
It is prone to math errors if you try to calculate and write positions when you have too many macros, such as near 200 in my case, anyway I have to do manually and check in the layout view
m
Mitch Bailey
09/19/2023, 1:28 PM
I bet. I wonder if you could use a preprocess like
m4
to create a placement file outside the flow.
b
Burak Aykenar
09/20/2023, 2:03 PM
Hmm, I just wrote a python script for generating macro.cfg, which seems easier for me
Thanks,
Linen is a search-engine friendly community platform. We offer integrations with existing Slack/Discord communities and make those conversations Google-searchable.