From 2ec0ebe40f013edf7ab3e3de0e52633c13d687ba Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 17 Mar 2022 09:35:34 +0100 Subject: [PATCH] build/gowin: Add copy of bitstream to from impl to gateware directory. --- litex/build/gowin/gowin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/litex/build/gowin/gowin.py b/litex/build/gowin/gowin.py index ae7b24638..f769bcdc9 100644 --- a/litex/build/gowin/gowin.py +++ b/litex/build/gowin/gowin.py @@ -9,7 +9,7 @@ import os import sys import math import subprocess -from shutil import which +from shutil import which, copyfile from migen.fhdl.structure import _Fragment @@ -126,8 +126,8 @@ class GowinToolchain: cwd = os.getcwd() os.makedirs(build_dir, exist_ok=True) os.chdir(build_dir) - # Finalize design + # Finalize design if not isinstance(fragment, _Fragment): fragment = fragment.get_fragment() platform.finalize(fragment) @@ -180,6 +180,12 @@ class GowinToolchain: if subprocess.call([gw_sh, "run.tcl"]) != 0: raise OSError("Error occured during Gowin's script execution.") + # Copy Bitstream to from impl to gateware directory. + copyfile( + os.path.join(build_dir, "impl", "pnr", "project.fs"), + os.path.join(build_dir, build_name + ".fs") + ) + os.chdir(cwd) return v_output.ns