User guide

CIF Peripheral Model - SimpleTimer
100 CoMET Version 5.9 – Tutorial
The default output section appears as follows:
/*
** Output handles
*/
/*
const tAmpiLogicHandleMaster *OutputName;
*/
Replace the commented-out line
const tAmpiLogicHandleMaster *OutputName;
with the following:
CODE BEGINS
const tAmpiLogicHandleMaster *MatchInterrupt[NUM_MATCH_REGISTERS];
CODE ENDS
The default input handles section appears as follows:
/*
** Input handles.
*/
const tAmpiLogicHandleSlave *Reset;
const tAmpiClockHandleSlave *BusClock;
const tAmpiStdBusHandleSlave *Bus;
Add the TimerClock input port handle declaration after the line
const tAmpiStdBusHandleSlave *Bus;
as follows:
CODE BEGINS
const tAmpiClockHandleSlave *TimerClock;
CODE ENDS
Declaring Instance Data Registers
Registers are stored in the instance data structure as C variables of an appropriate type.
The default registers section looks similar to the following:
/*
** Registers Declarations
*/
tWord32 ReturnData;
Add the following register declarations after the line
tWord32 ReturnData;
CODE BEGINS
tWord32 regGTR; // General Timer Register
tWord32 regTER; //Timer Enable Register
tWord32 regTIER; //Timer Interrupt Enable Register
tWord32 regTIFR; //Timer Interrupt Flag Register
tWord32 regMTR[NUM_MATCH_REGISTERS]; // Match Timer Registers