1 CFE Diagnostic Entry Points
2 ---------------------------
4 ---------------------------------------------------------------------------
6 The CFE diagnostic entry points are used when running verification
7 programs under the control of the firmware. They are fixed (constant)
8 addresses and have register-based calling sequences. These entry
9 points are designed to be as minimal as possible so that as much of the
10 verification code as possible can be reused.
12 You can call the KSEG0 or KSEG1 version of the routine. It is
13 recommended that you call the cached version from cached code and
16 The firmware will reserve the top megabyte of memory for itself. The
17 diagnostic must not touch this memory.
19 The firmware will be compiled to *NOT* use relocatable data and
22 The firmware will need one general register that it is allowed to
23 trash without saving - I'll be using this to generate the pointer to
26 The diagnostics can generate records in a log buffer. This buffer
27 is allocated in the diagnostic's memory space but is filled in
28 by the firmware through the diagnostic entry points. At the end
29 of the diagnostic run, user commands in the firmware may be used
30 to look through accumulated log records.
32 If you mess with the caches or with the console device, the
33 VAPI functions that print messages to the console may not work.
35 Log records follow this format:
37 +0 SIGNATURE, FORMAT, and ID-CODE
38 +8 Number of 64-bit words in 'Log Data' field.
39 Upper 32 bits are CP0 count register
40 +16 Return address of routine generating this record
43 The "Log Record size" field is the number of bytes in the "log data"
44 field. No log data would use a value of zero.
46 The bytes in the SIGNATURE word are broken down as follows:
48 S1 S2 P1 F1 I1 I2 I3 I4
49 CF E1 pp xx ii ii ii ii
51 The "F1" byte is the format code; it describes the type
52 of log record being generated.
54 0x00 - General register and CP0 dump
56 0x02 - Generic log data (multiple of 8 bytes)
58 0x04 - Diagnostic termination status (8 bytes)
59 0x05 - Floating point registers
61 The "P1" byte is the processor number, 0 or 1.
63 The "I1" through "I4" bytes are supplied by the diagnostic
64 and can take on any value. You can use these bytes to identify
65 what part of the program generated this particular log record.
67 For example, if the diagnostic logs a single value of
68 0x0123_4567_89ab_cdef the log entry might look like:
81 Returns control to the firmware and displays the test status.
82 The status result is in register A0.
84 The firmware will store a "diagnostic termination status"
85 record in the log with the A0 register value. The ID code
86 will be zero for this record.
88 CFE's log scanning commands can be used to display log
89 records accumulated by the test.
92 Routine address: 0xBFC00510 (KSEG1)
95 On entry: A0 ($4) Exit status (9=ok, nonzero=fail)
96 On return: Does not return
100 DUMP GENERAL REGISTERS
101 ----------------------
105 This routine causes CFE to display a register dump on the console
106 port. It is assumed that the console hardware state has not been
107 altered by the diagnostic.
109 The format of the register dump is: TBD [XXX should it look like the
110 one that the functional simulator uses?]
112 The firmware needs one scratch register.
115 Routine address: 0xBFC00520 (KSEG1)
118 On Entry: RA ($31) Return Address
120 Registers used: K0 ($26) Scratch register for CFE
128 This routine sets the address of the log buffer. This
129 call must be made once at the beginning of the diagnostic
130 or else the "SAVE" functions will be considered as
133 The buffer addresses must be 64-bit aligned.
135 Routine address: 0xBFC00530 (KSEG1)
138 On Entry: RA ($31) Return Address
139 A0 ($4) Address of start of buffer
140 A1 ($5) Address of end of buffer
142 Registers Used: K0 ($26) Scratch register for CFE
151 This routine saves a single 64-bit value in the log.
154 Routine address: 0xBFC00540 (KSEG1)
157 On Entry: RA ($31) Return Address
158 A0 ($4) Low 32 bits are ID code for value
161 Registers Used: K0 ($26) Scratch register for CFE
170 This routine saves a block of memory in the log. The source
171 buffer must be 64-bit aligned.
174 Routine address: 0xBFC00550 (KSEG1)
177 On Entry: RA ($31) Return Address
178 A0 ($4) Low 32 bits are ID code for values
179 A1 ($5) Address of buffer containing values
180 A2 ($6) Number of 64-bit words to store
182 Registers Used: K0 ($26) Scratch register for CFE
193 This routine saves the SOC state in a user-supplied buffer.
194 The buffer must be large enough to accomodate the SOC state.
195 The SOC state will be written as records with the following
198 uint64_t phys_address
200 uint64_t phys_address
203 uint64_t phys_address
206 The table of SOC registers to dump will be maintained by
209 The firmware needs one scratch register.
211 Routine address: 0xBFC00570 (KSEG1)
214 On entry: A0 ($4) Low 32 bits are ID code for values
215 A1 ($5) Bitmask of agents to store in log
217 Registers used: K0 ($26) Scratch register for CFE
225 This routine saves the CPU general registers and certain CP0
226 registers in a user-supplied buffer.
228 This buffer must be large enough to accomodate the data
229 that will be saved. The registers will be written in
230 the following format:
232 uint64_t general_registers[32]
259 The firmware needs one scratch register.
261 Routine address: 0xBFC00580 (KSEG1)
264 On entry: RA ($31) Return address
265 A0 ($4) Low 32 bits are ID code for values
267 Registers used: K0 ($26) Scratch register for CFE
275 This routine saves the floating point and floating point
276 control registers. The registers will be written in
277 the following format:
279 uint64_t fp_registers[32]
282 uint64_t fp_condition_codes
283 uint64_t fp_exceptions
286 The firmware needs one scratch register.
288 Routine address: 0xBFC005B0 (KSEG1)
291 On entry: RA ($31) Return address
292 A0 ($4) Low 32 bits are ID code for values
294 Registers used: K0 ($26) Scratch register for CFE
302 This routine displays a zero-terminated ASCII text string on the
305 The firmware needs one scratch register.
308 Routine address: 0xBFC00590 (KSEG1)
311 On entry: RA ($31) Return address
312 A0 ($4) Pointer to null-terminated string
314 Registers used: K0 ($26) Scratch register for CFE
323 This routine writes four characters onto the SWARM board LEDs.
324 Writing to the LEDs is very fast compared to writing to the
325 console and can be useful for providing progress feedback
328 The characters are packed into the low 4 bytes of register A0.
329 The string ABCD would be hex 0x0000_0000_4142_4344
331 The firmware needs one scratch register
333 Routine address: 0xBFC005A0 (KSEG1)
336 On entry: RA ($31) Return Address
337 A0 ($4) Four characters
339 Registers used: K0 ($26) Scratch register for CFE
341 ------------------------------------------------------------------------