-
Notifications
You must be signed in to change notification settings - Fork 211
software: add toolchain integration for Emscripten #960
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
Conversation
0423618
to
44a0245
Compare
I reviewed all the changes. Everything looks good to me except for two small issues (see diff), and two questions I have (see questions). In |
986d4f4
to
e0324cc
Compare
Thanks, all good calls.
This is a remnant from an earlier implementation.
This is a remnant from an earlier bug. The version functions actually all return strings (they aren't compared, but they are hashed). It's kind of an odd API. It should be |
76e34f1
to
c3fcc3a
Compare
Primarily useful for the Emscripten port, but can also be used to amortize startup latency in other cases.
Primarily useful for Emscripten port.
Required for WebUSB backend.
This integration expects a global object like this: globalThis.glasgowToolchain = { packages: { 'yosys': '0.55', 'nextpnr-ice40': '0.8' }, available(packageName) { return packageName in this.packages; }, version(packageName) { return this.packages[packageName]; }, async build(files, scriptName, writeLine) { writeLine("starting build...\n") // ... do the build... return {code: 0, files: ...}; } }
Disconnecting the device seems to produce a `NotFoundError` with "The device was disconnected." in the message. This isn't a great solution but I don't have anything better.
OK, I think this is more or less complete. There are still things that don't work on Emscripten but I think we're better off merging this and fixing the rest incrementally. You can get pretty far with the code in this PR. (The main thing that's still broken is Windows support, and I haven't got a faintest clue why.) |
No problem, happy to contribute!
Nice! I also just took a look at the most recent commit (c2be584) and it LTGM. |
To do:
get_bitstream
wasn't async but is async now, something downstream probably brokeasyncio.create_subprocess_exec
instead ofPopen
to avoid blocking when running *nix/Windows too