Fix fasm append operation

Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
This commit is contained in:
Krzysztof Boronski 2022-06-24 07:14:40 -05:00
parent df8091450b
commit 1e3f24a0c3
1 changed files with 3 additions and 4 deletions

View File

@ -67,10 +67,9 @@ class FasmModule(Module):
if ctx.takes.fasm_extra: if ctx.takes.fasm_extra:
yield 'Appending extra FASM...' yield 'Appending extra FASM...'
with \ with \
open(ctx.outputs.fasm, 'r') as fasm_file, \ open(ctx.outputs.fasm, 'a') as fasm_file, \
open(ctx.takes.fasm_extra, 'r') as fasm_extra_file, \ open(ctx.takes.fasm_extra, 'r') as fasm_extra_file:
open(ctx.outputs.fasm, 'w') as wfptr: fasm_file.write(f"\n{fasm_extra_file.read()}")
wfptr.write(f"{fasm_file.read()}\n{fasm_extra_file.read()}")
else: else:
yield 'No extra FASM to append' yield 'No extra FASM to append'