32
32
33
33
// ------------------------------------------------------------------------------
34
34
35
- #ifndef PRDF_SIM_ENUMS // needed to compile prdfsimEnumMap.C
35
+ #if !defined(PRDF_RULE_COMPILER_ENUMS) && !defined(PRDF_SIM_ENUMS)
36
36
namespace PRDF
37
37
{
38
38
#endif
@@ -44,21 +44,27 @@ namespace PRDF
44
44
// Used only in the rule compiler. Sets up a map between string keywords in
45
45
// the rule code to the enum name.
46
46
47
- #define PRDF_SYM_CALLOUT_MAP_BEGIN \
48
- struct SymCallout_t { const char * str; SymbolicFru val; }; \
49
- SymCallout_t symCalloutArray[] = \
50
- {
47
+ #define PRDF_SYM_CALLOUT_MAP_BEGIN
51
48
52
49
#define PRDF_SYM_CALLOUT_ALIAS (name1, name2 ) \
53
- { #name1 , name1 },
50
+ g_ActionArgMap[ #name1 ] = name2;
51
+
52
+ #define PRDF_SYM_CALLOUT_MAP_END
54
53
55
- #define PRDF_SYM_CALLOUT_MAP_END \
56
- { NULL , (SymbolicFru) 0 } \
57
- };
58
54
59
55
#elif defined PRDF_SIM_ENUMS
60
56
61
- // included from prdfsimEnumMap.C, nothing for now
57
+ #define PRDF_SYM_CALLOUT_MAP_BEGIN \
58
+ { \
59
+ ENUMNAMES * l_calloutEnum = new ENUMNAMES (); \
60
+ ivEnumTypes[" calloutNames" ] = l_calloutEnum; \
61
+ std::string s;
62
+
63
+ #define PRDF_SYM_CALLOUT_ALIAS (n1,n2 ) \
64
+ s = #n1; ToUpper (s); ivEnumValue[s] = n2; (*l_calloutEnum)[n2] = s;
65
+
66
+ #define PRDF_SYM_CALLOUT_MAP_END \
67
+ }
62
68
63
69
#else
64
70
@@ -98,27 +104,31 @@ PRDF_SYM_CALLOUT_MAP_END
98
104
// Used only in the rule compiler. Sets up a map between string keywords in
99
105
// the rule code to the enum name.
100
106
101
- #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
102
- struct CalloutPriority_t \
103
- { const char * str; CalloutPriorityEnum val; }; \
104
- CalloutPriority_t calloutPriorityArray[] = \
105
- {
107
+ #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN
106
108
107
109
#define PRDF_CALLOUT_PRIORITY_ALIAS (name1, name2 ) \
108
- { #name1 , name1 },
110
+ g_ActionArgMap[ #name1 ] = name2;
109
111
110
- #define PRDF_CALLOUT_PRIORITY_MAP_END \
111
- { NULL , (CalloutPriorityEnum) 0 } \
112
- };
112
+ #define PRDF_CALLOUT_PRIORITY_MAP_END
113
113
114
114
#elif defined PRDF_SIM_ENUMS
115
115
116
- // included from prdfsimEnumMap.C, nothing for now
116
+ #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
117
+ { \
118
+ ENUMNAMES * l_priorityEnum = new ENUMNAMES (); \
119
+ ivEnumTypes[" priorityNames" ] = l_priorityEnum; \
120
+ std::string s;
121
+
122
+ #define PRDF_CALLOUT_PRIORITY_ALIAS (n1,n2 ) \
123
+ s = #n1; ToUpper (s); ivEnumValue[s] = n2; (*l_priorityEnum)[n2] = s;
124
+
125
+ #define PRDF_CALLOUT_PRIORITY_MAP_END \
126
+ }
117
127
118
128
#else
119
129
120
130
#define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
121
- enum CalloutPriorityEnum \
131
+ enum PRDpriority \
122
132
{
123
133
124
134
#define PRDF_CALLOUT_PRIORITY_ALIAS (n1,n2 ) \
@@ -146,7 +156,51 @@ PRDF_CALLOUT_PRIORITY_MAP_END
146
156
147
157
// ------------------------------------------------------------------------------
148
158
149
- #ifndef PRDF_SIM_ENUMS
159
+ #ifdef PRDF_RULE_COMPILER_ENUMS
160
+
161
+ #define PRDF_TARGET_TYPE_ALIAS (n1, n2 ) \
162
+ g_ActionArgMap[ #n1 ] = n2;
163
+
164
+ #elif defined PRDF_SIM_ENUMS
165
+
166
+ #define PRDF_TARGET_TYPE_ALIAS (n1, n2 ) \
167
+ ivEnumValue[ #n1 ] = n2;
168
+
169
+ #else
170
+
171
+ #define PRDF_TARGET_TYPE_ALIAS (n1, n2 )
172
+
173
+ #endif
174
+
175
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_SYS, TARGETING::TYPE_SYS )
176
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_NODE, TARGETING::TYPE_NODE )
177
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_PROC, TARGETING::TYPE_PROC )
178
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_EQ, TARGETING::TYPE_EQ )
179
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_EX, TARGETING::TYPE_EX )
180
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_CORE, TARGETING::TYPE_CORE )
181
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_CAPP, TARGETING::TYPE_CAPP )
182
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_PEC, TARGETING::TYPE_PEC )
183
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_PHB, TARGETING::TYPE_PHB )
184
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_OBUS, TARGETING::TYPE_OBUS )
185
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_XBUS, TARGETING::TYPE_XBUS )
186
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_NX, TARGETING::TYPE_NX )
187
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_OCC, TARGETING::TYPE_OCC )
188
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_PSI, TARGETING::TYPE_PSI )
189
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_MCBIST, TARGETING::TYPE_MCBIST )
190
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_MCS, TARGETING::TYPE_MCS )
191
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_MCA, TARGETING::TYPE_MCA )
192
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_MEMBUF, TARGETING::TYPE_MEMBUF )
193
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_L4, TARGETING::TYPE_L4 )
194
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_MBA, TARGETING::TYPE_MBA )
195
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_DIMM, TARGETING::TYPE_DIMM )
196
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_OSCREFCLK, TARGETING::TYPE_OSCREFCLK )
197
+ PRDF_TARGET_TYPE_ALIAS ( TYPE_NA, TARGETING::TYPE_NA )
198
+
199
+ #undef PRDF_TARGET_TYPE_ALIAS
200
+
201
+ // ------------------------------------------------------------------------------
202
+
203
+ #if !defined(PRDF_RULE_COMPILER_ENUMS) && !defined(PRDF_SIM_ENUMS)
150
204
} // end namespace PRDF
151
205
#endif
152
206
0 commit comments