| #!/usr/bin/env python3 |
| |
| import os |
| import re |
| |
| import common |
| |
| |
| re_lef = re.compile('^\s*macro\s*([^ ]+)') |
| |
| |
| broken = [] |
| for pn in common.files(['.lef']): |
| print("lef file", pn) |
| found = False |
| for l in common.read_without_cmts(pn, 'shell'): |
| l = l.strip().lower() |
| if 'macro' not in l: |
| continue |
| if '_macro' in l: |
| continue |
| m = re_lef.search(l) |
| if not m: |
| print(" Error:", repr(l), repr(m)) |
| continue |
| mod = m.group(1) |
| assert mod, (l, m.groups()) |
| common.add_file_for_module(mod, pn) |
| found = True |
| |
| if not found: |
| broken.append(pn) |
| print(" !!!! No cells found in", pn) |
| |
| |
| common.write_mod_json('lef', common.modules, broken) |