<' struct constrain_gen_ex1 { // Explicit constrains x : int[1,3,5,10..100]; // is the same as x : int; keep x in [1,3,5,10..100]; // Implicit Constrains l[20] : list of int; // is the same as l : list of int; keep l.size()==20; // Value constraints // Limits the address from 0 to 1024 addr : uint[0..1k]; // Read = 0 and Write = 1 rd_wr: bool; // Weights for rd_wr command rd_wt: uint[0..100]; wr_wt: uint[0..100]; // Order of generation is different // rd_wr was declared before rd_wt and wr_wt keep gen (rd_wt, wr_wt) before (rd_wr); // Generation based on weight // Soft Constrain keep soft rd_wr == select { wr_wt : TRUE; rd_wt : FALSE; }; // Hard constraint data : uint; keep data != 0xdeadbeaf; // List constraint Example payload : list of byte; keep payload.size() < 10; }; '>