From 5d16ce23aab956dcce5be0a1fe529e9925a52594 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 20 Aug 2024 19:29:09 -0700 Subject: [PATCH] tasks.py: adjust yosys script --- tasks.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tasks.py b/tasks.py index 7636209..85107b6 100644 --- a/tasks.py +++ b/tasks.py @@ -125,16 +125,25 @@ def synth(c, target): yosys_report = out_yosys / module_name.with_suffix(".stats") yosys_log = out_yosys / module_name.with_suffix(".log") yosys_preprocessed = out_yosys / module_name.with_suffix(".v") + yosys_preprocessed_rtl = out_yosys / module_name.with_suffix(".rtlil") + yosys_preprocessed_graph = out_yosys / module_name.stem yosys_compiled = out_yosys / f"{module_name.stem}_compiled.v" with open(yosys_script, "w", encoding="UTF-8") as f: f.write(dedent(f"""\ read_verilog -sv -defer {' '.join(str(f) for f in verilog_files)} hierarchy -top {module_name} - synth_ecp5 -top {module_name} -run :map_ram + design -push-copy + synth_lattice -family ecp5 -abc9 -run :map_ram + opt -full + clean -purge write_verilog -sv {yosys_preprocessed} - opt_clean -purge - synth_ecp5 -run map_ram: -json {yosys_json} - opt_clean -purge + write_rtlil {yosys_preprocessed_rtl} + show -format dot -colors 1 -stretch -viewer none -prefix {yosys_preprocessed_graph} + + design -pop + synth_lattice -family ecp5 -abc9 -no-rw-check + clean -purge + write_json {yosys_json} write_verilog -sv {yosys_compiled} tee -o {yosys_report} stat """)) @@ -156,7 +165,7 @@ def synth(c, target): nextpnr_out = out_nextpnr / module_name.with_suffix(".pnr") nextpnr_log = out_nextpnr / module_name.with_suffix(".log") nextpnr_timing = out_nextpnr / module_name.with_suffix(".log") - out = c.run(f"nextpnr-ecp5 --85k --detailed-timing-report -l {nextpnr_log} --report {nextpnr_timing} --json {yosys_json} --lpf {pin_map} --package=CABGA381 --textcfg {nextpnr_out}") #, hide='stderr') + out = c.run(f"nextpnr-ecp5 --85k --detailed-timing-report -l {nextpnr_log} --report {nextpnr_timing} --json {yosys_json} --lpf {pin_map} --package=CABGA381 --speed=6 --textcfg {nextpnr_out}", hide='stderr') print_filtered_paragraphs(out.stderr, "Device utilisation", "Critical path", "Max frequency", "Max delay", common_prefix="Info: ") print(f" PNR : {nextpnr_out}")