Skip to content

Commit

Permalink
ensure that the yaml files are processed in order
Browse files Browse the repository at this point in the history
  • Loading branch information
pwittich committed Oct 13, 2023
1 parent 19e794e commit 28532ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/cm_mcu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ${COMPILER}:
## Zynq address table
YAML_FILES=$(wildcard ${ROOT}/sm_cm_config/data/*.yml)
ZynqMon_addresses.c: ${YAML_FILES}
python ${ROOT}/sm_cm_config/src/mcu_generate.py -o $@ ${YAML_FILES}
python ${ROOT}/sm_cm_config/src/mcu_generate.py -v -o $@ ${YAML_FILES}
#python ${ROOT}/sm_cm_config/src/xml_generate.py

ZynqMon_addresses.o: ZynqMon_addresses.c
Expand Down
8 changes: 7 additions & 1 deletion sm_cm_config/src/mcu_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
if args.output:
print('Output file name:', args.output)

# sort the input file names. Default appears to be random (or order in the filesystem)
args.input_files.sort()

if args.verbose:
print('Input file names:', args.input_files)
# pretty-print list of input files
print('Input file names:', *args.input_files, sep=', ', end='\n')

# open output text file for writing
with open(args.output, 'w', encoding="ascii") as fout:
Expand All @@ -36,6 +40,8 @@
# first set the #ifdef for REV1
print(r"#ifdef REV1", file=fout)
for idx, fname in enumerate(args.input_files):
if args.verbose:
print(f"Processing file {fname}")
with open(fname, encoding="ascii") as f:
data = yaml.load(f, Loader=yaml.FullLoader)
if idx != 0:
Expand Down

0 comments on commit 28532ef

Please sign in to comment.