「Verilog システムタスク」の編集履歴(バックアップ)一覧に戻る

Verilog システムタスク - (2010/11/08 (月) 21:18:55) のソース

[[引用元 Verilog Quick Reference>http://www.asic-world.com/verilog/vqref1.html#Verilog_Quick_Reference]]
ろくに検証していないものがほとんど
**シュミレーションコントロール
|''$stop''|一時停止|
|''$finish''|シュミレーション終了|
**シュミレータ表示制御
|''$display''[defbase]([fmtstr,] {expr,});|文字を出力した後改行する [[フォーマット指示子はここが詳しい>http://www14.atwiki.jp/dmori/pages/16.html]]|
|''$write''[defbase] ([fmtstr,] {expr,});|文字を出力。改行なし|
|''$strobe''[defbase] ([fmtstr,] {expr,});||
|''$monitor''[defbase] ([fmtstr,] {expr,});|観測する信号を追加|
**ファイルI/O
|''$fopen''("ファイル名")|ファイルを開く、ファイル変数を返す。&br()例: integer fileno = $fopen("filename")|
|''$fclose''(fileno);|ファイルを閉じる &br()''$fclose''が実行されなければファイルはシュミレーション終了時に自動的に閉じられる|
|''$readmemb''(“ファイル名”, ID [, startadd [, stopadd]]);|2進数表記のデータを読み込む|
|''$readmemh''(“ファイル名”, ID [, startadd [, stopadd]]);|16進数表記のデータを読み込む|
|''$sreadmemb''(ID, startadd, stopadd {, string});||
|''$sreadmemh''(ID, startadd, stopadd {, string});||
|''$fdisplay''[defbase] (fileno, [fmtstr,] {expr,});|$displayのファイル版|
|''$fwrite''[defbase] (fileno, [fmtstr,] {expr,});|$writeのファイル版|
|''$fmonitor''(fileno, [fmtstr,] {expr,});||
**シュミレーション時間
|''$time''|シュミレーション時刻をTIME型で返す|
|''$stime''|シュミレーション時刻をintegerで返す|
|''$realtime''|シュミレーション時刻をREAL型で返す|
|''$scale''(hierid)|Scale “foreign” time value|
|''$printtimescale''[(path)]|Display time unit & precision|
|''$timeformat''(unit#, prec#, “unit”, minwidth)|Set time %t display format|
**その他
|''$random''[(ID)]|ランダムに値を生成|
|''$getpattern''(mem)|Assign mem content|
|''$rtoi''(expr)|realをintegerに変換|
|''$itor''(expr)|integerをrealに変換|
|''$signed''(expr)|符号付きに変換|
|''$unsigned''(expr)|符号無しに変換|

**表記
|expr|式|
|fileno|ファイル変数|
|string|文字列|
目安箱バナー