Vengineerの戯言

人生は短いけど、長いです。人生を楽しみましょう!

SiliconCompilerのデモであるZeroSoCをビルドしてみた

はじめに

SiliconCompilerのデモとしての ZeroSoCのビルドをトライアルしました。

  • ZeroSoC consists of an Ibex core, UART and GPIO peripherals from the OpenTitan project, and 8 KB of RAM.

SIlicomCompilerの他に、

  • magic
  • netgen
  • sv2v : SystemVerilog の記述を Verilog HDL の記述に変換する

が必要のようです。

Magic VLSI (magic)

csh が必要なので、"sudo apt install csh" でインストールしておく。

git clone git://opencircuitdesign.com/magic
cd magic
./configure --prefix=/usr/local
make
sudo make install

Netgen (netgen)

git clone git://opencircuitdesign.com/netgen
cd netgen
./configure --prefix=/usr/local
sudo make install

sv2v

事前に、Haskell Tool Stack をインストールし、下記のコマンドでビルド

git clone https://github.com/zachjs/sv2v.git
cd sv2v
make

ZeroSoCのセットアップ

git clone git@github.com:siliconcompiler/zerosoc.git
cd zerosoc
git submodule init
git submodule update
pip install -r python-requirements.txt

にて、インストール

サンプルの実行

time python build.py
.
.
.
design : asic_top
params : None
jobdir : /mnt/c/Users/haray/home/siliconcompiler/zerosoc/build/asic_top/job0
foundry : skywater
process : skywater130
targetlibs : sky130hd

                 import0    export0      syn0    extspice0     drc0       lvs0
 errors             0          0          0          0          0        19536
 warnings           0          0          4          0          0          0
 drvs               0          0          0          0          0          0
 unconstrained      0          0          0          0          0          0
 coverage          0.0        0.0        0.0        0.0        0.0        0.0
 security          0.0        0.0        0.0        0.0        0.0        0.0
 luts               0          0          0          0          0          0
 dsps               0          0          0          0          0          0
 brams              0          0          0          0          0          0
 cellarea          0.0        0.0        0.0        0.0        0.0        0.0
 totalarea         0.0        0.0        0.0        0.0        0.0        0.0
 utilization       0.0        0.0        0.0        0.0        0.0        0.0
 peakpower         0.0        0.0        0.0        0.0        0.0        0.0
 standbypower      0.0        0.0        0.0        0.0        0.0        0.0
 irdrop            0.0        0.0        0.0        0.0        0.0        0.0
 holdslack         0.0        0.0        0.0        0.0        0.0        0.0
 holdwns           0.0        0.0        0.0        0.0        0.0        0.0
 holdtns           0.0        0.0        0.0        0.0        0.0        0.0
 holdpaths          0          0          0          0          0          0
 setupslack        0.0        0.0        0.0        0.0        0.0        0.0
 setupwns          0.0        0.0        0.0        0.0        0.0        0.0
 setuptns          0.0        0.0        0.0        0.0        0.0        0.0
 setuppaths         0          0          0          0          0          0
 cells              0          0          53         0          0          0
 registers          0          0          0          0          0          0
 buffers            0          0          0          0          0          0
 transistors        0          0          0          0          0          0
 nets               0          0          0          0          0          0
 pins               0          0          0          0          0          0
 vias               0          0          0          0          0          0
 wirelength        0.0        0.0        0.0        0.0        0.0        0.0
 overflow           0          0          0          0          0          0
 runtime           1.59       2.2        3.24       7.07       1.65      30.61
 memory            0.0        0.0        0.0        0.0        0.0        0.0
---------------------------------------------------------------------------------------------------------------------------------------

real    6m21.447s
user    22m46.440s
sys     0m30.325s
time python build.py --core-only

real    6m56.970s
user    21m2.668s
sys     0m21.680s

エラーなしに終了。

ohがなくなるので、シンボリックリンクしておく

ln -s ../oh oh
time python build.py --top-only
.
.
.
design : asic_top
params : None
jobdir : /mnt/c/Users/haray/home/siliconcompiler/zerosoc/build/asic_top/job0
foundry : skywater
process : skywater130
targetlibs : sky130hd

                 import0    export0      syn0    extspice0     drc0       lvs0
 errors             0          0          0          0          0        19536
 warnings           0          0          4          0          0          0
 drvs               0          0          0          0          0          0
 unconstrained      0          0          0          0          0          0
 coverage          0.0        0.0        0.0        0.0        0.0        0.0
 security          0.0        0.0        0.0        0.0        0.0        0.0
 luts               0          0          0          0          0          0
 dsps               0          0          0          0          0          0
 brams              0          0          0          0          0          0
 cellarea          0.0        0.0        0.0        0.0        0.0        0.0
 totalarea         0.0        0.0        0.0        0.0        0.0        0.0
 utilization       0.0        0.0        0.0        0.0        0.0        0.0
 peakpower         0.0        0.0        0.0        0.0        0.0        0.0
 standbypower      0.0        0.0        0.0        0.0        0.0        0.0
 irdrop            0.0        0.0        0.0        0.0        0.0        0.0
 holdslack         0.0        0.0        0.0        0.0        0.0        0.0
 holdwns           0.0        0.0        0.0        0.0        0.0        0.0
 holdtns           0.0        0.0        0.0        0.0        0.0        0.0
 holdpaths          0          0          0          0          0          0
 setupslack        0.0        0.0        0.0        0.0        0.0        0.0
 setupwns          0.0        0.0        0.0        0.0        0.0        0.0
 setuptns          0.0        0.0        0.0        0.0        0.0        0.0
 setuppaths         0          0          0          0          0          0
 cells              0          0          53         0          0          0
 registers          0          0          0          0          0          0
 buffers            0          0          0          0          0          0
 transistors        0          0          0          0          0          0
 nets               0          0          0          0          0          0
 pins               0          0          0          0          0          0
 vias               0          0          0          0          0          0
 wirelength        0.0        0.0        0.0        0.0        0.0        0.0
 overflow           0          0          0          0          0          0
 runtime           1.23       1.29       1.86       5.44       1.1       29.09
 memory            0.0        0.0        0.0        0.0        0.0        0.0
---------------------------------------------------------------------------------------------------------------------------------------

real    0m41.210s
user    0m32.279s
sys     0m7.499s
time python build.py --fpga

FPGA用のバックエンドをインストールしていないので、ERRORになる。

time python build.py  --floorplan-only
| INFO    | job0    | ---          | -   | Loading target 'asicflow_skywater130'
| INFO    | job0    | ---          | -   | Loading function 'setup_flow' from module 'asicflow'
| INFO    | job0    | ---          | -   | Loading function 'setup_pdk' from module 'skywater130'
| INFO    | job0    | ---          | -   | Operating in 'asic' mode
| INFO    | job0    | ---          | -   | Loading target 'skywater130'
| INFO    | job0    | ---          | -   | Loading function 'setup_pdk' from module 'skywater130'
| INFO    | job0    | ---          | -   | Operating in 'asic' mode

real    0m6.666s
user    0m1.313s
sys     0m1.271s

エラーなしに終わるが、何もしていなっぽい。

time python build.py  --dump-flowgraph

real    0m3.160s
user    0m0.625s
sys     0m0.923s

dot コマンドがないので、"sudo apt-get install graphviz" にてインストール後、実行する。特に、何もしていない?

KLayout を起動

build.py の run_build メソッドの最後にchip.show() を追加した、KLayout を起動してみた。

def run_build(chip):
    chip.run()
    chip.summary()
    chip.show()

asic_core の部分

f:id:Vengineer:20211215161423p:plain

asic_top の部分は、エラーになる。asic_core のみ、Klayoutで表示可能ということね。

同じことは、

klayout build/asic_core/job0/export/0/outputs/asic_core.gds

で、できた

おわりに

とりあえず、ZeroSoC のビルドは、できました。