Qflow 1.1: An Open-Source Digital Synthesis Flowのインストール
Post date: 2017/09/17 23:22:49
http://opencircuitdesign.com/qflow/index.html にしたがってインストール
AWSのAmazon Linux AMI 2017.03.1 (HVM), SSD Volume Type - ami-4af5022cにインストールする(これが失敗。Amazon Linuxは、GUIを想定してないので、tkがないとか制限非常に多い。Xで飛ばすのは出来そうだが、X2Goするのは絶望的。vncは入れられたが、ウィンドウマネジャのopenboxはソースから入れた。)
0. Development toolsのインストール
yum groupinstall "Development Tools"
0.1 timezoneの設定
(参照: http://qiita.com/nikuruyo/items/19504660c50efe3c24c2)
/etc/sysconfig/clock で、ZONE="Asia/Tokyo"
ln -sf /usr/share/zoneinfo/Japan /etc/localtime
1.qflow 1.1
http://opencircuitdesign.com/qflow/archive/qflow-1.1.74.tgz をダウンロード
./configureすると、すぐにyosysなどを先にインストールする必要があるとわかる
2.yosys (含 abc)
http://www.clifford.at/yosys/download.html にしたがってyosys 0.7をインストール
UbuntuにはPPAがあるが、Amazon Linuxなのでソースからbuild
git clone https://github.com/cliffordwolf/yosys.git
cd yosys
make config-clang
makeのためには、tclsh,tcl.h, clang, readline/readline.hが必要なので、yum install tcl-devel clang, readline-devel
ここで、python3が必要と来た!
2.1 python3のインストール http://qiita.com/KeijiYONEDA/items/f9cf37cfc359aa893797
yum install python35
2.2 再度makeで、以下のエラー。原因は、bison (2..7)ではバージョンが古いらしい
frontends/verilog/verilog_parser.y:142.9-19: %define variable `parse.error' is not used make: *** [frontends/verilog/verilog_parser.tab.cc] Error 1
対策は、https://www.reddit.com/r/yosys/comments/6j163z/parseerror_error_in_yosys_installation/ に書いているように、
yosys/frontends/verilog/verilog_parser.y で、以下のように2つのdefineをコメントアウトする
/* %define parse.error verbose %define parse.lac full */
2.3 fatal error: 'ffi.h' file not found のエラーの対策: yum install libffi-devel
後知恵: https://github.com/cliffordwolf/yosys に必要なものが書いているので、先にこちらを見るべき
make config-clangでは、 コンパイルが 59%まで行ったところで、clang: error: unable to execute command: Aborted
となる。なので、make config-gccを試す
コンパイルは100%まで行ったが、hg: コマンドが見つかりません とのエラー
2.4 hg cloneできるようにするために、Mercurialインストール
yum install git-hg
無事、hg cloneができて、ABCがインストールされる
2.5 make installすると、iverilogのインストールが必要なこと判明
git clone https://github.com/steveicarus/iverilog.git
cd iverilogして、autoconf 実行
gperfが必要なので、yum install gperf
make & make install
/usr/local/bin/iverilogにインストールされることに注意
yosysのmake testでは、iverilogを使うので、export PATH=/usr/local/bin:$PATH し、make test
make install で、yosysも /usr/local/binにインストールされる
3.Graywolf (Timberwolfのフォーク)
https://github.com/rubund/graywolf からインストール
git clone https://github.com/rubund/graywolf.git
cmakeを使ってるので、まず yum install cmake
libgclが必要なので、yum install gsl-devel
cmake . を実行
X11/Xlib.h が必要なので、yum install libX11-devel
make & make install
注: http://opencircuitdesign.com/qflow/index.html には、graywolfにパッチをあてよと書いてるが、it is recommended to simply update graywolf from the git repositoryともあるので、パッチかけずに行く。
4.qrouter 1.3
wget http://opencircuitdesign.com/qrouter/archive/qrouter-1.3.91.tgz
tk.hが必要なので、yum install tk-devel できないか調べたが、Amazon Linuxは基本Desktopは使わせない姿勢なので、tkは
提供されない。 see https://forums.aws.amazon.com/thread.jspa?threadID=120593
CentOS6のrepoからtkを入れる方法は、https://hacknote.jp/archives/3820/ にかかれているが、ここはソースから入れることにする
4.1 tkをソースからインストール
8.5が推奨なので、以下をget
wget ftp://ftp.tcl.tk/pub/tcl/tcl8_5/tk8.5.19-src.tar.gz
tar xzfして、
cd tk8.5.19/unix/
make & make install
4.2 libXt-devel が必要なので、yum install libXt-devel
make & make install
5.magic 8.1
wget http://opencircuitdesign.com/magic/archive/magic-8.1.185.tgz
cshが必要なので、yum install csh
注: m4は入っていた。ncurses-devel(ubuntuではlibncurses-dev)も入っていた
configure すると、OpenGL:noとなるが、ビデオカードはないので仕方ない。
make & make install
(ここまでで、10Gディスクの使用量は、13% → 37%、make cleanしまくったら 27%まで落ちた)
6.netgen
wget http://opencircuitdesign.com/netgen/archive/netgen-1.4.81.tgz
tar xzf netgen-1.4.81.tgz
cd netgen-1.4.81/
./configure
make && make install
7.dinotrace
wget https://www.veripool.org/ftp/dinotrace-9.4e.tgz
tar xzf dinotrace-9.4e.tgz
cd dinotrace-9.4e/
./configure
ここで、/root/dinotrace-9.4e/src/dinotrace.h:101:19: fatal error: Xm/Xm.h: No such file or directory
となったので、motifのdevelが必要とわかる。さいわいopenmotif-develはAmazon Linuxでも提供されていた(消し忘れ?)。
yum install openmotif-devel
./configureしなおして、make&&make install
8.irsim
wget http://opencircuitdesign.com/irsim/archive/irsim-9.7.98.tgz
tar xzf irsim-9.7.98.tgz
cd irsim-9.7.98/
./configure
make && make install
9. ngspice-2.7 (XSPICEをenableする)
wget https://sourceforge.net/projects/ngspice/files/ng-spice-rework/27/ngspice-27.tar.gz
展開し、cdし、./configure したところで、Couldn't find Xaw libraryのエラーなので、
yum install libXaw-devel
気をとりなおして、
./configure --enable-xspice
make && make install
(この時点で、10Gディスクの使用量は、36%)
実行
http://opencircuitdesign.com/qflow/index.html のexampleを実行
~/work/proj を作成し、export project_dir=~/work/proj
その下に、source, synthesis, layout を作成
qflow synthesize place route map9v3 を実行
1. sudo ln -s /usr/local/bin/yosys /usr/local/share/qflow/bin/yosys する必要あった。
qflowをmake installしなおしても状況変わらず。これだけではなかったので結局、/usr/local/share/qflow/bin/*をすべて/usr/local/bin/にコピーし、ln -s /usr/local/bin /usr/local/share/qflow/bin した。
2./usr/local/share/qflow/scripts/ypostproc.tcl で、最初の行が #!tclshとなっているのを、#!/usr/bin/tchshに書き換える必要あった
そのほか、blif2cel.tclも同様。 -> インストール方法にも問題があるのか、原因を突き止める必要あり。とりあえず、全部#!/usr/bin/tchshに書き換える。
3.qrouterの前に、/usr/local/share/qrouter/qrouternullg: error while loading shared libraries: libtk8.5.so: cannot open shared object file: No such\
file or directory
というエラー
ldd /usr/local/share/qrouter/qrouternullgで調べると確かに。
linux-vdso.so.1 => (0x00007ffd35ff3000)
libtk8.5.so => not found
仕方ないので、export LD_LIBRARY_PATH=/usr/lib すると、解決した。
4. netgenを実行すると以下のようにMISMATCHとなった(原因不明)
Circuit 1 contains 206 elements, Circuit 2 contains 206 elements.
Circuit 1 contains 228 nodes, Circuit 2 contains 220 nodes. *** MISMATCH ***
5. irsimを実行すると、以下のメッセージがでて、dp,counter,srが ???と表示されているので、修正が必要と思われる。
There are too many transistors in parallel (> 30)
Simulation results may be inaccurate, to fix this you may have to
increase this limit in 'conn_list.c'.
Note: This condition often occurs when Vdd or Gnd are not connected
to all cells. Check the vicinity of the following 2 nodes:
DFFSR_6/S
DFFSR_22/a_488_24#