-
Notifications
You must be signed in to change notification settings - Fork 7
UVM SystemC Randomization LRM
Crave constraints support the following operators
The followoing lists required classes required for a minimal crave API
crv_object
crv_object_name
crv_variable_base_
crv_variable_base<T>
crv_variable
crv_constraint_base
crv_constraint
Base class for all CRAVE objects
crv_object ()
Empty Constructor.
crave::crv_object::crv_object (const crv_object & other)
Copy constructor.
~crv_object ()
Destructor.
virtual std::string obj_kind () const
Return the type of the object as a string. The type is most likely the name of the class the object is made from.
Returns:
- Type of the object as a string.
virtual bool randomize ()
Randomizes the variables in this object.
The variables must be of type crv_variable
in order to be randomized. While randomizing, all constraints that are part of the object will be used to get a solution. These constraints may produce contradicts and cannot be solved. In that case, this method returns false.
Returns:
- true if a solution is found, false otherwise.
std::string name () const
Get the name of the object.
Returns:
- Name of the object as a string.
std::string fullname () const
Get the fullname of the object.
Returns:
- Fullname of the object as a string.
void print_object_hierarchy (int level=0) const
Outputs the object hierarchy (i.e. children and their children, etc.) to std::cout
.
static crv_object * root ()
Get the root object of the hierarchy
Returns:
- Pointer to the root element of the object hierarchy,
nullptr
if no element exists
static crv_object * find (std::string)
Find the object with a given name.
Returns:
- Pointer to the element with name,
nullptr
if no element exists
static unsigned count ()
Get the numer of objects in the hierarchy,
Returns:
- Number of elements in the obect hierarchy
Class for names of CRAVE objects.
This class is a type safe class to wrap the name of an object in CRAVE.
crv_object_name (const char *)
Constructor using a char array.
Parameters:
-
ca
character array to create the name from.
crv_object_name (const std::string &s)
Constructor using a string.
Parameters:
-
s
string to create the name from.
crv_object_name (const crv_object_name &)=default
Copy constructor.
~crv_object_name ()
Destructor.
std::string operator() ()
Operator() to get the name as a string
Returns
- wrapped name as a string
Non template base class for crv_variable. Dervied from crave_object
virtual Constant constant_expr ()=0
Get an instance of Constant, which captures the current value of this variable.
Returns:
- a Constant
virtual expression bound_expr ()=0
Get an expression, which bounds the symbolic value to be equal to another symbolic value.
Returns:
-bound expression
virtual unsigned id ()=0
get id
Returns:
- id
std::string obj_kind () const override final
Return the type of the object as a string.
Returns
-
crv_variable
as a string.
Non template base class for crv_variable. Dervied from crave_object