migen icon indicating copy to clipboard operation
migen copied to clipboard

move the conditional part of `toolchain.build(run=True/False)` to a separate method

Open lneuhaus opened this issue 3 years ago • 1 comments

I would like to split the build process of a design on two hosts:

  • the first host would call platform.build(run=False) and create a build folder with the files required for a build
  • that folder would be zipped and shipped to a second host, which has the tools (eg Vivado) required for building a design installed
  • the second host would then unzip the build folder and run the steps that are usually only called if run=True is passed to build
  • eventually the result of the build would be shipped back to the first host and deployed

Fortunately, the structure of build() methods for all platforms is always similar, essentially containing an if run: ... block which is all that needs to run on the second host. I suggest to make that block a classmethod (e.g. call it _run_build(build_folder) of the toolchain, which is called from build(). Would a PR with this change have chances to be merged?

For example, I'm talking about pieces of code like these ones:

  • https://github.com/m-labs/migen/blob/ac703010eaa06ac9b6e32f97c6fa98b15de22b31/migen/build/xilinx/vivado.py#L221
  • https://github.com/m-labs/migen/blob/ac703010eaa06ac9b6e32f97c6fa98b15de22b31/migen/build/lattice/icestorm.py#L182

EDIT: I'm now seeing that not all of the run-blocks require the same input (some need files in a folder, others a script), so maybe it's easier if I build custom solutions based on specific toolchains.

lneuhaus avatar Feb 22 '22 09:02 lneuhaus

Might be OK.

sbourdeauducq avatar Feb 22 '22 09:02 sbourdeauducq