Requirements are:
1. an opaque type, declarable in SV, large enough to hold a void * pointer for the architecture on which the simulator runtime will run (i.e. size is unspecified but typically 32 or 64 bits)
2. on
SV side, the only operations permitted on a handle are:
a) assign to another variable of handle type
b) pass
handles to functions and ports
c) pass to a port of handle type (NOTE: this is desirable but not strictly required)
d) compare handle to NULL.
e) compare 2 handles for equality
f) handles can be put into a hash table (sorted in the same way class handles are sorted) SV makes no guarantees on reproducibility of this ordering.
g) handles can be assigned the value NULL. This will be seen as initializing the representation of the handle in C as being assigned to null. No other expression may be assigned to a handle.
h) NO
OTHER OPERATION PERMITTED. Specifically it is not possible to: dereference a
handle, cast a handle or cast a value to a handle.
3. handles can be put into complex structures (etc) freely with the sole exception that handles cannot be put into a union (i.e. no bypassing the casting restrictions) (but are clearly of limited use unless also using DirectC)
4. across the DirectC boundary a
handle is equivalent to a void * (in C).
This will require the addition of a new keyword "handle" that is a basic type. It can be used only as defined above.