Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 11 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * $Id: statistics.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $ |
2 | * $Id: statistics.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $ |
3 | * |
3 | * |
4 | * $Log: statistics.c,v $ |
4 | * $Log: statistics.c,v $ |
5 | * Revision 1.1.1.1 2003/11/04 23:34:57 mjames |
5 | * Revision 1.1.1.1 2003/11/04 23:34:57 mjames |
6 | * Imported into local repositrory |
6 | * Imported into local repositrory |
7 | * |
7 | * |
Line 40... | Line 40... | ||
40 | * Mike put it here |
40 | * Mike put it here |
41 | * |
41 | * |
42 | * |
42 | * |
43 | * Revision 1.37 2000/10/12 14:27:48 14:27:48 mjames (Mike James) |
43 | * Revision 1.37 2000/10/12 14:27:48 14:27:48 mjames (Mike James) |
44 | * changed listing vhdl signals to expand expressions |
44 | * changed listing vhdl signals to expand expressions |
45 | * until a constant is located |
45 | * until a constant is located |
46 | * |
46 | * |
47 | * Revision 1.36 2000/10/04 10:37:10 10:37:10 mjames (Mike James) |
47 | * Revision 1.36 2000/10/04 10:37:10 10:37:10 mjames (Mike James) |
48 | * Modified for Vertical2 : support COMPONENTS and SIGNALS |
48 | * Modified for Vertical2 : support COMPONENTS and SIGNALS |
49 | * |
49 | * |
50 | * Revision 1.36 2000/10/04 10:37:10 10:37:10 mjames (Mike James) |
50 | * Revision 1.36 2000/10/04 10:37:10 10:37:10 mjames (Mike James) |
51 | * Part of Release PSAVAT01 |
51 | * Part of Release PSAVAT01 |
52 | * |
52 | * |
53 | * Revision 1.35 2000/10/02 11:04:21 11:04:21 mjames (Mike James) |
53 | * Revision 1.35 2000/10/02 11:04:21 11:04:21 mjames (Mike James) |
54 | * new_vhdl |
54 | * new_vhdl |
55 | * |
55 | * |
56 | * Revision 1.34 2000/09/27 14:42:21 14:42:21 mjames (Mike James) |
56 | * Revision 1.34 2000/09/27 14:42:21 14:42:21 mjames (Mike James) |
57 | * Part of Release Sep_27_ST_2000 |
57 | * Part of Release Sep_27_ST_2000 |
58 | * |
58 | * |
59 | * Revision 1.33 2000/09/21 10:15:51 10:15:51 mjames (Mike James) |
59 | * Revision 1.33 2000/09/21 10:15:51 10:15:51 mjames (Mike James) |
60 | * Part of Release Sep21Alpha |
60 | * Part of Release Sep21Alpha |
61 | * |
61 | * |
62 | * Revision 1.32 2000/09/21 09:47:33 09:47:33 mjames (Mike James) |
62 | * Revision 1.32 2000/09/21 09:47:33 09:47:33 mjames (Mike James) |
63 | * Corrected <cr> problem |
63 | * Corrected <cr> problem |
64 | * |
64 | * |
65 | * Revision 1.31 2000/08/25 09:57:17 09:57:17 mjames (Mike James) |
65 | * Revision 1.31 2000/08/25 09:57:17 09:57:17 mjames (Mike James) |
66 | * Part of Release Aug25_alpha |
66 | * Part of Release Aug25_alpha |
67 | * |
67 | * |
68 | * Revision 1.30 2000/08/16 08:57:33 08:57:33 mjames (Mike James) |
68 | * Revision 1.30 2000/08/16 08:57:33 08:57:33 mjames (Mike James) |
69 | * Part of Release CD01_Aug2000 |
69 | * Part of Release CD01_Aug2000 |
70 | * |
70 | * |
71 | * Revision 1.29 2000/08/14 14:45:14 14:45:14 mjames (Mike James) |
71 | * Revision 1.29 2000/08/14 14:45:14 14:45:14 mjames (Mike James) |
72 | * Part of Release Aug_14_2000 |
72 | * Part of Release Aug_14_2000 |
73 | * |
73 | * |
74 | * Revision 1.28 2000/08/11 08:30:34 08:30:34 mjames (Mike James) |
74 | * Revision 1.28 2000/08/11 08:30:34 08:30:34 mjames (Mike James) |
75 | * Part of Release Aug_11_2000 |
75 | * Part of Release Aug_11_2000 |
76 | * |
76 | * |
77 | * Revision 1.27 2000/08/09 10:31:50 10:31:50 mjames (Mike James) |
77 | * Revision 1.27 2000/08/09 10:31:50 10:31:50 mjames (Mike James) |
78 | * Part of Release Aug__9_2000 |
78 | * Part of Release Aug__9_2000 |
79 | * |
79 | * |
80 | * Revision 1.26 2000/05/31 11:43:01 11:43:01 mjames (Mike James) |
80 | * Revision 1.26 2000/05/31 11:43:01 11:43:01 mjames (Mike James) |
81 | * Part of Release May_31_2000 |
81 | * Part of Release May_31_2000 |
82 | * |
82 | * |
83 | * Revision 1.25 2000/05/08 17:01:40 17:01:40 mjames (Mike James) |
83 | * Revision 1.25 2000/05/08 17:01:40 17:01:40 mjames (Mike James) |
84 | * Part of Release May__8_2000 |
84 | * Part of Release May__8_2000 |
85 | * |
85 | * |
86 | * Revision 1.24 2000/05/08 16:59:33 16:59:33 mjames (Mike James) |
86 | * Revision 1.24 2000/05/08 16:59:33 16:59:33 mjames (Mike James) |
87 | * Part of Release May__8_2000 |
87 | * Part of Release May__8_2000 |
88 | * |
88 | * |
89 | * Revision 1.23 2000/05/08 16:57:10 16:57:10 mjames (Mike James) |
89 | * Revision 1.23 2000/05/08 16:57:10 16:57:10 mjames (Mike James) |
90 | * Part of Release May__8_2000 |
90 | * Part of Release May__8_2000 |
91 | * |
91 | * |
92 | * Revision 1.22 2000/05/03 15:28:39 15:28:39 mjames (Mike James) |
92 | * Revision 1.22 2000/05/03 15:28:39 15:28:39 mjames (Mike James) |
93 | * Corrected abuse of null pointers |
93 | * Corrected abuse of null pointers |
94 | * |
94 | * |
95 | * Revision 1.21 2000/03/08 16:19:33 16:19:33 mjames (Mike James) |
95 | * Revision 1.21 2000/03/08 16:19:33 16:19:33 mjames (Mike James) |
96 | * New version including PC |
96 | * New version including PC |
97 | * |
97 | * |
98 | * Revision 1.18 2000/01/20 15:58:51 15:58:51 mjames (Mike James) |
98 | * Revision 1.18 2000/01/20 15:58:51 15:58:51 mjames (Mike James) |
99 | * Part of Release R22 |
99 | * Part of Release R22 |
100 | * |
100 | * |
101 | * Revision 1.17 99/12/22 11:15:31 11:15:31 mjames (Mike James) |
101 | * Revision 1.17 99/12/22 11:15:31 11:15:31 mjames (Mike James) |
102 | * Part of Release Dec_22_1999 |
102 | * Part of Release Dec_22_1999 |
103 | * |
103 | * |
104 | * Revision 1.16 99/06/25 14:35:52 14:35:52 mjames (Mike James) |
104 | * Revision 1.16 99/06/25 14:35:52 14:35:52 mjames (Mike James) |
105 | * Added in reference to expression.h, but no changes made |
105 | * Added in reference to expression.h, but no changes made |
106 | * to the function of acfread yet. |
106 | * to the function of acfread yet. |
107 | * |
107 | * |
108 | * Revision 1.15 99/05/04 09:52:55 09:52:55 mjames (Mike James) |
108 | * Revision 1.15 99/05/04 09:52:55 09:52:55 mjames (Mike James) |
109 | * General checkin |
109 | * General checkin |
110 | * |
110 | * |
111 | * Revision 1.14 98/03/16 11:39:55 11:39:55 mjames (Mike James) |
111 | * Revision 1.14 98/03/16 11:39:55 11:39:55 mjames (Mike James) |
112 | * Altered XREF printout to use wildcards. |
112 | * Altered XREF printout to use wildcards. |
113 | * |
113 | * |
114 | * Revision 1.13 98/02/11 11:27:25 11:27:25 mjames (Mike James) |
114 | * Revision 1.13 98/02/11 11:27:25 11:27:25 mjames (Mike James) |
115 | * Checked in for version 6.2a |
115 | * Checked in for version 6.2a |
116 | * |
116 | * |
117 | * Revision 1.12 97/04/23 08:43:26 08:43:26 mjames (Mike James) |
117 | * Revision 1.12 97/04/23 08:43:26 08:43:26 mjames (Mike James) |
118 | * CHecked in for release rel23041997 |
118 | * CHecked in for release rel23041997 |
119 | * |
119 | * |
120 | * Revision 1.11 97/01/03 13:37:29 13:37:29 mjames (Mike James) |
120 | * Revision 1.11 97/01/03 13:37:29 13:37:29 mjames (Mike James) |
121 | * Tidied up the ensure_reserved() function. Added in a flag to |
121 | * Tidied up the ensure_reserved() function. Added in a flag to |
122 | * indicate that a net has been processed by ensure_reserved() |
122 | * indicate that a net has been processed by ensure_reserved() |
123 | * And so is not in error for only having 0 or 1 nodes names (which is the |
123 | * And so is not in error for only having 0 or 1 nodes names (which is the |
124 | * case for a 1 or 2 node net that has been processed. One of the nodes will |
124 | * case for a 1 or 2 node net that has been processed. One of the nodes will |
125 | * remain unnnamed and this will result in 0 or 1 nodes apparently in use |
125 | * remain unnnamed and this will result in 0 or 1 nodes apparently in use |
126 | * |
126 | * |
127 | * Revision 1.10 96/12/23 15:15:34 15:15:34 mjames (Mike James) |
127 | * Revision 1.10 96/12/23 15:15:34 15:15:34 mjames (Mike James) |
128 | * ? |
128 | * ? |
129 | * |
129 | * |
130 | * Revision 1.9 96/12/13 08:43:14 08:43:14 mjames (Mike James) |
130 | * Revision 1.9 96/12/13 08:43:14 08:43:14 mjames (Mike James) |
131 | * Update to v5.1, added Write ID , exact routing |
131 | * Update to v5.1, added Write ID , exact routing |
132 | * |
132 | * |
133 | * Revision 1.8 96/08/06 13:38:57 13:38:57 mjames (Mike James) |
133 | * Revision 1.8 96/08/06 13:38:57 13:38:57 mjames (Mike James) |
134 | * Added a count of nets with low numbers of nodes in the routed list. |
134 | * Added a count of nets with low numbers of nodes in the routed list. |
135 | * |
135 | * |
136 | * Revision 1.7 96/07/19 14:38:46 14:38:46 mjames (Mike James) |
136 | * Revision 1.7 96/07/19 14:38:46 14:38:46 mjames (Mike James) |
137 | * Update to give to PRL |
137 | * Update to give to PRL |
Line 159... | Line 159... | ||
159 | * Initial revision |
159 | * Initial revision |
160 | * */ |
160 | * */ |
161 | /* The statistics module . This counts the connections between the chip and |
161 | /* The statistics module . This counts the connections between the chip and |
162 | other named chips. */ |
162 | other named chips. */ |
163 | 163 | ||
- | 164 | #include <stdio.h> |
|
- | 165 | #include <string.h> |
|
164 | #include "statistics.h" |
166 | #include <stdlib.h> |
- | 167 | #include <sys/types.h> |
|
- | 168 | #include <regex.h> |
|
165 | 169 | ||
166 | #include "chck_names.h" |
- | |
167 | #include "cmdlog.h" |
- | |
168 | #include "cmdparse.h" |
- | |
169 | #include "database.h" |
- | |
170 | #include "expression.h" |
170 | #include "expression.h" |
171 | #include "generic.h" |
171 | #include "generic.h" |
- | 172 | #include "database.h" |
|
- | 173 | ||
- | 174 | ||
- | 175 | ||
- | 176 | #include "vertcl_main.h" |
|
- | 177 | #include "statistics.h" |
|
- | 178 | #include "cmdparse.h" |
|
- | 179 | #include "cmdlog.h" |
|
172 | #include "lx_support.h" |
180 | #include "lx_support.h" |
- | 181 | #include "chck_names.h" |
|
173 | #include "sorting.h" |
182 | #include "sorting.h" |
174 | #include "vertcl_main.h" |
- | |
175 | 183 | ||
176 | #include <regex.h> |
- | |
177 | #include <stdio.h> |
- | |
178 | #include <stdlib.h> |
- | |
179 | #include <string.h> |
- | |
180 | #include <sys/types.h> |
184 | static char IDstr[] = "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/statistics.c,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $"; |
181 | 185 | ||
182 | static char IDstr[] = "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/statistics.c,v 1.1.1.1 " |
- | |
183 | "2003/11/04 23:34:57 mjames Exp $"; |
- | |
184 | 186 | ||
185 | /* this procedure counts paths from a named socket to all other named |
187 | /* this procedure counts paths from a named socket to all other named |
186 | sockets. There are two wildcard options : |
188 | sockets. There are two wildcard options : |
187 | no wildcard : all sockets are listed |
189 | no wildcard : all sockets are listed |
188 | string* : any string beginning 'string' |
190 | string* : any string beginning 'string' |
189 | * : all named sockets */ |
191 | * : all named sockets */ |
190 | 192 | ||
191 | int count_paths (char *template) |
193 | int count_paths(char * template) |
192 | { |
194 | { |
193 | socket_t *skt_p, *skt_try; |
195 | socket_t * skt_p, * skt_try; |
194 | noderef_t *net_nodes; |
196 | noderef_t * net_nodes; |
195 | node_t *skt_nodes; |
197 | node_t * skt_nodes ; |
196 | net_t **list_member; |
198 | net_t ** list_member; |
197 | int rc; |
199 | int rc; |
198 | 200 | ||
199 | char *pattern; |
201 | char * pattern; |
200 | /* compile regular expression */ |
202 | /* compile regular expression */ |
201 | vert_regex_t *preg; |
203 | vert_regex_t * preg; |
- | 204 | ||
202 | 205 | ||
203 | skt_p = socket_head; |
206 | skt_p = socket_head; |
204 | /* clear all of the visit counters */ |
207 | /* clear all of the visit counters */ |
205 | while (skt_p) |
208 | while (skt_p) { |
- | 209 | skt_p->named_in_use_cnt = |
|
206 | { |
210 | skt_p->named_cnt = |
207 | skt_p->named_in_use_cnt = skt_p->named_cnt = skt_p->routed_cnt = |
211 | skt_p->routed_cnt= |
208 | skt_p->unrouted_cnt = 0; |
212 | skt_p->unrouted_cnt = 0; |
209 | skt_p = skt_p->next; |
213 | skt_p=skt_p->next; |
210 | } |
214 | } |
211 | if (!ISNULLSTR (template)) |
215 | if(!ISNULLSTR(template)) |
212 | { |
216 | { |
213 | pattern = template; |
217 | pattern = template; |
214 | } |
218 | } |
215 | else |
219 | else |
216 | { |
220 | { |
217 | pattern = ".*"; |
221 | pattern = ".*"; |
- | 222 | } |
|
- | 223 | ||
- | 224 | rc = vert_regcomp(&preg,pattern); |
|
- | 225 | ||
- | 226 | if (rc != 0 ) |
|
- | 227 | { |
|
- | 228 | char errbuff[100]; |
|
- | 229 | regerror(rc,preg->preg,errbuff,100); |
|
- | 230 | Log(LOG_ERROR,"-- Problem (rc=%d) %s with '%s' as regular expression\n",rc,errbuff,pattern); |
|
- | 231 | ||
- | 232 | return TCL_ERROR; |
|
218 | } |
233 | } |
- | 234 | ||
- | 235 | Log(LOG_GENERAL,"-- Listing xref for socket names '%s' --\n", |
|
- | 236 | template?template:"[ALL Sockets]"); |
|
- | 237 | ||
- | 238 | skt_p = socket_head; |
|
- | 239 | while(skt_p) { |
|
- | 240 | int found; |
|
219 | 241 | ||
220 | rc = vert_regcomp (&preg, pattern); |
242 | found = regexec(preg->preg,skt_p->name,0,preg->regpatt,0); |
- | 243 | if(!found) { |
|
221 | 244 | ||
222 | if (rc != 0) |
245 | skt_nodes = skt_p -> nodes ; |
223 | { |
246 | /* |
224 | char errbuff[100]; |
247 | fprintf(f,"named = %p , routed = %p unrouted = %p\n", |
225 | regerror (rc, preg->preg, errbuff, 100); |
248 | &named_list,&routed_list,&unrouted_list); |
226 | Log ( |
249 | */ |
227 | LOG_ERROR, |
250 | /* we have located the socket on the net . Let us now locate each net */ |
228 | "-- Problem (rc=%d) %s with '%s' as regular expression\n", |
251 | /* some nodes on a socket will be unrouted nodes on unrouted nets that |
229 | rc, |
252 | have now been resolved , and the unrouted net will have been deleted . |
230 | errbuff, |
253 | These have the property that node->net->list_ref = NULL */ |
231 | pattern); |
254 | while(skt_nodes) { |
232 | 255 | net_t * ref_net = skt_nodes->net; |
|
233 | return TCL_ERROR; |
256 | if(ref_net) { |
234 | } |
257 | int high,low,width,net_high,net_low; |
235 | 258 | ||
236 | Log ( |
259 | |
237 | LOG_GENERAL, |
260 | net_nodes = ref_net->nodes; |
238 | "-- Listing xref for socket names '%s' --\n", |
261 | |
239 | template ? template : "[ALL Sockets]"); |
262 | |
240 | 263 | /* note the upper and lower bound of the bundle connected from this |
|
241 | skt_p = socket_head; |
264 | * pin of this socket to the net. |
242 | while (skt_p) |
265 | * Also checking there is an associated VHDL type 4 May 2000 */ |
243 | { |
266 | if (skt_nodes->vhdltype) { |
244 | int found; |
267 | eval_vhdl_expression(skt_nodes->vhdltype->expr,&net_high,&net_low); |
245 | 268 | } |
|
246 | found = regexec (preg->preg, skt_p->name, 0, preg->regpatt, 0); |
269 | else { |
247 | if (!found) |
270 | net_low = 0; |
248 | { |
271 | net_high= 0; |
249 | skt_nodes = skt_p->nodes; |
272 | } |
250 | /* |
273 | |
251 | fprintf(f,"named = %p , routed = %p unrouted = %p\n", |
274 | /* which list is this net on */ |
252 | &named_list,&routed_list,&unrouted_list); |
275 | list_member = ref_net->list_ref; |
253 | */ |
276 | /* visit each node */ |
254 | /* we have located the socket on the net . Let us now locate each net |
277 | while(net_nodes){ |
255 | */ |
278 | node_t * n = net_nodes->node; |
256 | /* some nodes on a socket will be unrouted nodes on unrouted nets that |
279 | vhdl_t * vhdl= net_nodes->vhdltype; |
257 | have now been resolved , and the unrouted net will have been deleted |
280 | int vhdl_high,vhdl_low; |
258 | . These have the property that node->net->list_ref = NULL */ |
281 | if (vhdl) { |
259 | while (skt_nodes) |
282 | /* to determine the intersection of the bundles, |
260 | { |
283 | * hence connection count : |
261 | net_t *ref_net = skt_nodes->net; |
284 | * (15 downto 8) connected to (10 downto 5) has intersection |
262 | if (ref_net) |
285 | * (10 downto 8) |
263 | { |
286 | */ |
264 | int high, low, width, net_high, net_low; |
287 | if (vhdl->expr) |
265 | 288 | eval_vhdl_expression(vhdl->expr,&vhdl_high,&vhdl_low); |
|
266 | net_nodes = ref_net->nodes; |
289 | else { |
267 | 290 | vhdl_high = 0; |
|
268 | /* note the upper and lower bound of the bundle |
291 | vhdl_low = 0; |
269 | * connected from this pin of this socket to the net. |
292 | } |
270 | * Also checking there is an associated VHDL type 4 May |
293 | /* use the lowest high bound of the node this net comes from */ |
271 | * 2000 */ |
294 | high = vhdl_high > net_high ? net_high : vhdl_high; |
272 | if (skt_nodes->vhdltype) |
295 | |
273 | { |
296 | /* use the highest low bound of the node this net comes from */ |
274 | eval_vhdl_expression ( |
297 | low = vhdl_low < net_low ? net_low : vhdl_low; |
275 | skt_nodes->vhdltype->expr, |
298 | |
276 | &net_high, |
299 | /* now get the number of wires in the bundle */ |
277 | &net_low); |
300 | width = high - low + 1; |
278 | } |
301 | if(list_member==&named_list) { |
279 | else |
302 | if (n->in_use) |
280 | { |
303 | n->socket->named_in_use_cnt += width; |
281 | net_low = 0; |
304 | else |
282 | net_high = 0; |
305 | n->socket->named_cnt += width; |
283 | } |
306 | } |
284 | 307 | else if (list_member==&routed_list) |
|
285 | /* which list is this net on */ |
308 | n->socket->routed_cnt += width; |
286 | list_member = ref_net->list_ref; |
309 | else if (list_member==&unrouted_list) |
287 | /* visit each node */ |
310 | n->socket->unrouted_cnt += width; |
288 | while (net_nodes) |
311 | else if (list_member!=NULL) |
289 | { |
312 | Log(LOG_ERROR,"# ERROR : Net %s is on unknown list pointer=%p , net \n",ref_net->name,list_member); |
290 | node_t *n = net_nodes->node; |
313 | } |
291 | vhdl_t *vhdl = net_nodes->vhdltype; |
314 | net_nodes = net_nodes->next; |
292 | int vhdl_high, vhdl_low; |
315 | } |
293 | if (vhdl) |
316 | } |
294 | { |
317 | skt_nodes = skt_nodes->sktnext; |
295 | /* to determine the intersection of the |
318 | } |
296 | * bundles, hence connection count : |
319 | /* now have compiled a cross reference count */ |
297 | * (15 downto 8) connected to (10 |
320 | skt_try = socket_head; |
298 | * downto 5) has intersection (10 |
321 | Log(LOG_GENERAL,"-- Cross reference for socket '%s'\n",skt_p->name); |
299 | * downto 8) |
322 | Log(LOG_GENERAL,"Name : Named&Used, Named, Routed,Unrouted\n"); |
300 | */ |
323 | skt_try = socket_head; |
301 | if (vhdl->expr) |
324 | while(skt_try){ |
302 | eval_vhdl_expression ( |
325 | if(!ISNULLSTR(skt_try->name)){ |
303 | vhdl->expr, |
326 | Log(LOG_GENERAL,"%16s : %5d, %5d, %5d, %5d\n", |
304 | &vhdl_high, |
327 | skt_try -> name, |
305 | &vhdl_low); |
328 | skt_try -> named_in_use_cnt, |
306 | else |
329 | skt_try -> named_cnt, |
307 | { |
330 | skt_try -> routed_cnt, |
308 | vhdl_high = 0; |
331 | skt_try -> unrouted_cnt); |
309 | vhdl_low = 0; |
- | |
310 | } |
- | |
311 | /* use the lowest high bound of the |
- | |
312 | * node this net comes from */ |
- | |
313 | high = vhdl_high > net_high |
- | |
314 | ? net_high |
- | |
315 | : vhdl_high; |
- | |
316 | - | ||
317 | /* use the highest low bound of the |
- | |
318 | * node this net comes from */ |
- | |
319 | low = vhdl_low < net_low ? net_low |
- | |
320 | : vhdl_low; |
- | |
321 | - | ||
322 | /* now get the number of wires in the |
- | |
323 | * bundle */ |
- | |
324 | width = high - low + 1; |
- | |
325 | if (list_member == &named_list) |
- | |
326 | { |
- | |
327 | if (n->in_use) |
- | |
328 | n->socket |
- | |
329 | ->named_in_use_cnt += |
- | |
330 | width; |
- | |
331 | else |
- | |
332 | n->socket->named_cnt += |
- | |
333 | width; |
- | |
334 | } |
- | |
335 | else if (list_member == &routed_list) |
- | |
336 | n->socket->routed_cnt += width; |
- | |
337 | else if (list_member == &unrouted_list) |
- | |
338 | n->socket->unrouted_cnt += |
- | |
339 | width; |
- | |
340 | else if (list_member != NULL) |
- | |
341 | Log ( |
- | |
342 | LOG_ERROR, |
- | |
343 | "# ERROR : Net %s is on " |
- | |
344 | "unknown list pointer=%p " |
- | |
345 | ", net \n", |
- | |
346 | ref_net->name, |
- | |
347 | list_member); |
- | |
348 | } |
- | |
349 | net_nodes = net_nodes->next; |
- | |
350 | } |
- | |
351 | } |
- | |
352 | skt_nodes = skt_nodes->sktnext; |
- | |
353 | } |
- | |
354 | /* now have compiled a cross reference count */ |
- | |
355 | skt_try = socket_head; |
- | |
356 | Log ( |
- | |
357 | LOG_GENERAL, "-- Cross reference for socket '%s'\n", skt_p->name); |
- | |
358 | Log ( |
- | |
359 | LOG_GENERAL, |
- | |
360 | "Name : Named&Used, Named, Routed,Unrouted\n"); |
- | |
361 | skt_try = socket_head; |
- | |
362 | while (skt_try) |
- | |
363 | { |
- | |
364 | if (!ISNULLSTR (skt_try->name)) |
- | |
365 | { |
- | |
366 | Log ( |
- | |
367 | LOG_GENERAL, |
- | |
368 | "%16s : %5d, %5d, %5d, %5d\n", |
- | |
369 | skt_try->name, |
- | |
370 | skt_try->named_in_use_cnt, |
- | |
371 | skt_try->named_cnt, |
- | |
372 | skt_try->routed_cnt, |
- | |
373 | skt_try->unrouted_cnt); |
- | |
374 | } |
- | |
375 | skt_try->named_in_use_cnt = skt_try->named_cnt = |
- | |
376 | skt_try->routed_cnt = skt_try->unrouted_cnt = 0; |
- | |
377 | skt_try = skt_try->next; |
- | |
378 | } |
- | |
379 | } |
- | |
380 | skt_p = skt_p->next; |
- | |
381 | } |
332 | } |
- | 333 | skt_try->named_in_use_cnt = |
|
- | 334 | skt_try->named_cnt = |
|
- | 335 | skt_try->routed_cnt= |
|
- | 336 | skt_try->unrouted_cnt = 0; |
|
- | 337 | skt_try = skt_try->next; |
|
- | 338 | } |
|
- | 339 | } |
|
- | 340 | skt_p = skt_p->next; |
|
- | 341 | } |
|
382 | 342 | ||
383 | vert_regfree (&preg); |
343 | vert_regfree(&preg); |
384 | return OKCMD; /* success */ |
344 | return OKCMD; /* success */ |
385 | } |
345 | } |
386 | 346 | ||
387 | /* this procedure counts up and displays the number of nets with less than a certain |
347 | /* this procedure counts up and displays the number of nets with less than a certain |
388 | threshold number of nodes actually in use. */ |
348 | threshold number of nodes actually in use. */ |
389 | void count_nets_with_few_nodes (int limit) |
349 | void count_nets_with_few_nodes(int limit) |
390 | { |
350 | { |
391 | long lowcount = 0; |
351 | long lowcount=0; |
392 | net_t *routed_net = named_list; |
352 | net_t * routed_net = named_list; |
393 | Log ( |
- | |
394 | LOG_GENERAL, |
- | |
395 | "-- Checking for nets with less than or equal to %d nodes in use\n", |
353 | Log(LOG_GENERAL,"-- Checking for nets with less than or equal to %d nodes in use\n", |
396 | limit); |
354 | limit); |
397 | while (routed_net) |
355 | while (routed_net) { |
398 | { |
- | |
399 | int nodecount = 0; |
356 | int nodecount = 0; |
400 | noderef_t *routed_nodes = routed_net->nodes; |
357 | noderef_t * routed_nodes = routed_net->nodes; |
401 | while (routed_nodes) |
358 | while (routed_nodes) { |
402 | { |
- | |
403 | /* node_t *cnode = routed_nodes->node; */ |
359 | /* node_t *cnode = routed_nodes->node; */ |
404 | if (routed_nodes->node->net_assigned != 0) |
360 | if (routed_nodes->node->net_assigned != 0) |
405 | nodecount++; |
361 | nodecount++; |
406 | 362 | ||
407 | routed_nodes = routed_nodes->next; |
363 | routed_nodes = routed_nodes->next; |
408 | } |
364 | } |
409 | /* turn off warning if low nodecount is due to ensure_reserved processing in |
365 | /* turn off warning if low nodecount is due to ensure_reserved processing in routing.c */ |
410 | * routing.c */ |
- | |
411 | if (nodecount <= limit && !routed_net->nodes_reserved) |
366 | if (nodecount <= limit && !routed_net->nodes_reserved) { |
412 | { |
- | |
413 | Log ( |
- | |
414 | LOG_GENERAL, |
- | |
415 | "-- Net '%s' (name '%s') has only %d node(s) in use\n", |
367 | Log(LOG_GENERAL,"-- Net '%s' (name '%s') has only %d node(s) in use\n", |
416 | routed_net->identifier, |
368 | routed_net->identifier, |
417 | routed_net->name, |
369 | routed_net->name, |
418 | nodecount); |
370 | nodecount); |
419 | lowcount++; |
371 | lowcount++; |
420 | } |
372 | } |
421 | routed_net = routed_net->next; |
373 | routed_net = routed_net->next; |
- | 374 | ||
422 | } |
375 | } |
423 | Log (LOG_GENERAL, "-- Found %d nets with less than %d nodes used\n", lowcount, limit); |
376 | Log(LOG_GENERAL,"-- Found %d nets with less than %d nodes used\n", |
- | 377 | lowcount,limit); |
|
- | 378 | ||
424 | } |
379 | } |
425 | 380 | ||
426 | /* keep some cc's happy */ |
381 | /* keep some cc's happy */ |
427 | void statistics_waste (void) |
382 | void statistics_waste(void) |
428 | { |
383 | { |
429 | char *s = IDstr; |
384 | char * s=IDstr; |
430 | s = s; |
385 | s=s; |
431 | } |
386 | } |
- | 387 |