1 2 3 4 5 6 7 8 9 10 11
12 13 14
15 import xdc.runtime.Types;
16
17 /*!
18 * ======== SysBuf ========
19 * Minimal implementation of functions required by System
20 *
21 * `SysBuf` writes all output to a circular memory buffer configured by
22 * the user.
23 *
24 * This module provides a simple but 100% portable implementation of the
25 * `{@link ISystemSupport}` interface.
26 */
27 module SysBuf inherits xdc.runtime.ISystemSupport {
28
29 /*!
30 * ======== bufSize ========
31 * Size (in MAUs) of the output.
32 *
33 * An internal buffer of this size is allocated. All output is stored
34 * in this internal buffer.
35 *
36 * If 0 is specified for the size, no buffer is created and all output
37 * is simply dropped.
38 */
39 config SizeT bufSize = 1024;
40
41 /*!
42 * ======== bufName ========
43 * Global variable name containing pointer to output buffer
44 *
45 * This variable will be created so that it is easy to view the
46 * contents of the output buffer within a debugger. If `bufName` is
47 * set to `null` or `undefined`, the variable will not be created.
48 */
49 metaonly config String bufName = "SYSBUF";
50
51 /*!
52 * ======== sectionName ========
53 * Section where the internal buffer managed by `SysBuf` is placed.
54 *
55 * The default is to have no explicit placement.
56 */
57 metaonly config String sectionName = null;
58
59 internal:
60
61 struct Module_State {
62 Char outbuf[];
63 UInt outidx;
64 }
65 }