m-labs / migen

A Python toolbox for building complex digital hardware
https://m-labs.hk/migen
Other
1.18k stars 211 forks source link

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

Open lneuhaus opened 2 years ago

lneuhaus commented 2 years ago

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

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:

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.

sbourdeauducq commented 2 years ago

Might be OK.