3 void fillloconsize( locon_list
*locon
, sizelocon
*size
)
11 size
->SIZE
= size
->SIZE
+ sizeof( locon_list
);
12 size
->SIZENAME
= size
->SIZENAME
+ (strlen( locon
->NAME
)+1 )*sizeof( char );
14 for( pnode
= locon
->PNODE
; pnode
; pnode
= pnode
->NEXT
) {
15 size
->SIZE
= size
->SIZE
+ sizeof( num_list
);
18 for( ptl
= locon
->USER
; ptl
; ptl
= ptl
->NEXT
) {
20 size
->SIZEPTYPE
= size
->SIZEPTYPE
+ sizeof( ptype_list
);
24 if( ptl
->TYPE
== RCXNAME
) {
25 size
->SIZERCXNAME
= size
->SIZERCXNAME
+ (strlen( (char*)ptl
->DATA
)+1 )*sizeof( char );
29 if( ptl
->TYPE
== PNODENAME
) {
30 for( chain
= (chain_list
*)ptl
->DATA
; chain
; chain
= chain
->NEXT
) {
31 size
->SIZEPNODENAME
= size
->SIZEPNODENAME
+ sizeof( chain_list
) + (strlen( (char*)chain
->DATA
)+1 )*sizeof( char );
36 if( ptl
->TYPE
== RCX_LOCONCAPA_SPACE
)
40 printf( "unknown ptype 0x%X / %lu for locon %s\n", (unsigned)ptl
->TYPE
, ptl
->TYPE
, locon
->NAME
);
45 void filllotrssize( lotrs_list
*lotrs
, sizelotrs
*size
)
55 size
->SIZE
= size
->SIZE
+ sizeof( lotrs_list
);
56 if( lotrs
->GRID
) fillloconsize( lotrs
->GRID
, &size
->LOCON
);
57 if( lotrs
->SOURCE
) fillloconsize( lotrs
->SOURCE
, &size
->LOCON
);
58 if( lotrs
->DRAIN
) fillloconsize( lotrs
->DRAIN
, &size
->LOCON
);
59 if( lotrs
->BULK
) fillloconsize( lotrs
->BULK
, &size
->LOCON
);
61 size
->SIZENAME
= size
->SIZENAME
+ (strlen(lotrs
->TRNAME
)+1)*sizeof(char) ;
63 for( ptl
= lotrs
->USER
; ptl
; ptl
= ptl
->NEXT
) {
65 size
->SIZEPTYPE
= size
->SIZEPTYPE
+ sizeof( ptype_list
);
67 if( ptl
->TYPE
== MBK_TRANS_PARALLEL
||
68 ptl
->TYPE
== TAS_TRANS_LINK
) {
69 for( chain
= (chain_list
*)ptl
->DATA
; chain
; chain
= chain
->NEXT
)
70 size
->SIZE
= size
->SIZE
+ sizeof( chain_list
);
74 if( ptl
->TYPE
== CNS_INDEX
||
75 ptl
->TYPE
== ELP_LOTRS_MODEL
||
76 ptl
->TYPE
== CNS_DRIVINGCONE
||
77 ptl
->TYPE
== TAS_TRANS_USED
||
78 ptl
->TYPE
== TAS_CAPA_USED
||
79 ptl
->TYPE
== TAS_TRANS_SWITCH
)
83 printf( "unknown ptype 0x%X / %lu for lotrs %s\n", (unsigned)ptl
->TYPE
, ptl
->TYPE
, lotrs
->TRNAME
);
87 void fillcnssize( cnsfig_list
*cns
, sizecns
*size
)
91 for( lotrs
= cns
->LOTRS
; lotrs
; lotrs
= lotrs
->NEXT
) {
92 filllotrssize( lotrs
, &size
->SIZELOTRS
);
96 void displaycnssize( sizecns
*size
)
99 size_t sizelotrslocon
;
101 sizelotrslocon
= size
->SIZELOTRS
.LOCON
.SIZE
+
102 size
->SIZELOTRS
.LOCON
.SIZENAME
+
103 size
->SIZELOTRS
.LOCON
.SIZERCXNAME
+
104 size
->SIZELOTRS
.LOCON
.SIZEPTYPE
+
105 size
->SIZELOTRS
.LOCON
.SIZEPNODENAME
;
106 sizelotrs
= size
->SIZELOTRS
.SIZE
+
107 size
->SIZELOTRS
.SIZENAME
+
108 size
->SIZELOTRS
.SIZEPTYPE
+
111 printf( "lotrs : %10lu\n", (unsigned long)sizelotrs
);
112 printf( " lotrs %6d -> %10lu\n", size
->SIZELOTRS
.NB
, (unsigned long)size
->SIZELOTRS
.SIZE
);
113 printf( " name %10lu\n", (unsigned long)size
->SIZELOTRS
.SIZENAME
);
114 printf( " ptype %10lu\n", (unsigned long)size
->SIZELOTRS
.SIZEPTYPE
);
115 printf( " locon %10lu\n", (unsigned long)sizelotrslocon
);
116 printf( " locon %6d -> %10lu\n", size
->SIZELOTRS
.LOCON
.NB
, (unsigned long)size
->SIZELOTRS
.LOCON
.SIZE
);
117 printf( " name %10lu\n", (unsigned long)size
->SIZELOTRS
.LOCON
.SIZENAME
);
118 printf( " rcxname %10lu\n", (unsigned long)size
->SIZELOTRS
.LOCON
.SIZERCXNAME
);
119 printf( " ptype %10lu\n", (unsigned long)size
->SIZELOTRS
.LOCON
.SIZEPTYPE
);
120 printf( " pnodename %10lu\n", (unsigned long)size
->SIZELOTRS
.LOCON
.SIZEPNODENAME
);
123 void tas_displaymemoryusage( cnsfig_list
*cnsfig
)
128 branch_list
*tabbranch
[3] ;
129 branch_list
*branch
;
130 locon_list
*tablocon
[2] ;
138 int nbcaraclink
= 0 ;
140 int nbptypecone
= 0 ;
141 int nbptypeedge
= 0 ;
142 int nbptypelink
= 0 ;
143 int nbptypelocon
= 0 ;
147 int sizecaraclink
= 0 ;
148 int sizecaraccon
= 0 ;
155 size
.SIZELOTRS
.SIZE
= 0 ;
156 size
.SIZELOTRS
.NB
= 0 ;
157 size
.SIZELOTRS
.SIZENAME
= 0 ;
158 size
.SIZELOTRS
.SIZEPTYPE
= 0 ;
159 size
.SIZELOTRS
.LOCON
.SIZE
= 0 ;
160 size
.SIZELOTRS
.LOCON
.NB
= 0 ;
161 size
.SIZELOTRS
.LOCON
.SIZEPTYPE
= 0 ;
162 size
.SIZELOTRS
.LOCON
.SIZENAME
= 0 ;
163 size
.SIZELOTRS
.LOCON
.SIZERCXNAME
= 0 ;
164 size
.SIZELOTRS
.LOCON
.SIZEPNODENAME
= 0 ;
166 fillcnssize( cnsfig
, &size
);
167 displaycnssize( &size
);
170 for( cone
= cnsfig
->CONE
; cone
; cone
= cone
->NEXT
) {
172 for( ptl
= cone
->USER
; ptl
; ptl
= ptl
->NEXT
) {
176 if( ptl
->TYPE
== TAS_SLOPE_MAX
)
179 if( ptl
->TYPE
== TAS_SLOPE_MIN
)
183 for( incone
= cone
->INCONE
; incone
; incone
= incone
->NEXT
) {
186 for( ptl
= incone
->USER
; ptl
; ptl
= ptl
->NEXT
) {
190 if( ptl
->TYPE
== TAS_DELAY_MAX
)
193 if( ptl
->TYPE
== TAS_DELAY_MIN
)
198 tabbranch
[0]=cone
->BREXT
;
199 tabbranch
[1]=cone
->BRVDD
;
200 tabbranch
[2]=cone
->BRVSS
;
202 for( i
=0 ; i
<=2 ; i
++ ) {
204 for( branch
= tabbranch
[i
] ; branch
; branch
= branch
->NEXT
) {
206 for( link
= branch
->LINK
; link
; link
= link
->NEXT
) {
208 for( ptl
= link
->USER
; ptl
; ptl
= ptl
->NEXT
) {
211 if( ptl
->TYPE
== TAS_LINK_CARAC
)
219 tablocon
[0] = cnsfig
->LOCON
;
220 tablocon
[1] = cnsfig
->INTCON
;
222 for( i
=0 ; i
<=1 ; i
++ ) {
224 for( locon
= tablocon
[i
] ; locon
; locon
= locon
->NEXT
) {
226 for( ptl
= locon
->USER
; ptl
; ptl
= ptl
->NEXT
) {
230 if( ptl
->TYPE
== TAS_CON_CARAC
)
233 if( ptl
->TYPE
== TAS_SLOPE_MIN
)
236 if( ptl
->TYPE
== TAS_SLOPE_MAX
)
239 if( ptl
->TYPE
== TAS_DELAY_MAX
)
242 if( ptl
->TYPE
== TAS_DELAY_MIN
)
248 sizedelay
= nbdelay
* sizeof( delay_list
) ;
249 sizefront
= nbfront
* sizeof( front_list
) ;
250 sizecaraclink
= nbcaraclink
* sizeof( caraclink_list
) ;
251 sizecaraccon
= nbcaraccon
* sizeof( caraccon_list
) ;
252 nbptype
= nbptypecone
+ nbptypeedge
+ nbptypelink
+ nbptypelocon
;
253 sizeptype
= nbptype
* sizeof( ptype_list
) ;
255 total
= sizedelay
+ sizefront
+ sizecaraclink
+ sizecaraccon
+ sizeptype
;
257 printf( "structure delay_list : %6d %10d\n", nbdelay
, sizedelay
);
258 printf( "structure front_list : %6d %10d\n", nbfront
, sizefront
);
259 printf( "structure caraclink_list : %6d %10d\n", nbcaraclink
, sizecaraclink
);
260 printf( "structure caraccon_list : %6d %10d\n", nbcaraccon
, sizecaraccon
);
261 printf( "ptype cone : %6d\n", nbptypecone
);
262 printf( "ptype edge : %6d\n", nbptypeedge
);
263 printf( "ptype link : %6d\n", nbptypelink
);
264 printf( "ptype locon : %6d\n", nbptypelocon
);
265 printf( "structure ptype : %6d %10d\n", nbptype
, sizeptype
);
266 printf( " total : %10d\n", total
);