Skip to content

Commit

Permalink
[topgen-fusesoc] Modify how the script handles output
Browse files Browse the repository at this point in the history
The script previously outputed to a dedicated temporary directory
and deletes some files before generating them. Now that we are checking
files in, we need to change this behaviour. The script now doesn't
remote anything and outputs to hw/<top_name>.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Sep 30, 2024
1 parent 4f03305 commit e50e47e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions util/topgen-fusesoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
r"""Stopgap script to generate some cores for the englishbreakfast toplevel.
All output files are written to $REPO_TOP/build/$TOPNAME-autogen/.
All output files are written to hw/$TOPNAME/.
"""

import argparse
Expand All @@ -27,6 +27,9 @@ def write_core(core_filepath, generated_core):
# to be used everywhere, which is annoying syntax-wise on Python <3.7,
# where native dicts are not sorted.
f.write('CAPI=2:\n')
f.write('# Copyright lowRISC contributors (OpenTitan project).\n')
f.write('# Licensed under the Apache License, Version 2.0, see LICENSE for details.\n')
f.write('# SPDX-License-Identifier: Apache-2.0\n')
yaml.dump(generated_core,
f,
encoding="utf-8",
Expand All @@ -45,9 +48,8 @@ def main():

# Call topgen.
files_data = files_root + "/hw/" + topname + "/data/"
files_out = os.path.abspath(files_root + "/build/" + topname + "-autogen/")
shutil.rmtree(files_out, ignore_errors=True)
os.makedirs(files_out, exist_ok=False)
files_out = os.path.abspath(files_root + "/hw/" + topname)
print("output: ", files_out)
cmd = [files_root + "/util/topgen.py", # "--verbose",
"-t", files_data + topname + ".hjson",
"-o", files_out]
Expand Down

0 comments on commit e50e47e

Please sign in to comment.