1
0
Fork 0
mirror of https://git.sr.ht/~kivikakk/niar synced 2025-05-06 21:03:11 +00:00

cxxrtl: add externals.

Just assuming all (plain) Verilog for now.
This commit is contained in:
Asherah Connor 2024-08-24 18:19:19 +03:00
parent 594d92f3fd
commit fb7a8c2975

View file

@ -136,6 +136,11 @@ def main(np: Project, args):
with open(yosys_script_path, "w") as f:
for box_source in black_boxes.values():
f.write(f"read_rtlil <<rtlil\n{box_source}\nrtlil\n")
for p in np.externals:
f.write(f"read_verilog <<niar_read_verilog\n")
with open(np.path(p), 'r') as r:
f.write(r.read())
f.write(f"\nniar_read_verilog\n")
f.write(f"read_rtlil {_make_absolute(il_path)}\n")
if args.optimize.opt_rtl:
f.write("opt\n")