diff --git a/pyproject.toml b/pyproject.toml index b6969a4..760d328 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ name = "build-fpga" # REQUIRED, is the only field that cannot be marked as dyna # https://packaging.python.org/guides/single-sourcing-package-version/ # dynamic = ["version"] -version = "0.3.3" # REQUIRED, although can be dynamic +version = "0.4.0" # REQUIRED, although can be dynamic # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: diff --git a/src/build_fpga/build_fpga.py b/src/build_fpga/build_fpga.py index 55217fd..38bf26b 100644 --- a/src/build_fpga/build_fpga.py +++ b/src/build_fpga/build_fpga.py @@ -24,7 +24,7 @@ def build_fpga_main(): cfg = yaml.safe_load(cfg_file) if (cfg["tool"] == "efinity"): - efinity.create_project(cfg) + efinity.build_project(cfg) elif (cfg["tool"] == "vivado"): vivado.build_nonprj(cfg) diff --git a/src/build_fpga/efinity/efinity.py b/src/build_fpga/efinity/efinity.py index 98b7ae1..a94866c 100644 --- a/src/build_fpga/efinity/efinity.py +++ b/src/build_fpga/efinity/efinity.py @@ -7,7 +7,7 @@ from rtl_manifest import read_sources TAG="{http://www.efinixinc.com/enf_proj}" -def create_project(cfg): +def create_project(cfg, filename): script_dir = os.path.dirname(__file__) # print(cfg) @@ -79,7 +79,11 @@ def create_project(cfg): ET.indent(tree, ' ') - tree.write(f"{cfg["prj_info"]["name"]}.xml", encoding="utf-8", xml_declaration=False) + tree.write(f"{filename}", encoding="utf-8", xml_declaration=False) + +def build_project(cfg): + name = f"{cfg['prj_info']['name']}.xml" + create_project(cfg, name) + os.mkdir("output") + os.system(f"efx_run --prj {name} --output_dir outflow --work_dir work") -if __name__ == "__main__": - create_project(None) \ No newline at end of file