Use builder arguments in generator

This commit is contained in:
Xiretza 2020-02-12 14:39:34 +01:00
parent b9fb1f03ec
commit eea1086654
No known key found for this signature in database
GPG Key ID: E51A6C6A1EB378ED
1 changed files with 10 additions and 2 deletions

View File

@ -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,7 +304,13 @@ 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__":