RISC-V(SCR1)のRTLシミュレーションを試してみた
次に以下コンパイラインストールの続きで適当なRISC-VプロジェクトをcloneしてRTLシミュレーションを実施してみる。
今回は公式ドキュメントが特に詳しく、知名度も高いSCR1を使用してサンプル実行まで確認してみることにした。
前回: RISC-Vのコンパイラインストールについて - moamoa diary
環境: MacOS(10.14.2)
RTLシミュレータ: verilator
veriatorインストール
brew install verilatorSCR1をクローン
GitHub - syntacore/scr1: SCR1 is a high-quality open-source RISC-V MCU core in VerilogMakefileを編集(今回は単純にサンプル(vectored_isr_sample)のみを実行)
↓のMakefile変更例を参照シミュレーション実行
make run_verilator
--> 「Test passed」と表示されればOK
Makefile変更例
diff --git a/Makefile b/Makefile
index 01f7c01..d855a00 100644
--- a/Makefile
+++ b/Makefile
@@ -74,23 +74,24 @@ export rtl_tb_files := ahb_tb.files
export top_module := scr1_top_tb_ahb
endif
#--
-ifeq (,$(findstring e,$(ARCH_lowercase)))
-ifeq (,$(findstring 0,$(IPIC)))
-# comment this target if you don't want to run the vectored_isr_sample
TARGETS += vectored_isr_sample
-endif
-ifneq (,$(findstring m,$(ARCH_lowercase)))
-# comment this target if you don't want to run the riscv_isa
-TARGETS += riscv_isa
-endif
-# comment this target if you don't want to run the riscv_compliance
-TARGETS += riscv_compliance
-endif
-
-# comment this target if you don't want to run the coremark
-TARGETS += coremark
-# comment this target if you don't want to run the dhrystone
-TARGETS += dhrystone21
+# ifeq (,$(findstring e,$(ARCH_lowercase)))
+# ifeq (,$(findstring 0,$(IPIC)))
+# # comment this target if you don't want to run the vectored_isr_sample
+# endif
+
+# ifneq (,$(findstring m,$(ARCH_lowercase)))
+# # comment this target if you don't want to run the riscv_isa
+# TARGETS += riscv_isa
+# endif
+# # comment this target if you don't want to run the riscv_compliance
+# TARGETS += riscv_compliance
+# endif
+#
+# # comment this target if you don't want to run the coremark
+# TARGETS += coremark
+# # comment this target if you don't want to run the dhrystone
+# TARGETS += dhrystone21
# Targets