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. #68

Open
adumont opened this issue Feb 5, 2020 · 1 comment
Open

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

adumont opened this issue Feb 5, 2020 · 1 comment

Comments

@adumont
Copy link

adumont commented Feb 5, 2020

Hi,

I initially opened the issue in yosys (YosysHQ/yosys#1675), but @eddiehung recommended me to open it here. See his comment here.

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.

More info:

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

Workaruound

I have tried scratchpad -set abc.script +strash;ifraig;scorr;dc2;dretime;strash;dch,-f;if;mfs2 before synth_ice40, as suggested by @eddiehung and it worked.

@eddiehung
Copy link
Contributor

In case it helps, in YosysHQ/yosys#1675 (comment) I mentioned that I managed to minimise the abc.script to:

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;

to get it to fail with the following backtrace on 71f2b40:

(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7a03899 in __GI_abort () at abort.c:79
#2  0x00007ffff7a03769 in __assert_fail_base (fmt=0x7ffff7b97fb8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0xef7d3e "nGain >= 1 - p->pPars->fZeroCost",
    file=0xef7af4 "src/opt/lpk/lpkCore.c", line=549, function=<optimized out>) at assert.c:92
#3  0x00007ffff7a15006 in __GI___assert_fail (assertion=0xef7d3e "nGain >= 1 - p->pPars->fZeroCost", file=0xef7af4 "src/opt/lpk/lpkCore.c", line=549,
    function=0xef7d5f "int Lpk_ResynthesizeNodeNew(Lpk_Man_t *)") at assert.c:101
#4  0x0000000000867605 in Lpk_ResynthesizeNodeNew (p=0x1839320) at src/opt/lpk/lpkCore.c:549
#5  0x0000000000867a7f in Lpk_Resynthesize (pNtk=0x14b1640, pPars=0x7ffffffed520) at src/opt/lpk/lpkCore.c:690
#6  0x0000000000470737 in Abc_CommandLutpack (pAbc=<optimized out>, argc=3, argv=0x1487b80) at src/base/abci/abc.c:4979
#7  0x0000000000582717 in CmdCommandDispatch (pAbc=0x14863e0, pargc=0x7ffffffed5ec, pargv=0x7ffffffed5f0) at src/base/cmd/cmdUtils.c:153
#8  0x000000000057d4d4 in Cmd_CommandExecute (pAbc=0x14863e0, sCommand=<optimized out>) at src/base/cmd/cmdApi.c:210
#9  0x000000000057ac58 in CmdCommandSource (pAbc=0x14863e0, argc=<optimized out>, argv=<optimized out>) at src/base/cmd/cmd.c:719
#10 0x0000000000582717 in CmdCommandDispatch (pAbc=0x14863e0, pargc=0x7fffffff56ec, pargv=0x7fffffff56f0) at src/base/cmd/cmdUtils.c:153
#11 0x000000000057d4d4 in Cmd_CommandExecute (pAbc=0x14863e0, sCommand=<optimized out>) at src/base/cmd/cmdApi.c:210
#12 0x00000000005bf7ff in Abc_RealMain (argc=<optimized out>, argv=<optimized out>) at src/base/main/mainReal.c:330
#13 0x00007ffff7a051e3 in __libc_start_main (main=0x5bc9b0 <main>, argc=3, argv=0x7fffffffe068, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>,
    stack_end=0x7fffffffe058) at ../csu/libc-start.c:308
#14 0x00000000004053ce in _start ()

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

No branches or pull requests

2 participants