-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fud] Add save_temps option to Xilinx synthesis #851
Conversation
* 2 minutes turns out to be what it takes to crash in synthesis. 5 minutes is about what it takes to successfully produce an `xclbin`. * The fud invocation should use `-o` instead of `--to` because the output file is binary. (fud will crash when trying to decode it to a printable string.)
47a1cb4
to
b5b0090
Compare
Rebased and ready to look at! |
fud/fud/stages/remote_context.py
Outdated
@@ -120,18 +120,20 @@ def run_remote(client: SourceType.UnTyped, tmpdir: SourceType.String): | |||
|
|||
run_remote(client, tmpdir) | |||
|
|||
def _close(self, client, remote_tmpdir): | |||
def _close(self, client, remote_tmpdir, keep=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: prefer a more verbose name, e.g. keep_tmpdir
or keep_remote_tmpdir
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good; changed!
client, | ||
tmpdir, | ||
"xclbin/kernel.xclbin", | ||
keep=self.save_temps, | ||
) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit: else
not really needed here, but understand some people like the symmetry.
@@ -40,6 +40,8 @@ def __init__(self, config): | |||
self.remote_exec = RemoteExecution(self) | |||
self.temp_location = self.config["stages", self.name, "temp_location"] | |||
|
|||
self.save_temps = bool(self.config["stages", self.name, "save_temps"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a comment explaining why this is added would prove useful for future readers. It wasn't obvious to me until I read your PR description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call; added a short comment.
LGTM! Chris's nits are a superset of mine so address and merge! |
Thanks, y'all! Merging now. |
* Start refactoring generic sandbox utility LocalSandbox is a new alternative to RemoteExecution for running commands locally. It's not a drop-in replacement (maybe that should come in the future), but it offers morally equivalent functionality. * Fix some configuration stuff * Improve an error message I don't know why "provide an input file" was suggested, so I took that out. Also, properly interpolate the variable into the example flag. * Document what we know so far * Black formatting * Simplify emulation command execution And also make them work locally, with a utility. * Avoid some hard-coding * Document wdb stage configuration * Fix for name change from #851
This change builds on #850 (and depends on it, which is why this is a draft for now and is not worth reviewing until that's merged).
It's a pretty small additional feature: it adds support for the
save_temps
config option in the Xilinx bitstream compilation stage, which is calledxclbin
. This option works in both SSH and local mode, and it just keeps around the temporary directory that would otherwise be deleted at the end of the fud execution. This should make it super easy to check things out manually when something goes wrong.I added a simple utility class,
FreshDir
, that creates a new empty directory in cwd. I hope this will be useful for other vendor-toolchain-related fud stages that need sandbox directories.There is new documentation in the
synthesis.md
chapter for how to use the new flag.