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