ハードウェアの気になるあれこれ

技術的に興味のあることを調べて書いてくブログ。主にハードウェアがネタ。

RISC-Vの実装の1つ - SCR1の解析 - Vivadoプロジェクト準備(2)

スポンサーリンク

前回の記事では、Vivadoプロジェクトを立ち上げて、SCR1の合成環境を整えた。

tech-diningyo.hatenablog.com

そのあと、シミュレーションを実行したら、エラーが出たので要解析、、という状況であったので、その続き。

エラーの解析

というわけでエラーメッセージを再度チェック。

ERROR: [VRFC 10-2063] Module not found while processing module instance [/home/dnn-admin/workspace/hw/study/fpga-scr1/scr1/src/pipeline/scr1_pipe_brkm.sv:794]
ERROR: [VRFC 10-1040] module scr1_pipe_dbga_default ignored due to previous errors [/home/dnn-admin/workspace/hw/study/fpga-scr1/scr1/src/pipeline/scr1_pipe_dbga.sv:11]
ERROR: [VRFC 10-1040] module scr1_tapc_shift_reg(SCR1_WIDTH=32'b01,SCR1_RESET_VALUE=1'b0) ignored due to previous errors [/home/dnn-admin/workspace/hw/study/fpga-scr1/scr1/src/core/scr1_tapc_shift_reg.sv:9]
ERROR: [VRFC 10-1040] module scr1_tapc_data_reg(SCR1_WIDTH=32'b01,SCR1_RESET_VALUE=1'b0) ignored due to previous errors [/home/dnn-admin/workspace/hw/study/fpga-scr1/scr1/src/core/scr1_tapc_data_reg.sv:9]
ERROR: [XSIM 43-3322] Static elaboration of top level Verilog design unit(s) in library work failed.

エラーとしては5つ出ているけど、頭の1つが原因で後続の4つが出ている状況の模様。
ただ、モジュールが見つからないとのことだが、合成は通っているのでファイルの不足ではない。
ということで、コンパイルの順番を疑って見ていく。

f:id:diningyo-kpuku-jougeki:20180818182536p:plain

SCR1は、上記画像中の"scr1_arch_description.svh"というファイルでSCR1のコンフィグレーションを変更できるようになっている。
上記でエラーと”scr1_pipe_brkm.sv”や"scr1_brkm_matcher"はarch_descriptionから判断するにbreakpoint module。
ブレークポイントに関するモジュールを使用するかどうかもdefineで切り替えることができる。
bkrmが入っている2つのファイルの間にarch_descriptionが入っているのがどうも怪しいので、コンパイル順を変更する。
arch_descriptionはdefineでコアの構成を決めているので最初に読み込まれるべきなのでそのように変更。
#もともと、ヘッダとして扱われるべきファイルをsystem verilogとして登録したので、明確にコンパイル対象となったのがそもそもの原因の様子。

f:id:diningyo-kpuku-jougeki:20180818183348p:plain

再度シミュレーションを実行、、、と今度はelaborationは通過した。

Vivado Simulator 2017.4
Copyright 1986-1999, 2001-2016 Xilinx, Inc. All Rights Reserved.
Running: /opt/Xilinx/Vivado/2017.4/bin/unwrapped/lnx64.o/xelab -wto 0e6fead3633f402a8a5bfc48c6ea3f43 --incr --debug typical --relax --mt 8 -d SCR1_SIM_ENV= -L xil_defaultlib -L unisims_ver -L unimacro_ver -L secureip --snapshot scr1_top_tb_axi_behav xil_defaultlib.scr1_top_tb_axi xil_defaultlib.glbl -log elaborate.log
Using 8 slave threads.
WARNING: [XSIM 43-3431] One or more environment variables have been detected which affect the operation of the C compiler. These are typically not set in standard installations and are not tested by Xilinx, however they may be appropriate for your system, so the flow will attempt to continue. If errors occur, try running fuse with the "-mt off -v 1" switches to see more information from the C compiler. The following environment variables have been detected:
Starting static elaboration
Completed static elaboration

、、、が、その先でエラーが。。。

Compiling module xil_defaultlib.scr1_tapc_shift_reg(SCR1_WIDTH=3...
Compiling module xil_defaultlib.scr1_dbgc
Compiling module xil_defaultlib.scr1_core_top
Compiling module xil_defaultlib.scr1_dp_memory_default
Compiling module xil_defaultlib.scr1_tcm
Compiling module xil_defaultlib.scr1_timer
Compiling module xil_defaultlib.scr1_imem_router(SCR1_ADDR_PATTE...
Compiling module xil_defaultlib.scr1_dmem_router(SCR1_PORT1_ADDR...
Compiling module xil_defaultlib.scr1_mem_axi_default
Compiling module xil_defaultlib.scr1_top_axi
Compiling module xil_defaultlib.scr1_memory_tb_axi_default
ERROR: [XSIM 43-3316] Signal SIGSEGV received.

いや、SIGSEGVて。。。
未だ実行できず、次回に続く。。