From eea1086654eca090467d7625cea5a628eda59a2d Mon Sep 17 00:00:00 2001 From: Xiretza Date: Wed, 12 Feb 2020 14:39:34 +0100 Subject: [PATCH] Use builder arguments in generator --- liteeth/gen.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/liteeth/gen.py b/liteeth/gen.py index 63a4a2d..126e4a9 100755 --- a/liteeth/gen.py +++ b/liteeth/gen.py @@ -270,6 +270,8 @@ class UDPCore(PHYCore): def main(): parser = argparse.ArgumentParser(description="LiteEth standalone core generator") + builder_args(parser) + parser.set_defaults(output_dir="build") parser.add_argument("config", help="YAML config file") args = parser.parse_args() core_config = yaml.load(open(args.config).read(), Loader=yaml.Loader) @@ -302,8 +304,14 @@ def main(): platform = platform) else: raise ValueError("Unknown core: {}".format(core_config["core"])) - builder = Builder(soc, output_dir="build", compile_gateware=False, csr_csv="build/csr.csv") + + builder_arguments = builder_argdict(args) + builder_arguments["compile_gateware"] = False + if builder_arguments["csr_csv"] is None: + builder_arguments["csr_csv"] = os.path.join(builder_arguments["output_dir"], "csr.csv") + + builder = Builder(soc, **builder_arguments) builder.build(build_name="liteeth_core") if __name__ == "__main__": - main() \ No newline at end of file + main()