VOOZH about

URL: https://qiita.com/tethys_seesaa/items/c0ebee313e61aed17a3f

⇱ [SystemVerilog]svlibがバージョンアップしてた。 #Verilog - Qiita


👁 Image
1

Go to list of users who liked

0

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@tethys_seesaa

[SystemVerilog]svlibがバージョンアップしてた。

1
Last updated at Posted at 2014-06-17

はじめに

なんとなくVerilab社のサイト眺めてたら、10日強前にsvlibが0.3バージョンアップしてた。
ちょっと試してみることにした。

前のバージョンとの差異

けっこうなメソッドが盛られている。ただし、ドキュメントに履歴が無いのでよくわからない。以前紹介した記事はこちら。
ここではドキュメントで新規に追加された「Simlation Environment Queries」を試してみる。

Simlation Environment Queries

クラスはこんな感じで定義されている。

class Simulator extends svlibBase;
 static function string getToolName();
 static function string getToolVersion();
 static function qs getCmdLine();
endclass

functionの名前にある通り、シミュレーターの名前やバージョン、今走っているコマンドの引数とかをゲットすることができる。
「qs」という型はsvlibで定義されているもので、string型のqueueである。

でかいチップの開発だと、シミュレーションコマンドはシェルスクリプトやperlでラップされててわからないときがあるかもしれないこので、getCmdLine()は重宝するかもしれない。

サンプル

tb.sv
`timescale 1ns/1ps

`include "svlib_macros.svh"

module tb ();

 import svlib_pkg::*;

 string c[$];

 initial begin

 $display("%s", Simulator::getToolName());
 $display("%s", Simulator::getToolVersion());

 c = Simulator::getCmdLine();

 do
 $display("%s", c.pop_front());
 while(c.size()!=0);

 $finish(1);

 end

endmodule

これを実行すると、シミュレータ名、バージョン、コマンドオプションが出力される。

おわりに

getToolVersion()は、シミュレーターのバージョンによって処理を替えるとか使えるかもしれない。でも返してくるのはstringなのでatoiとかいろいろ付け加える必要があるかも。

ウソでした。EDA Playgroundで動くので、Modelsim-ASEでもいけます。

svlib 0.3 and ClueLib 0.2.0 SystemVerilog utility libraries are now on EDA Playground.

— EDA Playground (@EDAPlayground) 2014, 6月 18
1

Go to list of users who liked

0
0

Go to list of comments

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1

Go to list of users who liked

0