Skip to content
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

Synthesis fails on MacOS but succeeds on Linux (possibly ABC error) #4618

Open
agrif opened this issue Sep 29, 2024 · 2 comments
Open

Synthesis fails on MacOS but succeeds on Linux (possibly ABC error) #4618

agrif opened this issue Sep 29, 2024 · 2 comments
Labels
pending-verification This issue is pending verification and/or reproduction

Comments

@agrif
Copy link

agrif commented Sep 29, 2024

Version

Yosys 0.45+139 (git sha1 8e1e2b9, x86_64-apple-darwin21.4-clang++ 14.0.0-1ubuntu1.1 -fPIC -O3)

On which OS did this happen?

macOS

Reproduction Steps

Extract tmpfile-bug.zip and then run yosys top.ys.

Expected Behavior

Successful synthesis. Although this fails on MacOS, it succeeds on Debian, using the same yosys commit (8e1e2b9). Both the mac and linux builds were downloaded from here.

Actual Behavior

Synthesis failure. The build log ends with:

ABC: ** cmd error: aborting 'source <abc-temp-dir>/abc.script'
ABC: The command has to terminate. Boxes are not in a topological order.
ABC: The following information may help debugging (numbers are 0-based):
ABC: Input 0 of BoxA 242 (1stCI = 2079; 1stCO = 425) has TFI with CI 2274,
ABC: which corresponds to output 0 of BoxB 340 (1stCI = 2274; 1stCO = 814).
ABC: In a correct topological order, BoxB should precede BoxA.
ABC: Error: Abc_CommandAbc9If(): Mapping of GIA has failed.

2.23.17.6. Executing AIGER frontend.
ERROR: Can't open input file `/var/folders/5h/w8yjmsfs73x_yzh2cv054svc0000gn/T/yosys-abc-gJsx4M/output.aig' for reading: No such file or directory

I think the missing file error is a consequence of the ABC error just before it.

On linux, ABC does not complain about topological ordering, although it does say: ABC: Mapping (K=8) : lut = 2990 edge = 13153 lev = 15 (2.59) Boxes are not in a topological order. Switching to level computation without boxes. I'm not sure why ABC would behave differently on linux.

Any change I make to the design, even very minor changes, causes this issue to disappear.

@agrif agrif added the pending-verification This issue is pending verification and/or reproduction label Sep 29, 2024
@donn
Copy link
Contributor

donn commented Oct 4, 2024

Yosys is in general not cross-OS deterministic (and I'm not sure if it's down to ABC specifically)-- I've put a couple hours into trying to dissect my synthesis scripts to try to figure out where it starts deviating but it was starting to be something of a timesink and I had to stop.

I can confirm it is per-OS deterministic -- behavior is identical on aarch64-linux and x86_64-linux for example, and aarch64-darwin and x86_64-darwin. But the Linux and Darwin ones deviate in sufficiently large designs.

@agrif
Copy link
Author

agrif commented Oct 4, 2024

That's good to know. I noticed that synthesis on Linux and MacOS sometimes have wildly different resource usage, with one sometimes using 3 or 4 times the logic of the other. I've put that down to the Gowin synthesis being a work in progress.

However, failing synthesis entirely on one OS but not another strikes me as a more serious bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-verification This issue is pending verification and/or reproduction
Projects
None yet
Development

No branches or pull requests

2 participants