Installing qflow

An experience installing qflow in an Ubuntu computer.

Just a record to remind myself of what I did to install qflow.

As done on an Ubuntu 18.04 system.


It's always better to read the README file first (though I'm sometimes too lazy for that and read it a bit too late).

Dependencies of qflow that must be installed separately include:

The following are also among the dependencies of qflow. But for me, installing the above dependencies had somehow caused these to be installed as well. Or may be it was just because it was already there on my computer.

Yosys

Does Verilog RTL synthesis (Verilog parser/synthesis).

Download the required file from http://www.clifford.at/yosys/download.html.

I used v0.9.

tar -xf yosys-yosys-0.9.tar.gz
cd yosys-yosys-0.9/

Install the prerequisites as mentioned in the README.md file with

sudo apt-get install build-essential clang bison flex \
    libreadline-dev gawk tcl-dev libffi-dev git \
    graphviz xdot pkg-config python3 libboost-system-dev \
    libboost-python-dev libboost-filesystem-dev

and then build it with

make

Now we may run the tests to be sure that everything is all right.

Testing the build

We need gawk and a recent version of iverilog to run the tests.

The iverilog in the Ubuntu repos is likely to be a bit old and using that could lead to problems like this. Better build from source.

Installing iverilog

Download the file from http://iverilog.icarus.com/. I used version 11.0.

tar -xf verilog-11.0.tar.gz
cd verilog-11.0/
./configure
make
make check  # Optional but good to do. To check if all works fine.
sudo make install

Note: If this iverilog ever needs to uninstalled, run make uninstall.

Running tests and installing

make test

And if tests pass, install the build with

sudo make install

Note: To uninstall this installation of yosys, run make uninstall.

To let qflow see the yosys installation create a couple of symlink with

sudo ln -s /usr/local/bin/yosys /usr/local/share/qflow/tech/bin/yosys
sudo ln -s /usr/local/bin/yosys-abc /usr/local/share/qflow/tech/bin/yosys-abc

graywolf

For placement in VLSI design (cell and pin placement).

Go to https://github.com/rubund/graywolf/releases and download the files.

I used v0.1.6.

tar -xf graywolf-0.1.6.tar.gz
cd graywolf-0.1.6
mkdir build
cd build

If we use gcc (I was on 7.0), it would give the error mentioned in https://github.com/rubund/graywolf/issues/32 for which I couldn't find a workaround.

So I asked cmake to use clang by passing a couple of options.

cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ..
make

If make shows errors related to missing packages install them and run make again. I needed

sudo apt install libgsl-dev  # GNU Scientific library

Now we can run the tests and install with

make test  # Optional, but good to do.
sudo make install

Create a symlink in qflow's bin/ directory with

sudo ln -s /usr/local/bin/graywolf /usr/local/share/qflow/bin/graywolf

Qrouter

Detail router.

Download latest stable version from http://opencircuitdesign.com/qrouter/download.html

I used v1.4.84.

tar -xf qrouter-1.4.84.tgz
cd qrouter-1.4.84/
./configure  # Creates the Makefile
make

In case of missing library errors, install them. I needed

sudo apt install tk-dev tcl-dev

I also had to edit the Makefile to add flags for the compiler to find the tk header file. There are probably better ways to fix that but this one did work for me.

Edit CFLAGS variable from

CFLAGS += -g -O2

to

CFLAGS += -g -O2 -I /usr/include/tcl/

where /usr/include/tcl/ is the path to the header file.

You can then install qrouter if you like with

sudo make install

Then create symlinks in qflow's bin/ directory with

sudo ln -s /usr/local/bin/qrouter /usr/local/share/qflow/bin/qrouter

Magic

Layout viewer.

It's better to use a recent version of magic instead of the old one from the Ubuntu repo. Otherwise problems like https://github.com/RTimothyEdwards/qflow/issues/1 could pop up.

Go to http://opencircuitdesign.com/magic/download.html and get the file.

I used v8.3.153.

tar -xf magic-8.3.153.tgz
cd magic-8.3.153/
./configure
make
sudo make install

By default, magic would be installed at /usr/local. In order for qflow to find it, create a symlink like

sudo ln -s /usr/local/bin/magic /usr/local/share/qflow/bin/magic

Netgen

Does LVS (Layout-vs-Schematic) to verify whether the IC layout corresponds to the original schematic (circuit diagram) of the design.

Go to http://opencircuitdesign.com/netgen/download.html and download the stable version.

I used v1.5

tar -xf netgen-1.5.173.tgz
cd netgen-1.5.173/
./configure
make
sudo make install

and create symlink for qflow to see it with

sudo ln -s /usr/local/bin/netgen /usr/local/share/qflow/bin/netgen

qflow

Once all its dependencies are met, we can install qflow itself.

Download the file from http://opencircuitdesign.com/qflow/download.html#Download.

I got v1.4.95

tar -xf qflow-1.4.95.tgz
cd qflow-1.4.95/
./configure
make
sudo make install

And install the python3-tk package which would be needed by the qflow GUI.

sudo apt install python3-tk

Some hacking

I also did some random stuff which somehow made qflow to work okay.

Copy tech/ directory

Copy the tech/ directory from the extracted qflow-1.4.95/ directory to /usr/local/share/qflow.

sudo cp -r tech/ /usr/local/share/qflow/

Copy the executables

Copy some executables that qflow would need to use to the bin/ directory that qflow uses.

sudo cp src/vlogFanout /usr/local/share/qflow/bin
sudo cp src/vlog2Verilog /usr/local/share/qflow/bin
sudo cp src/vlog2Spice /usr/local/share/qflow/bin
sudo cp src/vlog2Cel /usr/local/share/qflow/bin
sudo cp src/DEF2Verilog /usr/local/share/qflow/bin
sudo cp src/rc2dly /usr/local/share/qflow/bin

Modify a few tcsh scripts

As mentioned in https://github.com/RTimothyEdwards/qflow/issues/22, we need to modify some tcsh scripts at /usr/local/share/qflow/scripts/.

This seems to be applicable for v1.4.95 but probably not for later releases.

The modification to be made is same for all the files, which is to change the line

set techfile ${techdir}/${techfile}

to

set techfile = ${techdir}/${techfile}

The line number of the line to be modified and the files are as follows:

Done!

Now the qflow GUI can be launched with

qflow gui

References