Atom, Apio, and TinyFPGA BX tools build error [SOLVED]


#1

I was trying to get everything running on OSX 10.11.6 and can’t get the blink_project to build. I get the error:

[Fri Jul 13 20:30:49 2018] Processing TinyFPGA-BX

yosys -p “synth_ice40 -blif hardware.blif” -q top.v
scons: *** [hardware.blif] Error -4
========================= [ ERROR ] Took 1.59 seconds =========================

I have looked and can’t figure our what error “-4” is. Has anyone seen this? Do I need to starting asking questions at the yosys or scons sites?

What I have installed is:
Python 2.7.10
Python 3.6.5
Atom 1.28.1 x64
apio, version 0.4.0b3
icestorm 1.11.0-beta
iverilog 1.2.0
scons 3.0.1
system 1.1.0
verilator 1.0.0

FYI, for even more version numbers, when I do a “pip install -U apio” I get:

Requirement already up-to-date: apio in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (0.4.0b3)
Requirement not upgraded as not directly required: semantic-version>=2.5.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (2.6.0)
Requirement not upgraded as not directly required: pyserial<4,>=3 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (3.4)
Requirement not upgraded as not directly required: requests<3,>=2.4.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (2.19.1)
Requirement not upgraded as not directly required: pyjwt<2,>=1.5.3 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (1.6.4)
Requirement not upgraded as not directly required: colorama in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (0.3.9)
Requirement not upgraded as not directly required: click<7,>=5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from apio) (6.7)
Requirement not upgraded as not directly required: urllib3<1.24,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests<3,>=2.4.0->apio) (1.23)
Requirement not upgraded as not directly required: idna<2.8,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests<3,>=2.4.0->apio) (2.7)
Requirement not upgraded as not directly required: chardet<3.1.0,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests<3,>=2.4.0->apio) (3.0.4)
Requirement not upgraded as not directly required: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from requests<3,>=2.4.0->apio) (2018.4.16)

Thanks,
Eric


#2

@JesusArroyo, is this error from APIO or yosys?


#3

It was all the text from the “apio build” window. I assume yosys was using scons and the error happened there.

If I use the command line “apio build” in the blink_project directory (From the setup instructions at https://tinyfpga.com/bx/guide.html), I get the same thing.

Eric


#4

Using verbose flags I get:

$ apio build --verbose-yosys
[Fri Jul 13 21:27:56 2018] Processing TinyFPGA-BX

yosys -p “synth_ice40 -blif hardware.blif” top.v

Yosys 0.8-dev (Apio build) (git sha1 bc63d80, clang 8.1.0 -fPIC -Os)

– Parsing top.v' using frontendverilog’ –

  1. Executing Verilog-2005 frontend.
    scons: *** [hardware.blif] Error -4
    ========= [ ERROR ] Took 1.09 seconds =========

and

$ apio build --verbose-arachne
[Fri Jul 13 21:28:41 2018] Processing TinyFPGA-BX

yosys -p “synth_ice40 -blif hardware.blif” -q top.v
scons: *** [hardware.blif] Error -4
========= [ ERROR ] Took 1.44 seconds =========


#5

Can you zip up the whole directory and post it here? I know it’s he blinky example, but it will help to have exactly the same files you have.


#6

Here is the zip of the example I tried building:

blink_project.zip (23.9 KB)


#7

FWIW I was able to build and upload this without changes via Atom + Apio on Windows 10. I realize this isn’t the same as your OSX platform, but it suggests the problem is likely specific to the tool installation rather than the project itself.


#8

Hi. Could you execute in the terminal yosys -p “synth_ice40 -blif hardware.blif” -q top.v directly to check if the output contains more information about the error?

Thanks.


#9

From the command line, I get:

yosys -p “synth_ice40 -blif hardware.blif” -q top.v
Illegal instruction: 4

I did find some comments about “Illegal instruction: 4” on redit talking about dylib issues.

I did notice that my version of clang is:
clang --version
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

and that icestorm was compiled with 8.1.0. Do I need to build icestorm from sources if this is a dyld issue on osx? Are older versions of icestorm available through apio install ?


#10

Ok, I got atom/apio/yosys building working on MacOS El Capitan 10.11.6. It looks like it was a clang dylib version issue. When icestorm was built locally it works.

  1. I uninstalled python 3.6

  2. Installed brew (/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”).

  3. Downloaded toolchain-icestorm-1.11.0-beta source, extracted, and used build.sh to build for darwin (from https://github.com/FPGAwars/toolchain-icestorm/releases)

  4. All build dependencies (including python 3.7) were installed via brew.

  5. Removed old ~/.apio/packages/toolchain-icestorm

  6. Copied toolchain-icestorm-1.11.0-beta/_packages/build_darwin/toolchain-icestorm to ~/.apio/packages

  7. Reinstalled apio with: pip3 install --upgrade --no-cache-dir apio==0.4.0b3 “tinyprog>=1.0.10” (it was removed with python 3.6).

  8. Started atom, and built the blink_project. No fatal errors.

Now I have to get the board to connect.


#11

Nice work!

This post should help you get ‘tinyprog’ to connect if you are having problems: