トップ 一覧 Farm 検索 ヘルプ RSS ログイン

Diary/2023-12-17の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!QuickLogicで
遊んでみようと思ったけど,ダメだった.

:: メモ

* トップページ https://www.quicklogic.com/products/eos-s3/quickfeather-development-kit/
* UG https://github.com/QuickLogic-Corp/quick-feather-dev-board/blob/master/doc/QuickFeather_UserGuide.pdf
* Symbiflow https://quicklogic-fpga-tool-docs.readthedocs.io/en/latest/index.html
* https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain をやってみる.

:: セットアップ

 chmod 755 Symbiflow-v1.3.2.gz.run
 export INSTALL_DIR=/home/miyo/tools/Symbiflow/
 bash Symbiflow-v1.3.2.gz.run

:: サンプル

 export INSTALL_DIR=/home/miyo/tools/Symbiflow
 export PATH=$INSTALL_DIR/quicklogic-arch-defs/bin:$INSTALL_DIR/quicklogic-arch-defs/bin/python:$PATH
 source $INSTALL_DIR/conda/etc/profile.d/conda.sh
 conda activate

でサンプルをビルドしてみる
 cd $INSTALL_DIR/quicklogic-arch-defs/tests/counter_16bit
 ql_symbiflow -synth -d ql-eos-s3 -t top -v counter_16bit.v -p chandalar.pcf -P PD64

やってみると,↓とかいってエラー.
 ERROR: TCL interpreter returned an error: Yosys command produced an error
 make: *** [Makefile.symbiflow:20: build/top.eblif] Error 1

ログ(build/top.log)をみてみると,
 4. Executing SYNTH_QUICKLOGIC pass.
 ERROR: Can't open input file `/home/miyo/tools/Symbiflow/conda/bin/../share/quicklogic/cells_sim.v' for reading: No such file or directory
といって怒られてる.
symbiflow_synthを手でたたいてみる.
 cd build
 symbiflow_synth -t top -v ../counter_16bit.v   -d ql-eos-s3_wlcsp -p counter_16bit/chandalar.pcf -P PD64
同じように,
4. Executing SYNTH_QUICKLOGIC pass.
 ERROR: Can't open input file `/home/miyo/tools/Symbiflow/conda/bin/../share/quicklogic/cells_sim.v' for reading: No such file or directory
なるエラー.そもそも /home/miyo/tools/Symbiflow/conda/bin/../share/quicklogic/ がない.
おそらく,$INSTALL_DIR/quicklogic-arch-defs/share 以下の,
 $INSTALL_DIR/quicklogic-arch-defs/share/techmaps/quicklogic/pp3/techmap/cells_sim.v
か,
 $INSTALL_DIR/conda/share/yosys/quicklogic/cells_sim.v
を参照して欲しいんだろうな,と思う.
 $INSTALL_DIR/quicklogic-arch-defs/bin/symbiflow_synth
とかみてみると,
 MYPATH=`realpath $0`
 MYPATH=`dirname ${MYPATH}`
 
 export TECHMAP_PATH=`realpath ${MYPATH}/../share/techmaps/quicklogic/pp3/techmap`
というところがある.試しにset -xを追加してみると
 + MYPATH=/home/miyo/tools/Symbiflow/quicklogic-arch-defs/bin
と表示されるので,ここまでは問題なさそう.
というか,実行ログの上の方には,
 2. Executing Verilog-2005 frontend: /home/miyo/tools/Symbiflow/quicklogic-arch-defs/share/techmaps/quicklogic/pp3/techmap/cells_sim.v
 Parsing Verilog input from `/home/miyo/tools/Symbiflow/quicklogic-arch-defs/share/techmaps/quicklogic/pp3/techmap/cells_sim.v' to AST representation.
 ...
 Successfully finished Verilog frontend.
ってでてるな.
プログラムの実行文は,
 + yosys -p 'tcl /home/miyo/tools/Symbiflow/quicklogic-arch-defs/share/quicklogic/synth.tcl' -l top_synth.log ../counter_16bit.v
なのだけど,
 read_verilog -lib $::env(TECHMAP_PATH)/cells_sim.v
は,問題ない,ということ.で,問題は,
 synth_quicklogic -family pp3 
の中にあるのだけど,これは,簡単には手が出せそうにないなあ.
とりあえず,
 ln -s /home/miyo/tools/Symbiflow/conda/share/yosys/quicklogic /home/miyo/tools/Symbiflow/conda/share/
して,先にすすめてみた.
今度は,
 ERROR: Can't open input file `/home/miyo/tools/Symbiflow/conda/bin/../share/cmp2lut.v' for reading: No such file or directory
cmp2lut.vは,/home/miyo/tools/Symbiflow/conda/bin/../share/yosys にある.
うーん,yosysは,/home/miyo/tools/Symbiflow/conda/bin/../share じゃなくて /home/miyo/tools/Symbiflow/conda/bin/../share/yosys をみるべきなんじゃないかな.
すごく納得いかないけど,
 ln -s /home/miyo/tools/Symbiflow/conda/share/yosys/*.v /home/miyo/tools/Symbiflow/conda/share/
として再度挑戦.
 ERROR: Can't load module `./get_count': /home/miyo/tools/Symbiflow/conda/bin/../share/plugins/get_count.so: cannot open shared object file: No such file or directory
get_count.soは,/home/miyo/tools/Symbiflow/conda/share/yosys/plugins/get_count.soにある.
参照先のルートがずれてる,で間違いなさそう.これも納得いかないけど,
 ln -s /home/miyo/tools/Symbiflow/conda/share/yosys/plugins /home/miyo/tools/Symbiflow/conda/share/
して再度挑戦.
 ERROR: Can't load module `./ql-iob': /home/miyo/tools/Symbiflow/conda/bin/../share/plugins/ql-iob.so: undefined symbol: _ZN5Yosys5RTLIL4Cell8setParamENS0_8IdStringENS0_5ConstE
あ,もうダメだ,これ.

:: 自分でビルドする
https://github.com/QuickLogic-Corp/quicklogic-fpga-toolchain をやってみる.

 sudo apt install tcl-dev libreadline-dev # for my environment
 git clone https://github.com/QuickLogic-Corp/yosys.git -b quicklogic-rebased quicklogic-yosys
 cd quicklogic-yosys
 make config-gcc
 make install PREFIX='specify installation path'

途中でエラーがあったので,ちょっと修正.

 diff --git a/passes/sat/freduce.cc b/passes/sat/freduce.cc
 index 5dfd7bd3f..4ac97f852 100644
 --- a/passes/sat/freduce.cc
 +++ b/passes/sat/freduce.cc
 @@ -27,6 +27,7 @@
  #include <stdio.h>
  #include <string.h>
  #include <algorithm>
 +#include <limits>
  
  USING_YOSYS_NAMESPACE
  PRIVATE_NAMESPACE_BEGIN

で,次と思ったら,https://github.com/QuickLogic-Corp/yosys-symbiflow-plugins ないじゃん...