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

ABC: execution of command "..." failed: return code 134. #1675

Closed
adumont opened this issue Feb 2, 2020 · 5 comments · Fixed by #1744
Closed

ABC: execution of command "..." failed: return code 134. #1675

adumont opened this issue Feb 2, 2020 · 5 comments · Fixed by #1744

Comments

@adumont
Copy link

adumont commented Feb 2, 2020

Steps to reproduce the issue

git clone https://github.com/adumont/hrm-cpu.git
cd hrm-cpu
git checkout issueABC
cd verilog
make bin

Failing commit is 2b4180c2bf508fead7d1d14def8600957124f50b.

will try to synthesize the design. The step:

yosys -p "synth_ice40 -top top -blif builddir/alhambra/top.blif " \
              -l builddir/alhambra/Echo/top.log -q hrmcpu.v ufifo.v ALU.v MEMORY.v XALU.v LEDS.v RAND.v ram.v mem_wrapper.v REG.v IR.v PROG.v WAIT.v PC.v ControlUnit.v debouncer.v rxuartlite.v txuartlite.v builddir/alhambra/top_wrapper.v top.v

fails with:

ERROR: ABC: execution of command "/home/adumont/toolchain/bin/yosys-abc -s -f /tmp/yosys-abc-eQGZWS/abc.script 2>&1" failed: return code 134.
$ /home/adumont/toolchain/bin/yosys-abc -s -f /tmp/yosys-abc-eQGZWS/abc.script 
ABC command line: "source /tmp/yosys-abc-eQGZWS/abc.script".
+ read_blif /tmp/yosys-abc-eQGZWS/input.blif 
+ read_lut /tmp/yosys-abc-eQGZWS/lutdefs.txt 
+ strash 
+ ifraig 
+ scorr 
Warning: The network is combinational (run "fraig" or "fraig_sweep").
+ dc2 
+ dretime 
+ strash 
+ dch -f 
+ if 
+ mfs2 
+ lutpack -S 1 
yosys-abc: src/opt/lpk/lpkCore.c:549: int Lpk_ResynthesizeNodeNew(Lpk_Man_t *): Assertion `nGain >= 1 - p->pPars->fZeroCost' failed.
Aborted (core dumped)

I've uploaded some stuff from the /tmp/yosys-abc-eQGZWS:

yosys-abc-eQGZWS.zip

My toolchain is updated to latest git version (tool/commit sha):

yosys.ver:9f5613100b360beb60608df1296ee81dc185e56c
arachne-pnr.ver:c40fb2289952f4f120cc10a5a4c82a6fb88442dc
icestorm.ver:0ec00d892a91cc68e45479b46161f649caea2933
iverilog.ver:b1114760fcfba55ee9ca35ba95e2b3ed2b7c7a20
symbiyosys.ver:500b526131f434b9679732fc89515dbed67c8d7d
verilator.ver:0c6c83e2787803d9b7c014ddbc8710f47d0f82f7
yices2.ver:1dcb71c405b5f1d21b363eb33b566068cad2e87d

Previous commit (053c6f1a5f2ab79add807138b24f92de6b3b308c053c6f1a5f2ab79add807138b24f92de6b3b308c) build fine.

Here's the diff in verilog code: adumont/hrm-cpu@2b4180c.

Expected behavior

It should produce the blif file.

Actual behavior

Fails with assertion in ABC.

@adumont
Copy link
Author

adumont commented Feb 2, 2020

Full build log of working commit: (Build 222) https://travis-ci.com/adumont/hrm-cpu/builds/147103961#L1596

Build log of failing commit: (Build 223) https://travis-ci.com/adumont/hrm-cpu/builds/147104799#L1482

@eddiehung
Copy link
Collaborator

Hi @adumont. Thanks for the report. Your diff looks innocuous enough that this looks to be a bug in upstream ABC berkeley-abc/abc, perhaps hitting an obscure corner case that wasn't triggered before. Would you like to report it there?

An example that I did earlier is here: berkeley-abc/abc#61 and uses the equivalent test-case that you attached as yosys-abc-eQGZWS.zip.
In case it helps, I've minimised the ABC script to this:

read_blif input.blif;
strash;
dc2; # Removing this optimisation command results in a different solution that does not trigger the assertion failure
if;
lutpack -S 1;

As for you current predicament, I understand that the lutpack command that is failing is an optional optimisation. You can workaround this ahead of an upstream fix by overriding the -script argument to abc with this Yosys command before synth_ice40:
scratchpad -set abc.script +strash;ifraig;scorr;dc2;dretime;strash;dch,-f;if;mfs2

Let me know if that unblocks you!

@adumont
Copy link
Author

adumont commented Feb 5, 2020

Hi @eddiehung ,

Thanks for the feedback.

First of all, I have tried the scratchpad -set abc.script +strash;ifraig;scorr;dc2;dretime;strash;dch,-f;if;mfs2before synth_ice40 and it worked.

I'll open an issue in berkeley-abc/abc.

Feel free to close this issue then :). Thanks a lot.

@nakengelhardt
Copy link
Member

The assertion is commented out for now in abc: berkeley-abc/abc@53f2238

@eddiehung
Copy link
Collaborator

eddiehung commented Mar 6, 2020

The assertion is commented out for now in abc: berkeley-abc/abc@53f2238

Thanks @nakengelhardt! I think that change is safe to use despite its commit message being:

Temporary commenting out of the assertion.

I've opened PR #1744 to bump ABCREV.
@adumont: please report back whether it fixes it for you too!

eddiehung added a commit that referenced this issue Mar 11, 2020
elutow added a commit to elutow/ee469-labs-starter that referenced this issue Mar 11, 2020
elutow added a commit to elutow/ee469-labs that referenced this issue Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants