Specman elite e-language generates the fields based on the Order of declaration.
Consider an example, which illustrates the order of generation.
Ex: <’
type packet_kind_t: [Small, Medium, Large];
struct packet_s {
Kind: packet_kind_t;
Address: uint (bits: 32);
keep Kind = = Small => Address < 40; };
‘>
The above example explains that the packet_kind_t (kind) of enumerated type is generated first followed by address.The constraints definition says if the kind is Small in nature then generate address below 40.
Suppose, unknowingly if the address is declared first followed by Kind then the above constraint statement doesn’t hold good.
In order to achieve the same result, add an explicit generation order constraint supported by Specman Elite e-language.
The below example shows the constraints for such Operation.
Syntax:
keep soft gen (control- field) before (control –field);
Ex: <’
type packet_kind_t: [Small, Medium, Large];
struct packet_s {
Address: uint (bits: 32);
Kind: packet_kind_t;
keep Kind = = Small => Addr < 40;
keep soft gen (Kind) before (Address); };
‘>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment