| |||
| Home > The Cycle Accurate Simulation Interface > The clock interface classes > CASIClockMaster::registerClockSlave() |
When a clock slave is connected to its master, it can register
itself using registerClockSlave() function
for unconditional or conditional registration.
virtual void registerClockSlave(CASIClockSlaveIF *slave)=0
virtual void registerClockSlave(CASIClockSlaveIF *slave,
CASIPhase phase, uint32_t repetitions = 0,
uint32_t ratio = 1, uint32_t offset = 0) = 0
where:
slaveis an instance of an object that implements the CASIClockSlaveIF interface (the
base class for the CASIClockSlave class) and
defines the basic cycle-accurate simulation execution unit. A CASI
module can define zero, one or several clock slaves. Each clock
slave represent the cycle-based behavior of the appropriate model
part. The communicate() function implements
the cycle-based communication with other components and update() implements
the cycle-based updating of the internal resources of the component.
A CASIClockSlave must be connected to an appropriate CASIClockMaster to
receive the communicate or update calls.
phasespecifies the phase to register the slave for:
CASI_PHASE_BOTH
CASI_PHASE_COMMUNICATE
CASI_PHASE_UPDATE.
repetitionsspecifies the number of times the component is to be called. 0 means
the component will be called indefinitely.
This parameter has been deprecated and must not be used in new code. It has only been retained to support legacy code.
ratiospecifies
the clock ratio between the master clock and the local clock to be
used. A ratio of n means that the component is
be called once every n cycles. It must be greater
than 0.
This parameter has been deprecated and must not be used in new code. It has only been retained to support legacy code.
offsetdenotes the number of master clock cycles to elapse before the component is called for the first time. Default is 0.
This parameter has been deprecated and must not be used in new code. It has only been retained to support legacy code.
Conditional registration requires a more complex scheduling mechanism that can impact performance.
Conditional registration is only recommended for components that get called occasionally. In this case, the simulation performance is improved.
The order in which the component communicate() functions
are called cannot be specified by the standard registerClockSlave() function.
Some systems, however, require that communication functions are
called in a specific order to, for example, control a bus request
and acknowledge sequence within the same cycle. For more information
on specifying the order of communicate() functions,
see Appendix A Static Scheduling of Communication Functions.