SV
new で生成 delete不要
task, function をメンバーに持てる
function new ();
endfunction
class 内の task は begin end なくてもよい
class 本体に書けるもの
class_property
class_method
class_constraint
class_declaration
covergroup_declaration
local_parameter_declaration
parameter_declaration
;
class A;
const int size = 8 ; // 宣言時に設定。global constant
endclass
class B;
const int size;
function new ();
size = $urandom; // new の中で設定。instance constant
endfunction
endclass
typedef class C2 ; // C2 is declared to be of type class
class C1;
C2 c;
endclass
prototype と decleration がある
constraint cid {
// items
}
// item には solve と constraint_expression がある
// expression の場合
constraint cid {
expression ; // 前に soft を付けられる
expression dist { dist_list } ; // 同上
unique { open_range_list } ;
exp -> constraint_set // set は expression やからこれは最下部にはならない
if ( exp ) constraint_set
foreach ( array [k] ) constraint_set
disable_soft constraint_primary ;
}
// dist
constraint cid {
expression dist { 5:3 }; // value range
expression dist { 5:3, 2:1 } ;
expression dist { 5:3 := exp } ;
expression dist { 5:3 /= exp } : // weight をつける
}
constraint_set は constraint_expression の繰り返し。繰り返すときは { } でくくる。ループしてる?
class の object は new を実行して始めて使える。
ポインタのように使う
継承などが使える