From 0c171af9b4f39937f60f9549e48191853b51ebc2 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Wed, 1 May 2024 23:47:35 +0300 Subject: [PATCH] feat(fpga): read seed / target frequency from environment Read the values from TT_FPGA_SEED / TT_FPGA_FREQ, and default to 12 MHz frequency. --- project.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index 9557f46..4f6b3fd 100644 --- a/project.py +++ b/project.py @@ -530,7 +530,10 @@ class Project: logging.error("synthesis failed") exit(1) - nextpnr_cmd = f"nextpnr-ice40 -l {build_dir}/02-nextpnr.log --pcf-allow-unconstrained --seed 10 --freq 48 --package sg48 --up5k --asc {build_dir}/tt_fpga.asc --pcf {SCRIPT_DIR}/fpga/tt_fpga_top.pcf --json {build_dir}/tt_fpga.json" + seed = os.getenv("TT_FPGA_SEED", "10") + freq = os.getenv("TT_FPGA_FREQ", "12") + + nextpnr_cmd = f"nextpnr-ice40 -l {build_dir}/02-nextpnr.log --pcf-allow-unconstrained --seed {seed} --freq {freq} --package sg48 --up5k --asc {build_dir}/tt_fpga.asc --pcf {SCRIPT_DIR}/fpga/tt_fpga_top.pcf --json {build_dir}/tt_fpga.json" logging.debug(nextpnr_cmd) p = subprocess.run(nextpnr_cmd, shell=True) if p.returncode != 0: