Previous Section Next Section

A.3 Structs and Unit Members

fields

constraints

when conditions

methods and TCMs

cover groups

events

temporal struct|unit members

preprocessor directives

A.3.1 Fields

[!][%]field-name : type; // ! = do not generate, % = physical field

field-name[n] : list of type; // creates a list with n elements

field-name : unit-type is instance; // for units only, not structs

A.3.2 Conditional Extensions using When

type enum-type: [name1, name2, ...];

struct|unit struct-type|unit-type {

field-name : enum-type;

when name1 struct-type|unit-type { additional members };

};

extend name1 struct-type|unit-type { ... };

A.3.3 Constraints

keep [soft] bool-expr; // for example, keep field1 <= MY_MAX

keep [soft] field-name in [range]; // example: keep field1 in [0..256]

keep bool-expr1 => bool-expr2; // bool-expr1 implies bool-expr2

keep [soft] field-name in list;

keep list.is_all_iterations( field-name );

keep list1.is_a_permutation( list2 );

keep for each ( item ) in list { [soft] bool-expr; ... };

keep soft bool-expr == select { weight : value; ... };

keep [soft] gen ( item-a ) before ( item-b );

keep gen-item.reset_soft(); // ignore soft constraints on gen-item

keep field-name.hdl_path() == "string" ; //field-name is unit instance

A.3.4 Methods and TCMs

regular-method( [arg : type, ...] ) [: return-type] is { action; ... };

TCM([arg : type, ...] ) [: return-type] @event-name is { action; ... };

A.3.5 Extending or Changing Methods and TCMs

method(arg : type, ... ) [: return-type] is also|first|only { action; ... };

TCM(arg : type, ... ) [: return-type] @event-name is also|first|only { action; ... };

A.3.6 Predefined Methods of All Structs and Units

run()

extract()

check()

finalize()

init()

pre_generate()

post_generate()

 

copy()

do_print()

print_line()

quit()

Previous Section Next Section