1 /* --COPYRIGHT--,ESD
2 * Copyright (c) 2008 Texas Instruments. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License
5 * v. 1.0 which accompanies this distribution. The Eclipse Public License is
6 * available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
7 * Distribution License is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * Contributors:
11 * Texas Instruments - initial implementation
12 * --/COPYRIGHT--*/
13 /*
14 * ======== Defaults.xdc ========
15 *
16 *! Revision History
17 *! ================
18 *! 19-Feb-2008 sasha Added getCommon() meta function
19 */
20
21 package xdc.runtime;
22
23 /*!
24 * ======== Defaults ========
25 * Default attributes inherited by all target modules
26 *
27 * This module defines default values for `common$` structure. If other
28 * modules do not set `common$` properties explicitly, these values will be
29 * used.
30 */
31 module Defaults {
32
33 /*!
34 * ======== common$ ========
35 * Defaults inherited by all target modules
36 *
37 * This structure defines the default values for the configuration
38 * parameters shared by all modules in a system. Unless otherwise
39 * noted, setting one of the fields defined below will set the
40 * corresponding value for all modules in the system which have not
41 * been explicitly set; i.e., it will establish a default value for
42 * the parameter.
43 *
44 * @a(diags_ASSERT) 45 * Enables asserts at runtime. Default is `ALWAYS_ON`
46 *
47 * @a(diags_ENTRY) 48 * Enables entry trace for all functions. Default is `ALWAYS_OFF`
49 *
50 * @a(diags_EXIT) 51 * Enables exit trace for all functions. Default is `ALWAYS_OFF`
52 *
53 * @a(diags_INTERNAL) 54 * Enables internal asserts. Default is `ALWAYS_OFF`. When set to
55 * `ALWAYS_ON`, requires `diags_ASSERT` to be `ALWAYS_ON`.
56 *
57 * @a(diags_LIFECYCLE) 58 * Enables lifecycle logs. These logs are written during creates
59 * and deletes. Default is `ALWAYS_OFF`.
60 *
61 * @a(diags_USER) 62 * Each `diags_USER` field controls a separate user-defined
63 * logging level. Default is `ALWAYS_OFF` for all `diags_USER` fileds.
64 *
65 * @a(gate) 66 * Default gate used by all modules which are declared as being `@Gated`.
67 * By default, this parameter points to an instance of `{@link GateNull}`,
68 * which means there is no protection.
69 *
70 * @a(gateParams) 71 * The default parameters used to create gates at runtime. See
72 * `{@link Types#Common$.gateParams}`. Default is `null`.
73 *
74 * @a(instanceHeap) 75 * Specify heap to be used for module instances. Default is `null`.
76 * If `instanceHeap` is `null`, instances will be allocated from
77 * the heap specified by `{@link Memory#defaultHeapInstance}`.
78 *
79 * @a(instanceSection) 80 * Specify section to be used to place module instances. Default is
81 * `null`.
82 *
83 * @a(logger) 84 * Default logger used by modules to write logs. By default there is
85 * no logger.
86 *
87 * @a(memoryPolicy) 88 * Used to specify type of application. `Types.STATIC_POLICY` is used when
89 * all objects are created statically. `Types.CREATE_POLICY` is used when
90 * the application creates objects at runtime. `Types.DELETE_POLICY` is
91 * used when the application creates and deletes objects at runtime. This
92 * helps eliminate unwanted create and delete code.
93 *
94 * @a(namedInstance) 95 * This parameter should be set to true if space needs to be allocated in
96 * instance objects for instance names. Allocating space for a name
97 * allows object view tools to display the names. The runtime functions
98 * `Mod_Handle_name()` and `Mod_Handle_label()` defined for each module
99 * `Mod` can be used to retrieve the name at runtime.
100 *
101 * @a(namedModule) 102 * This field allows the name of the module to be retained on the target.
103 * Setting this to `false` will save space but will also prevent
104 * the target from being able to display the module names appearing
105 * in `Log` events and `Error`s.
106 *
107 * Setting `namedModule` to `false` causes all modules, except for
108 * `{@link Memory}` and `{@link Main}` to be unnamed by default. To
109 * eliminate the string names for these modules you must explicitly
110 * set their `common$.namedModule` parameters to `false`; without these
111 * two names, target-side display of error messages is somewhat cryptic.
112 *
113 * @a(romPatchTable) 114 * Specify whether modules that are allocated to ROM are patchable.
115 */
116 overridemetaonlyconfig Types.Common$ common$ = {
117 diags_ASSERT: Diags.ALWAYS_ON,
118 diags_ENTRY: Diags.ALWAYS_OFF,
119 diags_EXIT: Diags.ALWAYS_OFF,
120 diags_INTERNAL: Diags.ALWAYS_OFF,
121 diags_LIFECYCLE: Diags.ALWAYS_OFF,
122 diags_USER1: Diags.ALWAYS_OFF,
123 diags_USER2: Diags.ALWAYS_OFF,
124 diags_USER3: Diags.ALWAYS_OFF,
125 diags_USER4: Diags.ALWAYS_OFF,
126 diags_USER5: Diags.ALWAYS_OFF,
127 diags_USER6: Diags.ALWAYS_OFF,
128 diags_USER7: Diags.ALWAYS_OFF,
129 diags_USER8: Diags.ALWAYS_OFF,
130 fxntab: true,
131 gate: null,
132 gateParams: null,
133 instanceHeap: null,
134 instanceSection: null,
135 logger: null,
136 memoryPolicy: Types.DELETE_POLICY,
137 namedInstance: false,
138 namedModule: true,
139 romPatchTable: false,
140 };
141
142 /*!
143 * ======== getCommon ========
144 * Get a specified common parameter from a module
145 *
146 * Get the value of a member of the structure `common$` based on
147 * defaults and the current value of the parameter.
148 *
149 * @param(eb) module whose parameter is queried
150 *
151 * @param(param) string naming the queried parameter
152 *
153 * @a(returns) 154 * Returns the value of the parameter named `param` from the module
155 * `mod`.
156 */
157 metaonly Any getCommon(IModule.Module mod, String param);
158 };
159 /*
160 * @(#) xdc.runtime; 2, 0, 0, 0,236; 12-18-2009 12:27:13; /db/ztree/library/trees/xdc/xdc-u16x/src/packages/
161 */
162