Article #388

既に発行済みのブログであっても適宜修正・追加することがあります。
We may make changes and additions to blogs already published.
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が動作したことが分かります。


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

Leave a Comment

Your email address will not be published.

You may use Markdown syntax. If you include an ad such as http://, it will be invalidated by our AI system.

Please enter the numbers as they are shown in the image above.