Posts Issued on April 23, 2021

posted by sakurai on April 23, 2021 #388

Bluesimシミュレーション

Bluesimを実行する場合には上位モジュールは必要ありません。BSVソース中にはクロックもリセットもありませんが、シミュレーション環境により自動的にクロックとリセットが与えられ、シミュレーションが実行されます。

Bluesim実行コマンドは以下のとおりです。

$ bsc -sim testFSM.bsv
Elaborated module file created: testFSM.ba
$ bsc -sim -e testFSM -o testFSM Bluesim object created: testFSM.{h,o}
Bluesim object created: model_testFSM.{h,o}
Simulation shared library created: testFSM.so
Simulation executable created: testFSM

これを実行すると、

\$ ./testFSM
Counter = 0, State: IDLE
Counter = 1, State: STEP1
Counter = 2, State: STEP1
Counter = 3, State: STEP1
Counter = 4, State: STEP1
 (中略)
Counter = 96, State: STEP1
Counter = 97, State: STEP2
Counter = 98, State: STOP
Counter = 99, State: IDLE
Counter = 100, State: IDLE
Done

のように表示され、FSMが動作したことが分かります。


左矢前のブログ 次のブログ右矢