systemverilog语法


1. assertion

assertion相关的 |->和 |=>的区别:

sequence_expr |-> property_expr : the end of sequence_expr is the start of property_expr.

sequence_expr |=> property_expr : the start of property_expr is 1 clock tick after the end of sequence_expr.

 

##0 indicates the beginning of the second sequence is the end of the first sequence.

##1 indicates the beginning of the second sequence is 1 clock tick later than the end of the first sequence.

seq1 ##[m:n] seq2 means seq2 must be true between m ~ n clock tick later than seq 1 is true.

$ means t the end of simulation.

 

intersect: seq1 intersect seq2, means seq1 and seq2 match at the same time.

throughout: exp1 throughout seq2, means exp1 must be true when seq2 is matched.

within: seq1 within seq2, means seq 1 must be matched during the period when seq2 is true.

2. rand

rand constraint

class A;

  rand v;

  constraint c_v{ v inside {0,1};}

endclass

A a;

a.c_v.constraint_mode(0); // 0-disable the rand constraint c_v.

 

%d 以及 %D 以十进制格式输出

%b 以及 %B 以二进制格式输出

%o 以及 %O 以八进制格式输出

%h 以及 %H 以十六进制格式输出

%s 以及 %S 以字符串格式输出

%c 以及 %C 以ASCII码格式输出

%v 以及 %V 输出线网类型变量的强度

%m 以及 %M 输出层次名

%t 以及 %T 以当前时间格式输出

%e 以及 %E 以指数表示方式输出实数(real型)

%f 以及 %F 以十进制数表示方式输出实数(real型)

%g 以及 %G 以十进制数或者以指数表示方式输出实数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM