1 2 3 4 5 6 7
8
9 package xdc.runtime;
10
11 /*!
12 * ======== Rta ========
13 * The Rta module contains target and configuration code for providing RTA
14 * support.
15 *
16 * The 'Command' enum defines the available control commands, and the
17 * 'CommandPacket' structure defines the format of commands received from
18 * the host.
19 *
20 * All commands should send back a response, even if only to acknowledge
21 * receipt and completion of the command. The format of the response
22 * is defined by the 'ResponsePacket' structure.
23 *
24 * The Rta_processCommand can be used to process commands received from a
25 * host to call the appropriate API. Alternatively, the individual APIs can
26 * be called if not all of the defined commands are used.
27 */
28 module Rta {
29
30 /*! Logged when the Agent receives a command */
31 config Log.Event LD_cmdRcvd = {
32 mask: Diags.USER2,
33 msg: "LD_cmdRcvd: Received command: %d, arg0: 0x%x, arg1: 0x%x"
34 };
35
36 /*! Logged when a diags mask is changed */
37 config Log.Event LD_writeMask = {
38 mask: Diags.USER2,
39 msg: "LD_writeMask: Mask addres: 0x%x, New mask value: 0x%x"
40 };
41
42 /*! Assert if logger id in control command is invalid. */
43 config Assert.Id A_invalidLogger = {
44 msg: "A_invalidLogger: The logger id %d is invalid."
45 };
46
47 /*! Error raised if Agent receives an invalid command. */
48 config Error.Id E_badCommand = {
49 msg: "E_badCommand: Received invalid command, id: %d."
50 };
51
52 /*! Command ids */
53 enum Command : Int {
54 Command_READ_MASK = 0,
55 Command_WRITE_MASK = 1,
56 Command_LOGGER_OFF = 2,
57 Command_LOGGER_ON = 3,
58 Command_GET_CPU_SPEED = 4,
59 Command_RESET_LOGGER = 5,
60 Command_CHANGE_PERIOD = 6
61 };
62
63 /*!
64 * Structure of command received from host
65 * TODO - Either the types should be changed to 32-bits, or the packet
66 * size information should be added to the RTA XML file.
67 */
68 struct CommandPacket {
69 Command cmdId;
70 UArg arg0;
71 UArg arg1;
72 }
73
74 /*! Structure of response packet sent back to host */
75 struct ResponsePacket {
76 Command cmdId;
77 UArg resp0;
78 UArg resp1;
79 }
80
81 /*!
82 * ======== processCommand ========
83 * Executes a command packet and prepares the response packet.
84 *
85 * This API will execute the command specified by the command packet
86 * argument, and will store the response information in the response
87 * packet argument.
88 *
89 * @param(cmd) The CommandPacket to execute.
90 * @param(resp) The ResponsePacket to populate with the response.
91 */
92 Void processCommand(CommandPacket *cmd, ResponsePacket *resp);
93
94 /*!
95 * ======== acknowledgeCmd ========
96 */
97 Void acknowledgeCmd(ResponsePacket *resp);
98
99 /*!
100 * ======== readMask ========
101 */
102 Void readMask(ResponsePacket *resp, UArg addr);
103
104 /*!
105 * ======== writeMask ========
106 */
107 Void writeMask(ResponsePacket *resp, UArg addr, UArg val);
108
109 /*!
110 * ======== enableLog ========
111 */
112 Void enableLog(ResponsePacket *resp, UArg log);
113
114 /*!
115 * ======== disableLog ========
116 */
117 Void disableLog(ResponsePacket *resp, UArg log);
118
119 /*!
120 * ======== getCpuSpeed ========
121 */
122 Void getCpuSpeed(ResponsePacket *resp);
123
124 /*!
125 * ======== resetLog ========
126 */
127 Void resetLog(ResponsePacket *resp, UArg log);
128
129 /*!
130 * ======== changePeriod ========
131 */
132 Void changePeriod(ResponsePacket *resp, UArg period);
133
134 /*!
135 * @_nodoc
136 * ======== genRta ========
137 * Generates the Rta XML file.
138 */
139 function genRta(outputFileName);
140
141 }
142 143 144
145