User guide

CIF Peripheral Model - SimpleTimer
108 CoMET Version 5.9 – Tutorial
Modify module and version information function
CoMET generates a call to print out model version information for the device.
The default section within the SimpleTimerInitTaskInstance function looks similar to the
following:
/*
** Display the module banner with version number.
*/
version = AmpiSymlinkGetVersionString();
AmpiStreamPrintf
(
INFO_MSG,
"\tVaST /*INSERT MODULE NAME IN FULL*/ %s\n",
version
);
Modify the AmpiStreamPrintf call as follows:
CODE BEGINS
AmpiStreamPrintf
(
INFO_MSG,
"\tVaST /*SimpleTimer*/ %s\n",
version
);
CODE ENDS
Modify Reset function
The Reset function, registered as a callback in the Task initialization function, is called every
time there is a change in the value of the Reset port. The default Reset function generated by
CoMET begins with a comment and function statement similar to the following:
/**
** Function:
** void Reset(void *p)
**
** Description:
** Resets the device on the rising edge of reset.
**
** Parameters:
** p
** Pointer to a tInstanceData structure.
**
** Returns:
** Nothing.
*/
static void Reset(void *p)
{
CoMET generates a C switch with a case for each possible value of the Reset signal.
When Reset starts, we deassert the outputs and cancel callbacks. Modify the section case
StdLogicH to the following:
CODE BEGINS