1 | /*
|
---|
2 | * Copyright (C) 2008-2017 by TOPPERS Project
|
---|
3 | *
|
---|
4 | * 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
|
---|
5 | * ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
|
---|
6 | * 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
|
---|
7 | * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
|
---|
8 | * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
|
---|
9 | * スコード中に含まれていること.
|
---|
10 | * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
|
---|
11 | * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
|
---|
12 | * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
|
---|
13 | * の無保証規定を掲載すること.
|
---|
14 | * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
|
---|
15 | * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
|
---|
16 | * と.
|
---|
17 | * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
|
---|
18 | * 作権表示,この利用条件および下記の無保証規定を掲載すること.
|
---|
19 | * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
|
---|
20 | * 報告すること.
|
---|
21 | * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
|
---|
22 | * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
|
---|
23 | * また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
|
---|
24 | * 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
|
---|
25 | * 免責すること.
|
---|
26 | *
|
---|
27 | * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
|
---|
28 | * よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
|
---|
29 | * に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
|
---|
30 | * アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
|
---|
31 | * の責任を負わない.
|
---|
32 | *
|
---|
33 | * @(#) $Id$
|
---|
34 | */
|
---|
35 |
|
---|
36 | import_C( "t_stddef.h" );
|
---|
37 |
|
---|
38 | /* Constants of Kinds */
|
---|
39 | const int8_t TECSTypeKind_BoolType = 1;
|
---|
40 | const int8_t TECSTypeKind_IntType = 2;
|
---|
41 | const int8_t TECSTypeKind_FloatType = 3;
|
---|
42 | const int8_t TECSTypeKind_PtrType = 4;
|
---|
43 | const int8_t TECSTypeKind_ArrayType = 5;
|
---|
44 | const int8_t TECSTypeKind_DefinedType = 6;
|
---|
45 | const int8_t TECSTypeKind_StructType = 7;
|
---|
46 | const int8_t TECSTypeKind_EnumType = 8;
|
---|
47 | const int8_t TECSTypeKind_VoidType = 9;
|
---|
48 | const int8_t TECSTypeKind_DescriptorType = 10;
|
---|
49 |
|
---|
50 | /* Parameter Direction */
|
---|
51 | const int8_t PARAM_DIR_IN = 1;
|
---|
52 | const int8_t PARAM_DIR_OUT = 2;
|
---|
53 | const int8_t PARAM_DIR_INOUT = 3;
|
---|
54 | const int8_t PARAM_DIR_SEND = 4;
|
---|
55 | const int8_t PARAM_DIR_RECEIVE = 5;
|
---|
56 |
|
---|
57 | /* VarDecl declType */
|
---|
58 | const int8_t DECLTYPE_STMEMBER = 1; /* Struct Member */
|
---|
59 | const int8_t DECLTYPE_ATTR = 2;
|
---|
60 | const int8_t DECLTYPE_VAR = 3;
|
---|
61 |
|
---|
62 | /* VarDecl place info */
|
---|
63 | const int8_t VARDECL_PLACE_STRUCT = 1;
|
---|
64 | const int8_t VARDECL_PLACE_NON = 2;
|
---|
65 | const int8_t VARDECL_PLACE_CB = 3;
|
---|
66 | const int8_t VARDECL_PLACE_INIB = 4;
|
---|
67 |
|
---|
68 | /* CallInfo place info */
|
---|
69 | const int8_t CALL_PLACE_NON = 1;
|
---|
70 | const int8_t CALL_PLACE_INIB_DES = 2;
|
---|
71 | const int8_t CALL_PLACE_CB_DES = 3;
|
---|
72 | const int8_t CALL_PLACE_INIB_IDX = 4;
|
---|
73 | const int8_t CALL_PLACE_CB_IDX = 5;
|
---|
74 |
|
---|
75 | namespace nTECSInfo {
|
---|
76 |
|
---|
77 | /******* SIGNATURES *******/
|
---|
78 |
|
---|
79 | /* Type Information of attr, var, param, return */
|
---|
80 | signature sTypeInfo {
|
---|
81 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
82 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
83 | // (max_len-1) 文字コピーする。name[max_len-1] = NULL
|
---|
84 | uint16_t getNameLength(void);
|
---|
85 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
86 | uint32_t getSize(void); // size of the value in bytes
|
---|
87 | int8_t getKind(void); // see Constants of Kinds
|
---|
88 | uint32_t getNType(void);
|
---|
89 | // kind == ARRAY の場合サイズ、POINTER, TYPEDEF の場合1、それ以外は0
|
---|
90 | ER getTypeInfo( [out]Descriptor(sTypeInfo) *desc );
|
---|
91 | // kind == POINTER, TYPEDEF の場合、desc に有効な値を返す
|
---|
92 | uint32_t getNMember(void);
|
---|
93 | // STRUCT の場合メンバー数
|
---|
94 | ER getMemberInfo( [in]uint32_t ith, [out]Descriptor(sVarDeclInfo) *desc );
|
---|
95 | // kind == STRUCT の場合、desc に有効な値を返す
|
---|
96 | // ith はメンバーの添数 0<=ith<*num
|
---|
97 | // ith が範囲外の場合 E_NORES を返す
|
---|
98 | // void getSignatureInfo( [out]Descriptor(sSignatureInfo) *desc );
|
---|
99 | // // kind == DESCRIPTOR の場合、desc に有効な値を返す
|
---|
100 | };
|
---|
101 |
|
---|
102 | /* ATTR, VAR, struct member Information */
|
---|
103 | signature sVarDeclInfo {
|
---|
104 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
105 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
106 | // (max_len-1) 文字コピーする。name[max_len-1] = NULL
|
---|
107 | uint16_t getNameLength(void);
|
---|
108 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
109 | void getLocationInfo( [out]uint32_t *offset,
|
---|
110 | [out]int8_t *place ); // VARDECL_PLACE_*
|
---|
111 | void getTypeInfo( [out]Descriptor( sTypeInfo ) *desc );
|
---|
112 | void getSizeIsExpr( [out,string(max_len)]char_t *expr_str, [in]int32_t max_len );
|
---|
113 | // size_is 計算式を文字列で返す. size_is 未指定の場合 *expr_str = NULL が返される
|
---|
114 | ER getSizeIs( [out]uint32_t *size, [in]const void *p_cb);
|
---|
115 | // p_cb を与えると、size を返す (size_is 指定がない場合,E_NOSPT を返す)
|
---|
116 | };
|
---|
117 |
|
---|
118 | /* PARAM Information */
|
---|
119 | signature sParamInfo {
|
---|
120 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
121 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
122 | // (max_len-1) 文字コピーする。name[max_len-1] = NULL
|
---|
123 | uint16_t getNameLength(void);
|
---|
124 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
125 | ER getTypeInfo( [out]Descriptor(sTypeInfo) *desc);
|
---|
126 | ER getDir( [out]int8_t *dir );
|
---|
127 | };
|
---|
128 |
|
---|
129 | /* FUNCTION Information */
|
---|
130 | signature sFunctionInfo {
|
---|
131 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
132 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
133 | // (max_len-1) 文字コピーする。name[max_len-1] = NULL
|
---|
134 | uint16_t getNameLength(void);
|
---|
135 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
136 | void getReturnTypeInfo( [out]Descriptor( sTypeInfo ) *desc );
|
---|
137 | uint32_t getNParam(void);
|
---|
138 | ER getParamInfo( [in]uint32_t ith, [out]Descriptor(sParamInfo) *param );
|
---|
139 | // 0 <= ith < *num
|
---|
140 | // ith が範囲外の場合 E_NORES を返す
|
---|
141 | };
|
---|
142 |
|
---|
143 | /* SIGNATURE Information */
|
---|
144 | signature sSignatureInfo {
|
---|
145 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
146 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
147 | // (max_len-1) 文字コピーする。name[max_len-1] = NULL
|
---|
148 | uint16_t getNameLength(void);
|
---|
149 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
150 | uint32_t getNFunction(void);
|
---|
151 | ER getFunctionInfo( [in]uint32_t ith, [out]Descriptor( sFunctionInfo ) *desc );
|
---|
152 | // 0 <= ith < *num
|
---|
153 | // ith が範囲外の場合 E_NORES を返す
|
---|
154 | };
|
---|
155 |
|
---|
156 | /* CALL Information */
|
---|
157 | signature sCallInfo {
|
---|
158 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
159 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
160 | // (max_len-1) 文字コピーする。name[max_len-1]= NULL
|
---|
161 | uint16_t getNameLength(void);
|
---|
162 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
163 | void getSignatureInfo( [out]Descriptor( sSignatureInfo ) *desc );
|
---|
164 | uint32_t getArraySize(void);
|
---|
165 | void getSpecifierInfo( [out]bool_t *b_optional,
|
---|
166 | [out]bool_t *b_dynamic,
|
---|
167 | [out]bool_t *b_ref_desc,
|
---|
168 | [out]bool_t *b_omit );
|
---|
169 | void getInternalInfo( [out]bool_t *b_allocator_port,
|
---|
170 | [out]bool_t *b_require_port );
|
---|
171 | void getLocationInfo( [out]uint32_t *offset, // CALL_PLACE_*
|
---|
172 | [out]int8_t *place ); // CALL_PLACE_*
|
---|
173 | void getOptimizeInfo( [out]bool_t *b_VMT_useless, // VMT (関数テーブル) 不要最適化 (関数直接呼出し)
|
---|
174 | [out]bool_t *b_skelton_useless, // スケルトン関数不要 (
|
---|
175 | [out]bool_t *b_cell_unique ); // 単一のセル
|
---|
176 | };
|
---|
177 |
|
---|
178 | /* ENTRY Information */
|
---|
179 | signature sEntryInfo {
|
---|
180 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
181 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
182 | // (max_len-1) 文字コピーする。name[max_len-1]=NULL
|
---|
183 | uint16_t getNameLength(void);
|
---|
184 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
185 | void getSignatureInfo( [out]Descriptor( sSignatureInfo ) *desc );
|
---|
186 | uint32_t getArraySize(void);
|
---|
187 | bool_t isInline(void);
|
---|
188 | };
|
---|
189 |
|
---|
190 | /* CELLTYPE Information */
|
---|
191 | signature sCelltypeInfo {
|
---|
192 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
193 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
194 | // (max_len-1) 文字コピーする。name[max_len-1]=NULL
|
---|
195 | uint16_t getNameLength(void);
|
---|
196 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
197 | uint32_t getNAttr(void);
|
---|
198 | ER getAttrInfo( [in]uint32_t ith, [out]Descriptor(sVarDeclInfo)*desc );
|
---|
199 | uint32_t getNVar(void);
|
---|
200 | ER getVarInfo( [in]uint32_t ith, [out]Descriptor(sVarDeclInfo)*desc );
|
---|
201 | // ith が範囲外の場合 E_NORES を返す
|
---|
202 | uint32_t getNCall(void);
|
---|
203 | ER getCallInfo( [in]uint32_t ith, [out]Descriptor(sCallInfo)*desc );
|
---|
204 | // ith が範囲外の場合 E_NORES を返す
|
---|
205 | uint32_t getNEntry(void);
|
---|
206 | ER getEntryInfo( [in]uint32_t ith, [out]Descriptor(sEntryInfo)*desc );
|
---|
207 | // ith が範囲外の場合 E_NORES を返す
|
---|
208 | bool_t isSingleton(void);
|
---|
209 | bool_t isIDX_is_ID(void);
|
---|
210 | uint32_t sizeOfCB(void);
|
---|
211 | uint32_t sizeOfINIB(void);
|
---|
212 | };
|
---|
213 |
|
---|
214 | /* CELL Information */
|
---|
215 | [deviate]
|
---|
216 | signature sCellInfo {
|
---|
217 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
218 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
219 | // (max_len-1) 文字コピーする。name[max_len-1]=NULL
|
---|
220 | uint16_t getNameLength(void);
|
---|
221 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
222 | uint32_t getNRawEntryDescriptorInfo( void );
|
---|
223 | ER getRawEntryDescriptorInfo( [in]int_t index, [out]Descriptor(sRawEntryDescriptorInfo) *desc );
|
---|
224 | // index は、受け口を指定 (CelltypeInfo の cEntryInfo の序数に一致する)
|
---|
225 | void getCelltypeInfo( [out]Descriptor( sCelltypeInfo ) *desc );
|
---|
226 | void getCBP( [out]void **cbp ); // out: 逸脱
|
---|
227 | void getINIBP( [out]void **inibp ); // out: 逸脱
|
---|
228 | };
|
---|
229 |
|
---|
230 | [deviate]
|
---|
231 | signature sRawEntryDescriptorInfo {
|
---|
232 | uint16_t getNRawEntryDescriptorInfo( void ); // 受け口配列の場合、要素数を返す。非配列の場合 1。
|
---|
233 | ER getRawDescriptor( [in]int_t ith, [out]void **rawDesc );
|
---|
234 | // ith が配列範囲外の場合、E_NOEXS を返す
|
---|
235 | };
|
---|
236 |
|
---|
237 | /* NAMESPACE Information */
|
---|
238 | signature sNamespaceInfo {
|
---|
239 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
240 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
241 | // (max_len-1) 文字コピーする。name[max_len-1]=NULL
|
---|
242 | uint16_t getNameLength(void);
|
---|
243 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
244 | uint32_t getNNamespace(void);
|
---|
245 | ER getNamespaceInfo( [in]uint32_t ith, [out]Descriptor(sNamespaceInfo) *des );
|
---|
246 | // ith が範囲外の場合 E_NORES を返す
|
---|
247 | uint32_t getNSignature(void);
|
---|
248 | ER getSignatureInfo( [in]uint32_t ith, [out]Descriptor(sSignatureInfo) *des );
|
---|
249 | // ith が範囲外の場合 E_NORES を返す
|
---|
250 | uint32_t getNCelltype(void);
|
---|
251 | ER getCelltypeInfo( [in]uint32_t ith, [out]Descriptor(sCelltypeInfo) *des );
|
---|
252 | // ith が範囲外の場合 E_NORES を返す
|
---|
253 | };
|
---|
254 |
|
---|
255 | /* REGION Information */
|
---|
256 | signature sRegionInfo {
|
---|
257 | ER getName( [out,string(max_len)]char_t *name, [in]int_t max_len );
|
---|
258 | // 長さが max_len を超えた場合は E_NOMEM を返す.
|
---|
259 | // (max_len-1) 文字コピーする。name[max_len-1]=NULL
|
---|
260 | uint16_t getNameLength(void);
|
---|
261 | // 終端文字 (NULL) を含む長さ (strlen と仕様が異なることに注意)
|
---|
262 | uint32_t getNCell(void);
|
---|
263 | ER getCellInfo( [in]uint32_t ith, [out]Descriptor(sCellInfo) *des );
|
---|
264 | // ith が範囲外の場合 E_NORES を返す
|
---|
265 | uint32_t getNRegion(void);
|
---|
266 | ER getRegionInfo( [in]uint32_t ith, [out]Descriptor(sRegionInfo) *des );
|
---|
267 | // ith が範囲外の場合 E_NORES を返す
|
---|
268 | };
|
---|
269 |
|
---|
270 | /* TECS Information */
|
---|
271 | signature sTECSInfo {
|
---|
272 | ER findNamespace([in,string]const char_t *namespace_path, [out]Descriptor( sNamespaceInfo )*nsDesc);
|
---|
273 | ER findRegion( [in,string]const char_t *namespace_path, [out]Descriptor( sRegionInfo )*regionDesc);
|
---|
274 | ER findSignature([in,string]const char_t *namespace_path, [out]Descriptor( sSignatureInfo )*signatureDesc);
|
---|
275 | ER findCelltype( [in,string]const char_t *namespace_path, [out]Descriptor( sCelltypeInfo )*celltypeDesc);
|
---|
276 | ER findCell( [in,string]const char_t *namespace_path, [out]Descriptor( sCellInfo )*cellDesc);
|
---|
277 | ER findRawEntryDescriptor(
|
---|
278 | [in,string]const char_t *namespace_path,
|
---|
279 | [in] int_t ith,
|
---|
280 | [out]Descriptor( sRawEntryDescriptorInfo )*rawEntryDescDesc,
|
---|
281 | [out]Descriptor( sEntryInfo )*entryDesc);
|
---|
282 | ER findRawEntryDescriptor_unsafe( // このメソッドは、非配列の場合のみしようできる
|
---|
283 | [in,string]const char_t *namespace_path,
|
---|
284 | [out]void **rawDesc );
|
---|
285 | };
|
---|
286 |
|
---|
287 | /******* CELLTYPES *******/
|
---|
288 |
|
---|
289 | /*
|
---|
290 | * tTECSInfo セルタイプのセルは、ユーザーが設置する.
|
---|
291 | *
|
---|
292 | * このセルから、tTECSInfoSub への結合は、プラグインにより自動的に
|
---|
293 | * 行われるため、ユーザーは、このセルを設置するだけでよい.
|
---|
294 | * (プロトタイプを用いていないのは、このセルを任意のリージョンに置
|
---|
295 | * くことを想定してのもの)
|
---|
296 | */
|
---|
297 | [singleton,
|
---|
298 | generate( TECSInfoPlugin, "" )]
|
---|
299 | celltype tTECSInfo {
|
---|
300 | [inline]
|
---|
301 | entry sTECSInfo eTECSInfo;
|
---|
302 | call sTECSInfo cTECSInfo;
|
---|
303 | FACTORY{
|
---|
304 | write( "global_tecsgen.h", "#define setRawEntryDescriptor( callDesc, callPortSignature, rawEntryDesc ) (callDesc).vdes = (struct tag_ ## callPortSignature ## _VDES *) rawEntryDesc" );
|
---|
305 | };
|
---|
306 | };
|
---|
307 |
|
---|
308 | /*
|
---|
309 | * tTECSInfoSub セルタイプのセルは、プラグインにより自動生成される.
|
---|
310 | * プラグインは、生成を行う前にエラーが発生している場合、セルを生成しない.
|
---|
311 | * (TECSInfoSub セルが未定義のエラーも出ることになる。不完全な状態
|
---|
312 | * で生成しようとすると、Ruby 例外を発生する可能性があるため、生成
|
---|
313 | * しない)
|
---|
314 | */
|
---|
315 | [singleton]
|
---|
316 | celltype tTECSInfoSub {
|
---|
317 | entry sTECSInfo eTECSInfo;
|
---|
318 | [ref_desc]
|
---|
319 | call sNamespaceInfo cNamespaceInfo; // root namespace
|
---|
320 | [ref_desc]
|
---|
321 | call sRegionInfo cRegionInfo; // root region
|
---|
322 | // 内部処理用の呼び口 (何度も使いまわすので、使う直前に(再)設定すること)
|
---|
323 | [dynamic,optional]
|
---|
324 | call sNamespaceInfo cNamespaceInfoTemp;
|
---|
325 | [dynamic,optional]
|
---|
326 | call sRegionInfo cRegionInfoTemp;
|
---|
327 | [dynamic,optional]
|
---|
328 | call sSignatureInfo cSignatureInfoTemp;
|
---|
329 | [dynamic,optional]
|
---|
330 | call sCelltypeInfo cCelltypeInfoTemp;
|
---|
331 | [dynamic,optional]
|
---|
332 | call sCellInfo cCellInfoTemp;
|
---|
333 | [dynamic,optional]
|
---|
334 | call sEntryInfo cEntryInfoTemp;
|
---|
335 | [dynamic,optional]
|
---|
336 | call sRawEntryDescriptorInfo cRawEntryDescriptorInfoTemp;
|
---|
337 |
|
---|
338 | attr {
|
---|
339 | int32_t name_len = 256;
|
---|
340 | int32_t path_len = 1024;
|
---|
341 | };
|
---|
342 | var {
|
---|
343 | [size_is(name_len)]
|
---|
344 | char_t *name1;
|
---|
345 | [size_is(name_len)]
|
---|
346 | char_t *name2;
|
---|
347 | [size_is(path_len)]
|
---|
348 | char_t *path;
|
---|
349 | };
|
---|
350 | };
|
---|
351 |
|
---|
352 | celltype tNamespaceInfo {
|
---|
353 | attr {
|
---|
354 | char *name;
|
---|
355 | };
|
---|
356 |
|
---|
357 | entry sNamespaceInfo eNamespaceInfo;
|
---|
358 | [ref_desc,optional]
|
---|
359 | call sSignatureInfo cSignatureInfo[];
|
---|
360 | [ref_desc,optional]
|
---|
361 | call sCelltypeInfo cCelltypeInfo[];
|
---|
362 | [ref_desc,optional]
|
---|
363 | call sNamespaceInfo cNamespaceInfo[];
|
---|
364 | };
|
---|
365 |
|
---|
366 | /* SIGNATURE information */
|
---|
367 | celltype tSignatureInfo{
|
---|
368 | attr {
|
---|
369 | char *name;
|
---|
370 | };
|
---|
371 |
|
---|
372 | entry sSignatureInfo eSignatureInfo;
|
---|
373 | [ref_desc,optional]
|
---|
374 | call sFunctionInfo cFunctionInfo[];
|
---|
375 | };
|
---|
376 | celltype tFunctionInfo {
|
---|
377 | attr {
|
---|
378 | char_t *name;
|
---|
379 | bool_t bOneway;
|
---|
380 | };
|
---|
381 | entry sFunctionInfo eFunctionInfo;
|
---|
382 | [ref_desc,optional]
|
---|
383 | call sParamInfo cParamInfo[];
|
---|
384 | [ref_desc]
|
---|
385 | call sTypeInfo cReturnTypeInfo;
|
---|
386 | };
|
---|
387 | celltype tParamInfo {
|
---|
388 | attr {
|
---|
389 | char_t *name;
|
---|
390 | int8_t dir;
|
---|
391 | char_t *sizeIsExpr;
|
---|
392 | char_t *countIsExpr;
|
---|
393 | char_t *stringExpr;
|
---|
394 | };
|
---|
395 | entry sParamInfo eParamInfo;
|
---|
396 | [ref_desc]
|
---|
397 | call sTypeInfo cTypeInfo;
|
---|
398 | };
|
---|
399 |
|
---|
400 | /* CELLTYPE information */
|
---|
401 | celltype tCelltypeInfo{
|
---|
402 | attr {
|
---|
403 | char_t *name;
|
---|
404 | bool_t b_singleton;
|
---|
405 | bool_t b_IDX_is_ID_act;
|
---|
406 | uint32_t sizeOfCB; // size in bytes, 0 if not exist
|
---|
407 | uint32_t sizeOfINIB; // size in bytes, 0 if not exist
|
---|
408 | uint32_t n_cellInLinkUnit; // CellInLinkUnit == 0 の時 セルタイプコードは、リンクされていない
|
---|
409 | uint32_t n_cellInSystem; // すべてのリンクユニットを含めたセルの個数.
|
---|
410 | // この数が 0になるものは、CelltypeInfo は省略される.
|
---|
411 | };
|
---|
412 | [ref_desc,optional]
|
---|
413 | call sEntryInfo cEntryInfo[];
|
---|
414 | [ref_desc,optional]
|
---|
415 | call sCallInfo cCallInfo[];
|
---|
416 | [ref_desc,optional]
|
---|
417 | call sVarDeclInfo cAttrInfo[];
|
---|
418 | [ref_desc,optional]
|
---|
419 | call sVarDeclInfo cVarInfo[];
|
---|
420 |
|
---|
421 | entry sCelltypeInfo eCelltypeInfo;
|
---|
422 | };
|
---|
423 | celltype tCallInfo {
|
---|
424 | attr {
|
---|
425 | char_t *name;
|
---|
426 | uint32_t offset;
|
---|
427 | uint32_t array_size;
|
---|
428 | bool_t b_optional;
|
---|
429 | bool_t b_omit;
|
---|
430 | bool_t b_dynamic;
|
---|
431 | bool_t b_ref_desc;
|
---|
432 | bool_t b_allocator_port;
|
---|
433 | bool_t b_require_port;
|
---|
434 | int8_t place;
|
---|
435 | bool_t b_VMT_useless; // VMT (関数テーブル) 不要最適化 (関数直接呼出し)
|
---|
436 | bool_t b_skelton_useless; // スケルトン関数不要 (
|
---|
437 | bool_t b_cell_unique; // 単一のセル
|
---|
438 | };
|
---|
439 | entry sCallInfo eCallInfo;
|
---|
440 | [ref_desc]
|
---|
441 | call sSignatureInfo cSignatureInfo;
|
---|
442 | FACTORY {
|
---|
443 | write( "$ct_global$_factory.h", "#include \"include_all_signature_header.h\"" );
|
---|
444 | };
|
---|
445 | };
|
---|
446 | celltype tEntryInfo {
|
---|
447 | attr {
|
---|
448 | char_t *name;
|
---|
449 | bool_t b_inline;
|
---|
450 | uint32_t array_size;
|
---|
451 | };
|
---|
452 | entry sEntryInfo eEntryInfo;
|
---|
453 | [ref_desc]
|
---|
454 | call sSignatureInfo cSignatureInfo;
|
---|
455 | FACTORY {
|
---|
456 | write( "$ct_global$_factory.h", "#include \"include_all_signature_header.h\"" );
|
---|
457 | };
|
---|
458 | };
|
---|
459 | /* Variable Declarator (attr, var, struct member) */
|
---|
460 | celltype tVarDeclInfo {
|
---|
461 | attr {
|
---|
462 | char_t *name;
|
---|
463 | char_t *sizeIsExpr;
|
---|
464 | int8_t declType; /* valid when attr, var */
|
---|
465 | int8_t place;
|
---|
466 | uint32_t offset;
|
---|
467 | };
|
---|
468 | entry sVarDeclInfo eVarDeclInfo;
|
---|
469 | [ref_desc]
|
---|
470 | call sTypeInfo cTypeInfo;
|
---|
471 | };
|
---|
472 |
|
---|
473 | /* REGION & CELL information */
|
---|
474 | celltype tRegionInfo {
|
---|
475 | attr {
|
---|
476 | char *name;
|
---|
477 | };
|
---|
478 |
|
---|
479 | entry sRegionInfo eRegionInfo;
|
---|
480 | [ref_desc,optional]
|
---|
481 | call sCellInfo cCellInfo[];
|
---|
482 | [ref_desc,optional]
|
---|
483 | call sRegionInfo cRegionInfo[];
|
---|
484 | };
|
---|
485 | celltype tCellInfo {
|
---|
486 | attr {
|
---|
487 | char_t *name;
|
---|
488 | void *cbp;
|
---|
489 | void *inibp;
|
---|
490 | };
|
---|
491 | [ref_desc]
|
---|
492 | call sCelltypeInfo cCelltypeInfo;
|
---|
493 | [ref_desc,optional]
|
---|
494 | call sRawEntryDescriptorInfo cRawEntryDescriptor[];
|
---|
495 | entry sCellInfo eCellInfo;
|
---|
496 | };
|
---|
497 | celltype tRawEntryDescriptorInfo {
|
---|
498 | attr {
|
---|
499 | int_t size; // 非配列の場合 0
|
---|
500 | [size_is(size)]
|
---|
501 | void **rawEntryDescriptor;
|
---|
502 | };
|
---|
503 | entry sRawEntryDescriptorInfo eRawEntryDescriptor;
|
---|
504 | // [ref_desc]
|
---|
505 | // call sEntryInfo cEntryInfo;
|
---|
506 | };
|
---|
507 |
|
---|
508 | /* celltypes of TYPEs */
|
---|
509 | celltype tVoidTypeInfo {
|
---|
510 | attr {
|
---|
511 | char_t *name;
|
---|
512 | int8_t typeKind;
|
---|
513 | uint32_t size; /* bytes */
|
---|
514 | bool_t b_const;
|
---|
515 | bool_t b_volatile;
|
---|
516 | };
|
---|
517 | entry sTypeInfo eTypeInfo;
|
---|
518 | };
|
---|
519 | celltype tBoolTypeInfo {
|
---|
520 | attr {
|
---|
521 | char_t *name;
|
---|
522 | int8_t typeKind;
|
---|
523 | uint32_t size; /* bytes */
|
---|
524 | bool_t b_const;
|
---|
525 | bool_t b_volatile;
|
---|
526 | };
|
---|
527 | entry sTypeInfo eTypeInfo;
|
---|
528 | };
|
---|
529 | celltype tIntTypeInfo {
|
---|
530 | attr {
|
---|
531 | char_t *name;
|
---|
532 | int8_t typeKind;
|
---|
533 | uint32_t size; /* bytes */
|
---|
534 | bool_t b_const;
|
---|
535 | bool_t b_volatile;
|
---|
536 | };
|
---|
537 | entry sTypeInfo eTypeInfo;
|
---|
538 | };
|
---|
539 | celltype tFloatTypeInfo {
|
---|
540 | attr {
|
---|
541 | char_t *name;
|
---|
542 | int8_t typeKind;
|
---|
543 | uint32_t size; /* bytes */
|
---|
544 | bool_t b_const;
|
---|
545 | bool_t b_volatile;
|
---|
546 | };
|
---|
547 | entry sTypeInfo eTypeInfo;
|
---|
548 | };
|
---|
549 | celltype tStructTypeInfo {
|
---|
550 | attr {
|
---|
551 | char_t *name;
|
---|
552 | int8_t typeKind;
|
---|
553 | uint32_t size; /* bytes */
|
---|
554 | bool_t b_const;
|
---|
555 | bool_t b_volatile;
|
---|
556 | };
|
---|
557 | entry sTypeInfo eTypeInfo;
|
---|
558 | [ref_desc]
|
---|
559 | call sVarDeclInfo cVarDeclInfo[];
|
---|
560 | };
|
---|
561 | celltype tPtrTypeInfo {
|
---|
562 | attr {
|
---|
563 | char_t *name;
|
---|
564 | int8_t typeKind;
|
---|
565 | uint32_t size; /* bytes */
|
---|
566 | bool_t b_const;
|
---|
567 | bool_t b_volatile;
|
---|
568 | };
|
---|
569 | entry sTypeInfo eTypeInfo;
|
---|
570 | [ref_desc]
|
---|
571 | call sTypeInfo cTypeInfo;
|
---|
572 | FACTORY {
|
---|
573 | write( "$ct_global$_factory.h", "#include \"include_all_signature_header.h\"" );
|
---|
574 | };
|
---|
575 | };
|
---|
576 | celltype tArrayTypeInfo {
|
---|
577 | attr {
|
---|
578 | char_t *name;
|
---|
579 | int8_t typeKind;
|
---|
580 | uint32_t size; /* bytes */
|
---|
581 | bool_t b_const;
|
---|
582 | bool_t b_volatile;
|
---|
583 | };
|
---|
584 | entry sTypeInfo eTypeInfo;
|
---|
585 | [ref_desc]
|
---|
586 | call sTypeInfo cTypeInfo;
|
---|
587 | FACTORY {
|
---|
588 | write( "$ct_global$_factory.h", "#include \"include_all_signature_header.h\"" );
|
---|
589 | };
|
---|
590 | };
|
---|
591 | celltype tDefinedTypeInfo {
|
---|
592 | attr {
|
---|
593 | char_t *name;
|
---|
594 | int8_t typeKind;
|
---|
595 | uint32_t size; /* bytes */
|
---|
596 | bool_t b_const;
|
---|
597 | bool_t b_volatile;
|
---|
598 | };
|
---|
599 | entry sTypeInfo eTypeInfo;
|
---|
600 | [ref_desc]
|
---|
601 | call sTypeInfo cTypeInfo;
|
---|
602 | };
|
---|
603 | celltype tDescriptorTypeInfo {
|
---|
604 | attr {
|
---|
605 | char_t *name;
|
---|
606 | int8_t typeKind;
|
---|
607 | uint32_t size; /* bytes */
|
---|
608 | bool_t b_const;
|
---|
609 | bool_t b_volatile;
|
---|
610 | };
|
---|
611 | entry sTypeInfo eTypeInfo;
|
---|
612 | [ref_desc]
|
---|
613 | call sSignatureInfo cSignatureInfo;
|
---|
614 | FACTORY {
|
---|
615 | write( "$ct_global$_factory.h", "#include \"include_all_signature_header.h\"" );
|
---|
616 | };
|
---|
617 | };
|
---|
618 | };
|
---|