module xdc.runtime.Rta

The Rta module contains target and configuration code for providing RTA support

The 'Command' enum defines the available control commands, and the 'CommandPacket' structure defines the format of commands received from the host. [ more ... ]
XDCspec summary sourced in xdc/runtime/Rta.xdc
module Rta {  ...
// inherits xdc.runtime.IModule
C synopsis target-domain
#include <xdc/runtime/Rta.h>
module-wide constants & types
    typedef Int Rta_Command// Command ids;
    enum {
        Rta_Command_READ_MASK,
        Rta_Command_WRITE_MASK,
        Rta_Command_LOGGER_OFF,
        Rta_Command_LOGGER_ON,
        Rta_Command_GET_CPU_SPEED,
        Rta_Command_RESET_LOGGER,
        Rta_Command_CHANGE_PERIOD
    } ;
 
        Rta_Command cmdId;
        UArg arg0;
        UArg arg1;
    } Rta_CommandPacket;
 
        Rta_Command cmdId;
        UArg resp0;
        UArg resp1;
    } Rta_ResponsePacket;
module-wide config parameters
module-wide functions
    Void Rta_acknowledgeCmd// ( Rta_ResponsePacket *resp );
    Void Rta_changePeriod// ( Rta_ResponsePacket *resp, UArg period );
    Void Rta_disableLog// ( Rta_ResponsePacket *resp, UArg log );
    Void Rta_enableLog// ( Rta_ResponsePacket *resp, UArg log );
    Void Rta_getCpuSpeed// ( Rta_ResponsePacket *resp );
    Void Rta_readMask// ( Rta_ResponsePacket *resp, UArg addr );
    Void Rta_resetLog// ( Rta_ResponsePacket *resp, UArg log );
    Void Rta_writeMask// ( Rta_ResponsePacket *resp, UArg addr, UArg val );
module-wide built-ins
 
XDCscript usage meta-domain
var Rta = xdc.useModule('xdc.runtime.Rta');
module-wide constants & types
    values of type Rta.Command// Command ids
        const Rta.Command_READ_MASK;
        const Rta.Command_WRITE_MASK;
        const Rta.Command_LOGGER_OFF;
        const Rta.Command_LOGGER_ON;
        const Rta.Command_GET_CPU_SPEED;
        const Rta.Command_RESET_LOGGER;
        const Rta.Command_CHANGE_PERIOD;
 
        obj.cmdId = Rta.Command  ...
        obj.arg0 = UArg  ...
        obj.arg1 = UArg  ...
 
        obj.cmdId = Rta.Command  ...
        obj.resp0 = UArg  ...
        obj.resp1 = UArg  ...
module-wide config parameters
        msg: "A_invalidLogger: The logger id %d is invalid."
    };
        msg: "E_badCommand: Received invalid command, id: %d."
    };
        mask: Diags.USER2,
        msg: "LD_cmdRcvd: Received command: %d, arg0: 0x%x, arg1: 0x%x"
    };
        mask: Diags.USER2,
        msg: "LD_writeMask: Mask addres: 0x%x, New mask value: 0x%x"
    };
 
 
XDCspec declarations sourced in xdc/runtime/Rta.xdc
package xdc.runtime;
 
module Rta {
module-wide constants & types
    enum Command// Command ids {
        Command_READ_MASK,
        Command_WRITE_MASK,
        Command_LOGGER_OFF,
        Command_LOGGER_ON,
        Command_GET_CPU_SPEED,
        Command_RESET_LOGGER,
        Command_CHANGE_PERIOD
    };
 
        Rta.Command cmdId;
        UArg arg0;
        UArg arg1;
    };
 
        Rta.Command cmdId;
        UArg resp0;
        UArg resp1;
    };
module-wide config parameters
        msg: "A_invalidLogger: The logger id %d is invalid."
    };
        msg: "E_badCommand: Received invalid command, id: %d."
    };
        mask: Diags.USER2,
        msg: "LD_cmdRcvd: Received command: %d, arg0: 0x%x, arg1: 0x%x"
    };
        mask: Diags.USER2,
        msg: "LD_writeMask: Mask addres: 0x%x, New mask value: 0x%x"
    };
 
module-wide functions
    Void acknowledgeCmd// ( Rta.ResponsePacket *resp );
    Void changePeriod// ( Rta.ResponsePacket *resp, UArg period );
    Void disableLog// ( Rta.ResponsePacket *resp, UArg log );
    Void enableLog// ( Rta.ResponsePacket *resp, UArg log );
    Void getCpuSpeed// ( Rta.ResponsePacket *resp );
    Void readMask// ( Rta.ResponsePacket *resp, UArg addr );
    Void resetLog// ( Rta.ResponsePacket *resp, UArg log );
    Void writeMask// ( Rta.ResponsePacket *resp, UArg addr, UArg val );
}
DETAILS
The 'Command' enum defines the available control commands, and the 'CommandPacket' structure defines the format of commands received from the host.
All commands should send back a response, even if only to acknowledge receipt and completion of the command. The format of the response is defined by the 'ResponsePacket' structure.
The Rta_processCommand can be used to process commands received from a host to call the appropriate API. Alternatively, the individual APIs can be called if not all of the defined commands are used.
 
enum Rta.Command

Command ids

XDCscript usage meta-domain
values of type Rta.Command
    const Rta.Command_READ_MASK;
    const Rta.Command_WRITE_MASK;
    const Rta.Command_LOGGER_OFF;
    const Rta.Command_LOGGER_ON;
    const Rta.Command_GET_CPU_SPEED;
    const Rta.Command_RESET_LOGGER;
    const Rta.Command_CHANGE_PERIOD;
C synopsis target-domain
typedef Int Rta_Command;
enum {
    Rta_Command_READ_MASK,
    Rta_Command_WRITE_MASK,
    Rta_Command_LOGGER_OFF,
    Rta_Command_LOGGER_ON,
    Rta_Command_GET_CPU_SPEED,
    Rta_Command_RESET_LOGGER,
    Rta_Command_CHANGE_PERIOD
} ;
 
 
struct Rta.CommandPacket

Structure of command received from host TODO - Either the types should be changed to 32-bits, or the packet size information should be added to the RTA XML file

XDCscript usage meta-domain
var obj = new Rta.CommandPacket;
 
    obj.cmdId = Rta.Command  ...
    obj.arg0 = UArg  ...
    obj.arg1 = UArg  ...
C synopsis target-domain
typedef struct Rta_CommandPacket {
    Rta_Command cmdId;
    UArg arg0;
    UArg arg1;
} Rta_CommandPacket;
 
 
struct Rta.ResponsePacket

Structure of response packet sent back to host

XDCscript usage meta-domain
var obj = new Rta.ResponsePacket;
 
    obj.cmdId = Rta.Command  ...
    obj.resp0 = UArg  ...
    obj.resp1 = UArg  ...
C synopsis target-domain
typedef struct Rta_ResponsePacket {
    Rta_Command cmdId;
    UArg resp0;
    UArg resp1;
} Rta_ResponsePacket;
 
 
config Rta.A_invalidLogger  // module-wide

Assert if logger id in control command is invalid

XDCscript usage meta-domain
Rta.A_invalidLogger = Assert.Desc {
    msg: "A_invalidLogger: The logger id %d is invalid."
};
C synopsis target-domain
extern const Assert_Id Rta_A_invalidLogger;
 
 
config Rta.E_badCommand  // module-wide

Error raised if Agent receives an invalid command

XDCscript usage meta-domain
Rta.E_badCommand = Error.Desc {
    msg: "E_badCommand: Received invalid command, id: %d."
};
C synopsis target-domain
extern const Error_Id Rta_E_badCommand;
 
 
config Rta.LD_cmdRcvd  // module-wide

Logged when the Agent receives a command

XDCscript usage meta-domain
Rta.LD_cmdRcvd = Log.EventDesc {
    mask: Diags.USER2,
    msg: "LD_cmdRcvd: Received command: %d, arg0: 0x%x, arg1: 0x%x"
};
C synopsis target-domain
extern const Log_Event Rta_LD_cmdRcvd;
 
 
config Rta.LD_writeMask  // module-wide

Logged when a diags mask is changed

XDCscript usage meta-domain
Rta.LD_writeMask = Log.EventDesc {
    mask: Diags.USER2,
    msg: "LD_writeMask: Mask addres: 0x%x, New mask value: 0x%x"
};
C synopsis target-domain
extern const Log_Event Rta_LD_writeMask;
 
 
metaonly config Rta.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Rta.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
Rta.acknowledgeCmd( )  // module-wide
C synopsis target-domain
Void Rta_acknowledgeCmd( Rta_ResponsePacket *resp );
 
 
Rta.changePeriod( )  // module-wide
C synopsis target-domain
Void Rta_changePeriod( Rta_ResponsePacket *resp, UArg period );
 
 
Rta.disableLog( )  // module-wide
C synopsis target-domain
Void Rta_disableLog( Rta_ResponsePacket *resp, UArg log );
 
 
Rta.enableLog( )  // module-wide
C synopsis target-domain
Void Rta_enableLog( Rta_ResponsePacket *resp, UArg log );
 
 
Rta.getCpuSpeed( )  // module-wide
C synopsis target-domain
Void Rta_getCpuSpeed( Rta_ResponsePacket *resp );
 
 
Rta.processCommand( )  // module-wide

Executes a command packet and prepares the response packet

C synopsis target-domain
Void Rta_processCommand( Rta_CommandPacket *cmd, Rta_ResponsePacket *resp );
 
ARGUMENTS
cmd — The CommandPacket to execute.
resp — The ResponsePacket to populate with the response.
DETAILS
This API will execute the command specified by the command packet argument, and will store the response information in the response packet argument.
 
Rta.readMask( )  // module-wide
C synopsis target-domain
Void Rta_readMask( Rta_ResponsePacket *resp, UArg addr );
 
 
Rta.resetLog( )  // module-wide
C synopsis target-domain
Void Rta_resetLog( Rta_ResponsePacket *resp, UArg log );
 
 
Rta.writeMask( )  // module-wide
C synopsis target-domain
Void Rta_writeMask( Rta_ResponsePacket *resp, UArg addr, UArg val );
 
 
module-wide built-ins

C synopsis target-domain
Types_ModuleId Rta_Module_id( );
// Get this module's unique id
 
Bool Rta_Module_startupDone( );
// Test if this module has completed startup
 
IHeap_Handle Rta_Module_heap( );
// The heap from which this module allocates memory
 
Bool Rta_Module_hasMask( );
// Test whether this module has a diagnostics mask
 
Bits16 Rta_Module_getMask( );
// Returns the diagnostics mask for this module
 
Void Rta_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
generated on Fri, 25 Jun 2010 00:01:37 GMT