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