From 1e3f24a0c3f120883a8fba194f94f31fad429a35 Mon Sep 17 00:00:00 2001 From: Krzysztof Boronski Date: Fri, 24 Jun 2022 07:14:40 -0500 Subject: [PATCH] Fix fasm append operation Signed-off-by: Krzysztof Boronski --- f4pga/common_modules/fasm.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/f4pga/common_modules/fasm.py b/f4pga/common_modules/fasm.py index 29cc27a..2dba668 100644 --- a/f4pga/common_modules/fasm.py +++ b/f4pga/common_modules/fasm.py @@ -67,10 +67,9 @@ class FasmModule(Module): if ctx.takes.fasm_extra: yield 'Appending extra FASM...' with \ - open(ctx.outputs.fasm, 'r') as fasm_file, \ - open(ctx.takes.fasm_extra, 'r') as fasm_extra_file, \ - open(ctx.outputs.fasm, 'w') as wfptr: - wfptr.write(f"{fasm_file.read()}\n{fasm_extra_file.read()}") + open(ctx.outputs.fasm, 'a') as fasm_file, \ + open(ctx.takes.fasm_extra, 'r') as fasm_extra_file: + fasm_file.write(f"\n{fasm_extra_file.read()}") else: yield 'No extra FASM to append'