OpenSPARCの調査を引き続き行っている。前回のファイルリストを加工するために、OpenSPARCのシミュレーションスクリプトsims
をどうにかこうにか動かしながら、cmp1(SPARCコア1つ)を動作させるためのファイルリストを作った。
ちなみに、sims
はOpenSPARCのシミュレーションを動作させるためのスクリプトなのだが、VCSが前提だったり、VERAというSynopsysのツールが必要だったりして到底個人では動かせないので、ファイルリストだけ作成してModelSimに突っ込むという作戦に出ている。
vlog -incr -mfcu -work worklib -f ../model/cmp1/rel-0.1/flist_compiled | tee vlog.log vsim -l vsim.log +nowarn3040 -novopt -gui -voptargs="+acc" worklib.tb_top -do "do ./sim.tcl"
とりあえずエラーなしでシミュレーションを開始させるところまで動くようになったが、肝心のプログラムがうまく動かない。
というか、命令フェッチがどのユニットから出てくるのかまったく分からないので、hexファイルをどこに格納すればよいのかも分からないし、どこかリセットを制御しなければいけないのか、マニュアルを読んでも良く分からない。
マニュアルでは、sims
を使ってリグレッションを動作させるようになっているので、VCS等のツールが動かせないと難しいなあ。
全く、フリーでVerilogを公開してるんだから、フリーのシミュレータでも動かせるようにしてくれればいいのに。。。
今のところ以下のような感じ。なんだかいろいろ情報は出ているが、肝心の命令フェッチが出てくれないので、もうちょっと調査する必要がある。
# do ./sim.tcl # arg 0The VERILOG random generator initial seed is 1 (should match VERA) # arg 0------------------------------- # arg 0!!!!! !!!!! # arg 0!!!!! !!!!! # arg 0 Nas Checking Disabled # arg 0!!!!! !!!!! # arg 0!!!!! !!!!! # arg 0------------------------------- # arg 0NOTICE - Nas Q Rate is 20 # arg 0NOTICE - tlb_sync Disabled # arg 0NOTICE - icache_sync Disabled # arg 0NOTICE - ldst_sync Disabled # arg 0NOTICE - int_sync Disabled # arg 0NOTICE - err_sync Disabled # arg 0dma_memchk Disabled # arg 0soc_sync Enabled # arg 0lsu_mon Enabled # arg 0NOTICE - Global Chkr Enabled. # arg 0Initial Thread Check Control (may change if SW startup): 0000000000000001 (th_check_enable/+thread) # arg 0Thread Finish Mask, adjusted: 0000000000000001 (finish_mask/+finish_mask) # arg 0 # arg 0!!! BE AWARE - timeout values are in # of Cycles, NOT # of ps/fs units # arg 0Max Cycles 1000000 Cycles (Timeout if simulation reaches this cycle count) # arg 0Global Timeout 1000 Cycles (Timeout if ALL threads are idle (i.e. no SSTEP)) # arg 0Thread Timeout 5000 Cycles (Timeout if ANY thread is idle (i.e. no SSTEP)) # arg 0Socket Timeout 5000 Cycles (Timeout if no socket msg from Riesling) # arg 0 # arg 48WARNING - No good_trap address found! # Simulation may not terminate! # # arg 48WARNING - No bad_trap address found! # Simulation may not terminate! # # ** Error (suppressible): (vsim-12023) ../verif/env/cmp/../common/verilog/misc/misc_tasks.v(59): Cannot execute undefined system task/function '$enable_dispmon_finish' # top 0If you build with -vcs_build_args=+define+RELEASE1=a+RELEASE2=nnn you will see your CDMS release version as: a.nnn # top 0Running with build CDMS release version: UNKNOWN # top 0------------BUILD_CMD----------- # # Sims Build Cmd: -sys=cmp1 -vcs_build # # top 0--------------------------------- # # top 0------------BUILD_ARGS----------- # # Sims Build Args: -config_rtl CMP1 -config_rtl RTL_NO_SPC7 -config_rtl RTL_NO_SPC6 -config_rtl RTL_NO_SPC5 -config_rtl RTL_NO_SPC4 -config_rtl RTL_NO_SPC3 -config_rtl RTL_NO_SPC2 -config_rtl RTL_NO_SPC1 -config_rtl CORE_0 -config_rtl ZIN_CORE_SUBSET -config_rtl CORE_BENCH -config_rtl CMP_BENCH -config_rtl CMP -vcs_build_args -v $DV_ROOT/libs/cl/cl_rtl_ext.v -v $DV_ROOT/libs/cl/cl_dp1/cl_dp1.v -v $DV_ROOT/libs/cl/cl_u1/cl_u1.v -v $DV_ROOT/libs/cl/cl_sc1/cl_sc1.v -v $DV_ROOT/libs/cl/cl_a1/cl_a1.v -v $DV_ROOT/libs/cl/cl_mc1/cl_mc1.v -vcs_build_args +rad -vcs_build_args -Xstrict=0x1 -syslib -lpthread +nbaopt -O4 -cc gcc -cpp g++ -ld g++ -vcs_build_args -Mupdate -vcs_build_args +notimingcheck -vcs_build_args +nospecify -vcs_build_args +delay_mode_zero -vcs_build_args +define+TOP=tb_top -vcs_build_args +define+LIB -vcs_build_args +define+INITLATZERO -vcs_build_args $DV_ROOT/verif/env/common/pli/global_chkr/libglobal_chkr.a -vcs_build_args $DV_ROOT/verif/env/common/pli/socket/libsocket_pli.a -vcs_build_args $DV_ROOT/verif/env/common/pli/monitor/libmonitor_pli.a -vcs_build_args -P $DV_ROOT/verif/env/common/pli/global_chkr/global_chkr.tab -vcs_build_args -P $DV_ROOT/verif/env/common/pli/socket/socket_pli.tab -vcs_build_args -P $DV_ROOT/verif/env/common/pli/monitor/monitor_pli.tab # # top 0--------------------------------- # # top 30core and regreport clock period: 100 units
波形は取れるようになったが、イマイチだなあ。。。