Subversion Repositories Vertical

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 11
Line 139... Line 139...
139
 *
139
 *
140
 *
140
 *
141
 Removed RCS log information to reduce clutter
141
 Removed RCS log information to reduce clutter
142
*****************************************************************************/
142
*****************************************************************************/
143
 
143
 
144
#include "bundle.h"
144
#include <stdio.h>
145
#include "chck_names.h"
-
 
146
#include "cmdexec.h"
-
 
147
#include "cmdlog.h"
145
#include <stdlib.h>
148
#include "cmdparse.h"
-
 
149
#include "cmdutil.h"
146
#include <string.h>
-
 
147
 
150
#include "database.h"
148
#include "vertcl_main.h"
151
#include "expression.h"
149
#include "expression.h"
152
#include "ext_nets.h"
-
 
153
#include "generic.h"
150
#include "generic.h"
154
#include "jumpering.h"
-
 
155
#include "partition.h"
151
#include "database.h"
156
#include "print_ports.h"
-
 
157
#include "print_quartus.h"
-
 
158
#include "print_ucf.h"
-
 
159
#include "print_vhdl.h"
-
 
160
#include "print_vlog.h"
-
 
161
#include "printout.h"
152
#include "printout.h"
162
#include "rename.h"
-
 
163
#include "routing.h"
153
#include "routing.h"
-
 
154
#include "jumpering.h"
-
 
155
#include "ext_nets.h"
164
#include "statistics.h"
156
#include "statistics.h"
-
 
157
#include "partition.h"
-
 
158
#include "cmdparse.h"
-
 
159
#include "cmdexec.h"
-
 
160
#include "cmdutil.h"
-
 
161
#include "cmdlog.h"
-
 
162
#include "rename.h"
165
#include "template.h"
163
#include "template.h"
-
 
164
#include "chck_names.h"
166
#include "unrouted.h"
165
#include "unrouted.h"
-
 
166
#include "bundle.h"
-
 
167
#include "print_vlog.h"
167
#include "vertcl_main.h"
168
#include "print_vhdl.h"
-
 
169
#include "print_quartus.h"
-
 
170
#include "print_ucf.h"
-
 
171
#include "print_ports.h"
-
 
172
tcl_mode_t  Tcl_Mode;
168
 
173
 
169
#include <stdio.h>
-
 
170
#include <stdlib.h>
174
/* make this a global */  
171
#include <string.h>
175
Tcl_Interp * Tcl_interp;
172
 
176
 
173
 
177
 
174
tcl_mode_t Tcl_Mode;
-
 
175
 
178
 
176
/* make this a global */
-
 
177
Tcl_Interp *Tcl_interp;
-
 
178
 
179
 
179
#ident                                                                                        \
-
 
180
    "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/cmdexec1.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
180
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/vertlib/cmdexec1.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"
181
/* Additional information for the user is provided in this section for inclusion in the
181
/* Additional information for the user is provided in this section for inclusion in the
182
   HTML file
182
   HTML file
183
 
183
 
184
 
184
 
185
 
185
 
Line 194... Line 194...
194
 
194
 
195
/*
195
/*
196
@title
196
@title
197
Vertical External PCB netlist translators
197
Vertical External PCB netlist translators
198
@index external
198
@index external
199
@end
199
@end
200
*/
200
*/
201
 
201
 
-
 
202
 
202
/*
203
/*
203
@title
204
@title
204
Vertical Pin assignment mode commands
205
Vertical Pin assignment mode commands
205
@index vertical_pin
206
@index vertical_pin
206
@end
207
@end
207
*/
208
*/
208
 
209
 
209
/*
210
/*
210
@title
211
@title
211
Vertical PCB merging commands
212
Vertical PCB merging commands
212
@index vertical_pcb
213
@index vertical_pcb
213
@end
214
@end
214
*/
215
*/
Line 216... Line 217...
216
/*
217
/*
217
@title
218
@title
218
Vertical HDL handling commands
219
Vertical HDL handling commands
219
@index vertical_hdl
220
@index vertical_hdl
220
@end
221
@end
221
*/
222
*/
222
 
223
 
223
/*
224
/*
224
@title
225
@title
225
Vertical Regular expressions and commands that use them
226
Vertical Regular expressions and commands that use them
226
@index regular_exp
227
@index regular_exp
227
@end
228
@end
228
*/
229
*/
229
 
230
 
-
 
231
 
-
 
232
 
230
/*
233
/*
231
@title
234
@title
232
Vertical search paths
235
Vertical search paths
233
@application vertical_pin
236
@application vertical_pin
234
@application vertical_pcb
237
@application vertical_pcb
235
@application vertical_hdl
238
@application vertical_hdl
236
@text
239
@text
237
As of version 15.5a, Vertical can now use search paths when opening scripts or database
240
As of version 15.5a, Vertical can now use search paths when opening scripts or database
238
files for reading. All file writes are in the current directory.
241
files for reading. All file writes are in the current directory.
239
@break
242
@break
240
For the PC the search path is :
243
For the PC the search path is :
241
@listing
244
@listing
242
.;c:/cygwin/usr/local/vert_files
245
.;c:/cygwin/usr/local/vert_files
243
@text
246
@text
244
Or in english : look in the current directory '.' and then look in
247
Or in english : look in the current directory '.' and then look in 'c:/cygwin/usr/local/vert_files'.
245
'c:/cygwin/usr/local/vert_files'.
-
 
246
@break
248
@break
247
For PC; filenames containing ':' or starting with either '/' or '.' are not searched down the
249
For PC; filenames containing ':' or starting with either '/' or '.' are not searched down the path,
248
path,
-
 
249
 
250
 
250
@break
251
@break
251
 
252
 
252
The path is in the environment variable called 'VERTICAL_PATH', which can either be
253
The path is in the environment variable called 'VERTICAL_PATH', which can either be
253
set in the shell (MSDOS or cygwin) which invokes vertical, or as a command from within
254
set in the shell (MSDOS or cygwin) which invokes vertical, or as a command from within
254
a Vertical script. e.g.
255
a Vertical script. e.g.
255
@listing
256
@listing
256
setenv VERTICAL_PATH "$(VERTICAL_PATH);/home/project/reference_data"
257
setenv VERTICAL_PATH "$(VERTICAL_PATH);/home/project/reference_data"
257
@text
258
@text
258
This will make Vertical search in the usual places and then in the additional directory.
259
This will make Vertical search in the usual places and then in the additional directory.
259
@break
260
@break
260
For the HPUX port of Vertical the search path is
261
For the HPUX port of Vertical the search path is
261
.;.caddata/vert_files
262
.;.caddata/vert_files
262
@text
263
@text
263
For HPUX; filenames starting in '/' and '.' are not searched for down the path. These two
264
For HPUX; filenames starting in '/' and '.' are not searched for down the path. These two characters are normally used to
264
characters are normally used to specify a definite path, either relative to the current working
-
 
265
directory or absolute relative to the file system root.
265
specify a definite path, either relative to the current working directory or absolute relative to the file system root.
266
@end
266
@end
267
 
267
 
268
 
268
 
269
 
269
 
270
 
270
=======
271
=======
271
   HTML file
272
   HTML file
272
@title
Line 283... Line 283...
283
*/
283
 
284
 
284
/*
285
/*
285
@title
286
@title
286
Vertical Pin assignment mode commands
287
Vertical Pin assignment mode commands
287
@index vertical_pin
288
@index vertical_pin
288
@end
289
@end
289
*/
290
*/
290
 
291
 
291
/*
292
/*
292
@title
293
@title
293
Vertical PCB merging commands
294
Vertical PCB merging commands
294
@index vertical_pcb
295
@index vertical_pcb
295
@end
296
@end
296
*/
Line 298... Line 298...
298
 
298
/*
299
/*
299
@title
300
@title
300
Vertical HDL partitioning commands
301
Vertical HDL partitioning commands
301
@index vertical_hdl
302
@index vertical_hdl
302
@end
303
@end
303
*/
304
*/
304
 
305
 
305
/*
306
/*
306
@title
307
@title
307
Vertical script command notation: Command line and script files
308
Vertical script command notation: Command line and script files
308
@application vertical_pin
309
@application vertical_pin
309
@application vertical_pcb
310
@application vertical_pcb
310
@application vertical_hdl
311
@application vertical_hdl
311
@text
312
@text
312
Vertical uses its own 'shell' like command language. In this language, quoting a string
313
Vertical uses its own 'shell' like command language. In this language, quoting a string
313
simply means that spaces appearing inside strings can be passed into Vertical as a single argument.
314
simply means that spaces appearing inside strings can be passed into Vertical as a single
314
Normally spaces are used to delimit parameters in a command.
315
argument. Normally spaces are used to delimit parameters in a command.
315
@break
316
@break
316
When the command is listed out the following notation is used.
317
When the command is listed out the following notation is used.
317
@text
318
@text
318
If an item is given without angle ( '<' '>' ) brackets then the word is typed as is. e.g.
319
If an item is given without angle ( '<' '>' ) brackets then the word is typed as is. e.g.
319
@listing
320
@listing
320
command
321
command
321
@break
322
@break
322
If '<' '>' angle brackets are given then this an item such as a filename which is user defined. e.g. Command followed
323
If '<' '>' angle brackets are given then this an item such as a filename which is user defined.
-
 
324
e.g. Command followed
323
@listing
325
@listing
324
command <filename>
326
command <filename>
325
@break
327
@break
326
If followed by an asterisk '*' it means in this context that more than one of these items
328
If followed by an asterisk '*' it means in this context that more than one of these items
327
may be entered. It is not the same as a regular expression used within one of these items. e.g. command followed by several items
329
may be entered. It is not the same as a regular expression used within one of these items. e.g.
-
 
330
command followed by several items
328
@listing
331
@listing
329
command <item> *
332
command <item> *
330
@break
333
@break
331
If '[' ']' square brackets are given then the item is optional. e.g. command with an optional parameter
334
If '[' ']' square brackets are given then the item is optional. e.g. command with an optional
-
 
335
parameter
332
@listing
336
@listing
333
command [ <optional> ]
337
command [ <optional> ]
334
@text
338
@text
335
More than one of these may appear at a time on the same item. e.g. Optional list of letters.
339
More than one of these may appear at a time on the same item. e.g. Optional list of letters.
336
@end
Line 342... Line 339...
342
@title
339
Vertical database file notation: Database files
343
Vertical database file notation: Database files
340
@application vertical_pin
344
@application vertical_pin
341
@application vertical_hdl
345
@application vertical_hdl
342
@application vertical_pcb
346
@application vertical_pcb
343
@text
347
@text
344
Vertical handles several different database file formats. These are :
348
Vertical handles several different database file formats. These are :
345
@listing
349
@listing
346
Altera .acf      : tagged as AHDL
350
Altera .acf      : tagged as AHDL
347
Verilog          : tagged as VERILOG
351
Verilog          : tagged as VERILOG
348
VHDL             : tagged as VHDL
352
VHDL             : tagged as VHDL
349
Vertical Native  : initial state and outside other tagged blocks
353
Vertical Native  : initial state and outside other tagged blocks
350
@text
354
@text
351
They are all read in by a single database handler which can switch between different
355
They are all read in by a single database handler which can switch between different
352
languages on the fly.
356
languages on the fly.
353
@break
357
@break
354
In all cases the Vertical parser begins expecting Vertical Native file format, and then
358
In all cases the Vertical parser begins expecting Vertical Native file format, and then
355
it is switched into other modes by the presence of tag  keywords
359
it is switched into other modes by the presence of tag  keywords
356
@break
360
@break
357
These bracket the code. e.g.
361
These bracket the code. e.g.
358
@listing
362
@listing
359
VHDL -- this indicates following syntax.
363
VHDL -- this indicates following syntax.
360
  entity nine is
364
  entity nine is
361
    (
365
    (
362
    );
366
    );
363
  end entity nine;
367
  end entity nine;
364
 
368
 
365
  architecture seven of nine is
369
  architecture seven of nine is
366
-- vertical read_off
370
-- vertical read_off
367
 this code will not be seen by vertical, as it has
371
 this code will not be seen by vertical, as it has
368
 tags in the comments.
372
 tags in the comments.
369
 
373
 
370
 DONT start comments with the word 'VERTICAL' as it is seen an
374
 DONT start comments with the word 'VERTICAL' as it is seen an
371
 an escape into vertical database language.
375
 an escape into vertical database language.
372
-- vertical read_on
Line 377... Line 374...
377
 
374
  begin
378
  begin
375
 
379
 
376
  end;
380
  end;
377
END; -- this belongs to Vertical
381
END; -- this belongs to Vertical
378
@text
382
@text
379
Because Vertical recognises the comments that are found in
383
Because Vertical recognises the comments that are found in
380
all of the HDL's that it understands, it is possible to feed
384
all of the HDL's that it understands, it is possible to feed
381
a native HDL file in with Vertical tags in comments.
385
a native HDL file in with Vertical tags in comments.
382
e.g.
386
e.g.
383
 
387
 
384
 
388
 
385
 
Line 398... Line 395...
398
regular expression: Information on wildcards in Vertical
395
@application vertical_pin
399
@application vertical_pin
396
@application vertical_hdl
400
@application vertical_hdl
397
@application vertical_pcb
401
@application vertical_pcb
398
@text
402
@text
399
The wildcards now used in several commands conform to standard regular expressions.
403
The wildcards now used in several commands conform to standard regular expressions.
400
If no 'special' characters are given then patterns must match exactly, except that
404
If no 'special' characters are given then patterns must match exactly, except that
401
the case of alphabetic characters is ignored.
405
the case of alphabetic characters is ignored.
402
@break
406
@break
403
For instance: to select :
407
For instance: to select :
404
@listing
408
@listing
405
pattern   meaning
409
pattern   meaning
406
-------   -------
410
-------   -------
407
X2[1-7]   'X' or 'x', '2' and then digit '1' to '7'      
411
X2[1-7]   'X' or 'x', '2' and then digit '1' to '7'
408
.*        any char zero or more times (anything)
412
.*        any char zero or more times (anything)
409
X[0-9]+   'X' or 'x', followed by one or more digits
413
X[0-9]+   'X' or 'x', followed by one or more digits
410
 
414
 
411
(expr)    A pattern to be matched that can be used in a string replace.
415
(expr)    A pattern to be matched that can be used in a string replace.
412
          Each bracketed expression can be used in a replacement string
416
          Each bracketed expression can be used in a replacement string
413
          &1 is the first pattern. &0 is the whole of the matched string.
417
          &1 is the first pattern. &0 is the whole of the matched string.
414
 
418
 
415
@text
419
@text
416
On cygwin and Unix 'man regex' will work to tell you more.
420
On cygwin and Unix 'man regex' will work to tell you more.
417
@break
421
@break
418
The edit_pin ident command and edit_pin type
422
The edit_pin ident command and edit_pin type
419
command documentation has more on regular expressions.
423
command documentation has more on regular expressions.
420
 
424
 
421
@break
425
@break
422
Use '\' characters to escape special characters.
426
Use '\' characters to escape special characters.
423
@end
Line 431... Line 428...
431
*/
428
 
432
 
429
/************************************************************************/
433
/************************************************************************/
430
/* Command handling code                                                */
434
/* Command handling code                                                */
431
/************************************************************************/
435
/************************************************************************/
432
 
-
 
433
 
436
 
434
/*********************** Simple command calls ***************************/
437
/*********************** Simple command calls ***************************/
435
/* BYE : Exit program
438
/* BYE : Exit program
436
@title
439
@title
437
bye, quit, exit
440
bye, quit, exit
438
@application vertical_pcb
441
@application vertical_pcb
439
@application vertical_pin
442
@application vertical_pin
440
@application vertical_hdl
443
@application vertical_hdl
441
@text
444
@text
442
Leave program, closing files tidily.
445
Leave program, closing files tidily.
443
@end
446
@end
444
*/
447
*/
445
int BYEHandler (ET_TCLARGS)
448
int BYEHandler (ET_TCLARGS)
446
   {
449
{
447
   CloseLog();                     /* append summary and close the log file */
450
        CloseLog (); /* append summary and close the log file */
448
   Log (LOG_GENERAL, "#Goodbye for now\n");
451
        Log (LOG_GENERAL, "#Goodbye for now\n");
449
   return (QUITCMD);   /* try to leave cleanly */
-
 
450
   }
452
        return (QUITCMD); /* try to leave cleanly */
451
 
453
}
452
 
454
 
453
/****************************************************************************/
455
/****************************************************************************/
454
/* external parser variables                                                */
456
/* external parser variables                                                */
455
extern int yydebug;
457
extern int yydebug;
456
extern FILE * yyin;
458
extern FILE *yyin;
457
extern int lineno;
459
extern int lineno;
458
extern int yy_nArgs;
460
extern int yy_nArgs;
459
extern char ** yy_Args;
461
extern char **yy_Args;
460
 
462
 
461
extern int inside_block;
463
extern int inside_block;
462
 
464
 
463
/* debug level */
465
/* debug level */
464
long level;
Line 476... Line 475...
476
Internal debugging flags. Bit fields can be combined. In general issue debug
475
flag setting commands before issuing commands:
477
flag setting commands before issuing commands:
476
@break
478
@break
477
Followed by the 'read' command:
479
Followed by the 'read' command:
478
@listing
480
@listing
479
For read command:
481
For read command:
480
       
482
       
481
Bit 0    : The yydebug flag (see man yacc/lex for more info)
483
 
482
 
484
Bit 0    : The yydebug flag (see man yacc/lex for more info)
483
For template command
485
 
484
Bit 0    : Prints basic actions
486
For template command
485
Bit 1    : More detailed info
Line 509... Line 508...
509
 
508
Bit 4    : List files that Vertical attempts to open using its search path.
510
For all file opening
509
 
511
Bit 4    : List files that Vertical attempts to open using its search path.
510
@end
512
 
511
*/
513
@end
512
 
514
*/
513
int DEBUGHandler(ET_TCLARGS) {
515
 
514
 
516
int DEBUGHandler (ET_TCLARGS)
515
   if (argc == 1) {
517
{
-
 
518
        if (argc == 1)
516
     level = atoi(argv[0]);
519
        {
517
     set_debug_level(level); /* send info into DLL */
520
                level = atoi (argv[0]);
518
     yydebug = level&1 ;
521
                set_debug_level (level); /* send info into DLL */
519
     Log (LOG_GENERAL, "# setting debug level to %d\n",level);
522
                yydebug = level & 1;
520
     return (TCL_OK);
523
                Log (LOG_GENERAL, "# setting debug level to %d\n", level);
521
     }
524
                return (TCL_OK);
522
   else
525
        }
523
     return (TCL_ERROR);
526
        else
524
 
-
 
525
   }
527
                return (TCL_ERROR);
526
 
528
}
527
/******************** Read a data file ***********************/
529
 
528
/*
530
/******************** Read a data file ***********************/
529
@title
531
/*
530
read <filename> [<identifier_suffix> | "" ] [ <arg>* ]
Line 552... Line 551...
552
identifiers U1 to U 20 and you decide to suffix a new ACF file
551
the old file and will 'vanish' or be confused with U10 in the
553
being read with "0" then U1 in the new file will match U10 in
552
old file. The best way to avoid this problem is to
554
the old file and will 'vanish' or be confused with U10 in the
553
It is normal to use an underscore character as in "_" to
555
old file. The best way to avoid this problem is to
554
prefix the suffix to avoid this.
556
It is normal to use an underscore character as in "_" to
555
@break
557
prefix the suffix to avoid this.
556
In addition any arguments after the suffix field (which can be omitted if a "" null string is
558
@break
557
given) can be used as macro variables $0, $1 and so on inside the database file.
559
In addition any arguments after the suffix field (which can be omitted if a "" null string is
558
e.g.
560
given) can be used as macro variables $0, $1 and so on inside the database file.
559
@listing
561
e.g.
560
read conn.txt ""  x1_a x1_b
562
@listing
561
@text
563
read conn.txt ""  x1_a x1_b
562
Will, if the file conn.txt contains the following
564
@text
563
@listing
565
Will, if the file conn.txt contains the following
564
JOINED_NETS
566
@listing
565
BEGIN
567
JOINED_NETS
566
 
568
BEGIN
567
 
569
 
568
 JUMPER J_$0$1_3A  = ($0(3A );$1(16A); );
570
 
569
 JUMPER J_$0$1_4A  = ($0(4A );$1(15A); );
571
 
570
 JUMPER J_$0$1_5A  = ($0(5A );$1(14A); );
572
 
571
 JUMPER J_$0$1_6A  = ($0(6A );$1(13A); );
573
 JUMPER J_$0$1_3A  = ($0(3A );$1(16A); );
572
 
574
 JUMPER J_$0$1_4A  = ($0(4A );$1(15A); );
573
END;
575
 JUMPER J_$0$1_5A  = ($0(5A );$1(14A); );
574
@text
576
 JUMPER J_$0$1_6A  = ($0(6A );$1(13A); );
575
Be translated into
577
 
576
@listing
578
END;
577
JOINED_NETS
579
@text
578
BEGIN
580
Be translated into
579
 
581
@listing
580
 
582
JOINED_NETS
581
 JUMPER J_x1_ax1_b_3A  = (x1_a(3A );x2_a(16A); );
583
BEGIN
582
 JUMPER J_x1_ax1_b_4A  = (x1_a(4A );x2_a(15A); );
584
 
583
 JUMPER J_x1_ax1_b_5A  = (x1_a(5A );x2_a(14A); );
585
 
584
 JUMPER J_x1_ax1_b_6A  = (x1_a(6A );x2_a(13A); );
586
 
585
 
Line 589... Line 588...
589
 JUMPER J_x1_ax1_b_4A  = (x1_a(4A );x2_a(15A); );
588
If no arguments are given, then the argument list of the currently
590
 JUMPER J_x1_ax1_b_5A  = (x1_a(5A );x2_a(14A); );
589
executing script are used as $0, $1 and so on.
591
 JUMPER J_x1_ax1_b_6A  = (x1_a(6A );x2_a(13A); );
590
 
592
 
591
@end
593
END;
592
*/
594
@text
593
extern void tidy_lex(void);
595
If no arguments are given, then the argument list of the currently
594
 
596
executing script are used as $0, $1 and so on.
595
extern int yyparse(void);
597
 
596
 
598
@end
597
int READHandler (ET_TCLARGS)
599
*/
598
   {
600
extern void tidy_lex (void);
599
   int rc =0;
601
 
600
   int     old_yy_nArgs;
602
extern int yyparse (void);
601
   char ** old_yy_Args;
603
 
602
 
604
int READHandler (ET_TCLARGS)
603
#if defined DIAGNOSE
605
{
604
   {
606
        int rc = 0;
605
   int i;
607
        int old_yy_nArgs;
606
   printf("local args\n");
608
        char **old_yy_Args;
607
 
609
 
608
   for(i=0;i<argc;i++)
610
#if defined DIAGNOSE
-
 
611
        {
-
 
612
                int i;
-
 
613
                printf ("local args\n");
609
     printf("[%d]=%s\n",i,argv[i]?(argv[i][0]?argv[i]:"\"\""):"<null>");
614
 
610
   printf("global args\n");
615
                for (i = 0; i < argc; i++)
611
 
616
                        printf (
612
   for(i=0;i<yy_nArgs;i++)
617
                            "[%d]=%s\n",
-
 
618
                            i,
-
 
619
                            argv[i] ? (argv[i][0] ? argv[i] : "\"\"") : "<null>");
-
 
620
                printf ("global args\n");
613
     printf("[%d]=%s\n",i,yy_Args[i]?(yy_Args[i][0]?yy_Args[i]:"\"\""):"<null>");
-
 
614
 
621
 
615
   }
622
                for (i = 0; i < yy_nArgs; i++)
616
#endif
623
                        printf (
617
   if (argc < 1)
624
                            "[%d]=%s\n",
618
     return(TCL_ERROR);
625
                            i,
619
 
626
                            yy_Args[i] ? (yy_Args[i][0] ? yy_Args[i] : "\"\"") : "<null>");
620
   Log(LOG_GENERAL, "# reading information from <%s>\n", argv[0]);
627
        }
621
   mark_board_objects(); /* record some pointers - last object before rename */
628
#endif
622
   inside_block  = 0;
629
        if (argc < 1)
623
 
630
                return (TCL_ERROR);
624
   tidy_lex();
631
 
625
 
632
        Log (LOG_GENERAL, "# reading information from <%s>\n", argv[0]);
626
   yyin = trap_fopen(argv[0], "r");             /* open text file for reading */
633
        mark_board_objects (); /* record some pointers - last object before rename */
627
   if (!yyin)
634
        inside_block = 0;
628
      {
635
 
629
      Log(LOG_ERROR, "# Error opening file: <%s>\n", argv[0]);
636
        tidy_lex ();
630
      return(TCL_ERROR);
-
 
631
      }
-
 
632
   else
-
 
633
      {
-
 
634
      /* setup the argument lists for expansion :
-
 
635
         either inherit from calling script (no args) or
-
 
636
         copy from rest of command line. No need to make duplicates of
-
 
637
         values as they cannot be changed within a 'read' operation
-
 
638
         unlike 'do' which may call other command files with different arg.
-
 
639
         lists.
-
 
640
       */
-
 
641
      old_yy_nArgs = yy_nArgs;
-
 
642
      old_yy_Args  = yy_Args;
-
 
643
      if(argc>=3) {
-
 
644
        yy_Args = argv+2;
-
 
645
        yy_nArgs= argc-2;
637
 
646
        }
638
        yyin = trap_fopen (argv[0], "r"); /* open text file for reading */
-
 
639
        if (!yyin)
-
 
640
        {
-
 
641
                Log (LOG_ERROR, "# Error opening file: <%s>\n", argv[0]);
-
 
642
                return (TCL_ERROR);
-
 
643
        }
-
 
644
        else
-
 
645
        {
-
 
646
                /* setup the argument lists for expansion :
-
 
647
                   either inherit from calling script (no args) or
-
 
648
                   copy from rest of command line. No need to make duplicates of
-
 
649
                   values as they cannot be changed within a 'read' operation
-
 
650
                   unlike 'do' which may call other command files with different arg.
-
 
651
                   lists.
-
 
652
                 */
-
 
653
                old_yy_nArgs = yy_nArgs;
-
 
654
                old_yy_Args = yy_Args;
647
 
655
                if (argc >= 3)
648
#if defined DIAGNOSE
656
                {
649
 
657
                        yy_Args = argv + 2;
650
   {
658
                        yy_nArgs = argc - 2;
651
   int i;
659
                }
652
   printf("new global args\n");
660
 
653
 
661
#if defined DIAGNOSE
654
   for(i=0;i<yy_nArgs;i++)
662
 
-
 
663
                {
-
 
664
                        int i;
-
 
665
                        printf ("new global args\n");
655
     printf("[%d]=%s\n",i,yy_Args[i]?(yy_Args[i][0]?yy_Args[i]:"\"\""):"<null>");
666
 
-
 
-
 
656
 
667
                        for (i = 0; i < yy_nArgs; i++)
657
   }
668
                                printf (
658
#endif
669
                                    "[%d]=%s\n",
659
 
670
                                    i,
660
      lineno = 1;
671
                                    yy_Args[i] ? (yy_Args[i][0] ? yy_Args[i] : "\"\"")
661
      while(!feof(yyin) && !rc) {
672
                                               : "<null>");
662
        if(yydebug)
673
                }
-
 
674
#endif
663
          Log(LOG_GENERAL,"Processing line %d\n",lineno);
675
 
664
        rc = yyparse();
-
 
665
 
676
                lineno = 1;
666
        }
677
                while (!feof (yyin) && !rc)
667
#if defined DIAGNOSE
678
                {
668
   {
679
                        if (yydebug)
669
   int i;
680
                                Log (LOG_GENERAL, "Processing line %d\n", lineno);
670
   printf("new2 global args\n");
681
                        rc = yyparse ();
671
 
682
                }
672
   for(i=0;i<yy_nArgs;i++)
683
#if defined DIAGNOSE
-
 
684
                {
-
 
685
                        int i;
-
 
686
                        printf ("new2 global args\n");
673
     printf("[%d]=%s\n",i,yy_Args[i]?(yy_Args[i][0]?yy_Args[i]:"\"\""):"<null>");
687
 
-
 
-
 
674
 
688
                        for (i = 0; i < yy_nArgs; i++)
675
   }
689
                                printf (
676
#endif
690
                                    "[%d]=%s\n",
677
      fclose (yyin);
691
                                    i,
678
      yy_nArgs = old_yy_nArgs;
692
                                    yy_Args[i] ? (yy_Args[i][0] ? yy_Args[i] : "\"\"")
679
      yy_Args  = old_yy_Args;
-
 
680
 
-
 
681
 
693
                                               : "<null>");
682
 
694
                }
683
/* added the concatenation of suffixes
695
#endif
684
 * to the Names and Identifiers of objects *
696
                fclose (yyin);
685
 * if there was a suffix and it is not null apply it */
697
                yy_nArgs = old_yy_nArgs;
686
      if (argc>=2 && !ISNULLSTR(argv[1])) {
698
                yy_Args = old_yy_Args;
-
 
699
 
687
        set_board_suffix(argv[1]);
700
                /* added the concatenation of suffixes
688
        Log(LOG_GENERAL, "# Object name/identifier suffix = '%s'\n", argv[1]);
701
                 * to the Names and Identifiers of objects *
689
        }      
702
                 * if there was a suffix and it is not null apply it */
690
      need_validate_names=1;/* tell validate_names there is some work to do */
703
                if (argc >= 2 && !ISNULLSTR (argv[1]))
691
 
704
                {
692
      if(rc == 0)
705
                        set_board_suffix (argv[1]);
693
        return (TCL_OK);
706
                        Log (LOG_GENERAL, "# Object name/identifier suffix = '%s'\n", argv[1]);
694
      else
707
                }
695
        return(TCL_ERROR);
708
                need_validate_names = 1; /* tell validate_names there is some work to do */
696
      }
709
 
697
   }
710
                if (rc == 0)
698
 
711
                        return (TCL_OK);
699
/******************** Output an ACF file all pins connected to nets  ***********************/
712
                else
700
/*
713
                        return (TCL_ERROR);
701
@title
714
        }
702
write connected <filename>
Line 721... Line 709...
721
@application vertical_pcb
709
contains something important) then their entire pinout (without pin reservations) will be
722
@application vertical_pin
710
written as part of the netlist. All connections made to external sockets will be listed.
723
@text
711
@end
724
Write out an 'Extended ACF' file for the entire netlist and
712
*/
725
device and net assignments. If there are any sockets with
713
int WriteConnectedHandler (ET_TCLARGS)
726
names assigned to the socket identifier (implying the socket
714
   {
727
contains something important) then their entire pinout (without pin reservations) will be
715
   FILE * ACFfile;
728
written as part of the netlist. All connections made to external sockets will be listed.
716
 
729
@end
717
   if (argc < 1)
730
*/
718
     return(TCL_ERROR);  
731
int WriteConnectedHandler (ET_TCLARGS)
719
   Log(LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
732
{
720
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for reading */
733
        FILE *ACFfile;
721
   if (!ACFfile) {
734
 
-
 
735
        if (argc < 1)
722
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
736
                return (TCL_ERROR);
723
     return(TCL_ERROR);
737
        Log (LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
724
     }
738
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
739
        if (!ACFfile)
725
   else {
740
        {
726
     create_unrouted_list();
741
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
727
     print_header(ACFfile,TOOL_NAME": WRITE CONNECTED");
742
                return (TCL_ERROR);
728
     list_database(ACFfile,PRESERVE_JUMPERS);
743
        }
729
     list_jumper(ACFfile);
744
        else
730
     list_generic_values(ACFfile,&global_generics,0);
745
        {
731
 
746
                create_unrouted_list ();
-
 
747
                print_header (ACFfile, TOOL_NAME ": WRITE CONNECTED");
732
     list_devices(ACFfile,
748
                list_database (ACFfile, PRESERVE_JUMPERS);
733
         PRINT_TYPE|PRINT_EXPAND_BUS| PRINT_NET_NAMES|
-
 
734
         PRINT_GENERIC|PRINT_GROUP|
749
                list_jumper (ACFfile);
735
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
750
                list_generic_values (ACFfile, &global_generics, 0);
736
     list_alias(ACFfile);
751
 
737
     print_pin_renames(ACFfile);
752
                list_devices (
738
     fclose(ACFfile);
753
                    ACFfile,
739
     return (TCL_OK);
754
                    PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_NET_NAMES | PRINT_GENERIC |
740
     }
755
                        PRINT_GROUP | PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
741
   }
756
                list_alias (ACFfile);
742
 
757
                print_pin_renames (ACFfile);
743
/******************** Output an ACF file ***********************/
758
                fclose (ACFfile);
744
/*
759
                return (TCL_OK);
745
@title
760
        }
746
write acf <filename>
Line 768... Line 754...
768
@application vertical_pin
754
written as part of the netlist. Connections to sockets without
769
@text
755
names assigned are still written out.
770
Write out an 'Extended ACF' file for the entire netlist and
756
@end
771
device and net assignments. If there are any sockets with
757
*/
772
names assigned to the socket identifier (implying the socket
758
int WriteAcfHandler (ET_TCLARGS)
773
contains something important) then their pinout will be
759
   {
774
written as part of the netlist. Connections to sockets without
760
   FILE * ACFfile;
775
names assigned are still written out.
761
 
776
@end
762
   if (argc < 1)
777
*/
763
     return(TCL_ERROR);  
778
int WriteAcfHandler (ET_TCLARGS)
764
   Log(LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
779
{
765
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for reading */
780
        FILE *ACFfile;
766
   if (!ACFfile) {
781
 
-
 
782
        if (argc < 1)
767
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
783
                return (TCL_ERROR);
768
     return(TCL_ERROR);
784
        Log (LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
769
     }
785
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
786
        if (!ACFfile)
770
   else {
787
        {
771
     create_unrouted_list();
788
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
772
     print_header(ACFfile,TOOL_NAME": WRITE ACF");
789
                return (TCL_ERROR);
773
     list_database(ACFfile,PRESERVE_JUMPERS);
790
        }
774
     list_jumper(ACFfile);
791
        else
775
     list_generic_values(ACFfile,&global_generics,0);
792
        {
776
 
793
                create_unrouted_list ();
777
     list_devices(ACFfile,
794
                print_header (ACFfile, TOOL_NAME ": WRITE ACF");
778
         PRINT_TYPE|PRINT_EXPAND_BUS|
795
                list_database (ACFfile, PRESERVE_JUMPERS);
779
         PRINT_GENERIC|PRINT_GROUP|
796
                list_jumper (ACFfile);
780
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
797
                list_generic_values (ACFfile, &global_generics, 0);
781
     list_alias(ACFfile);
798
 
782
     print_pin_renames(ACFfile);
799
                list_devices (
783
     fclose(ACFfile);
800
                    ACFfile,
784
     return (TCL_OK);
801
                    PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP |
785
     }
802
                        PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
786
   }
803
                list_alias (ACFfile);
787
/******************** Output an ACF, just net part file ***********************/
804
                print_pin_renames (ACFfile);
788
/*
805
                fclose (ACFfile);
789
@title
806
                return (TCL_OK);
790
write net <filename>
807
        }
791
@application vertical_pcb
808
}
792
@application vertical_pin
809
/******************** Output an ACF, just net part file ***********************/
793
@text
810
/*
794
Write out an 'Extended ACF' file for the entire netlist. In this case no socket
811
@title
795
information is printed.
812
write net <filename>
796
@end
813
@application vertical_pcb
797
*/
814
@application vertical_pin
798
 
815
@text
799
int WriteNetHandler (ET_TCLARGS)
816
Write out an 'Extended ACF' file for the entire netlist. In this case no socket
800
   {
817
information is printed.
801
   FILE * ACFfile;
818
@end
802
 
819
*/
803
   if (argc < 1)
820
 
804
     return(TCL_ERROR);
821
int WriteNetHandler (ET_TCLARGS)
805
 
822
{
806
   Log(LOG_GENERAL, "# producing an ACF (net only) file <%s>\n", argv[0]);
823
        FILE *ACFfile;
807
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for reading */
824
 
808
   if (!ACFfile) {
825
        if (argc < 1)
-
 
826
                return (TCL_ERROR);
809
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
827
 
810
     return(TCL_ERROR);
828
        Log (LOG_GENERAL, "# producing an ACF (net only) file <%s>\n", argv[0]);
811
     }
829
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
830
        if (!ACFfile)
812
   else {
831
        {
813
     create_unrouted_list();
832
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
814
     print_header(ACFfile,TOOL_NAME": WRITE NET");
833
                return (TCL_ERROR);
815
     list_database(ACFfile,PRESERVE_JUMPERS);
834
        }
816
     list_jumper(ACFfile);
835
        else
817
     list_devices(ACFfile,
836
        {
818
         PRINT_TYPE |
837
                create_unrouted_list ();
819
         PRINT_GENERIC|PRINT_GROUP|
838
                print_header (ACFfile, TOOL_NAME ": WRITE NET");
820
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS|
-
 
821
         NO_PRINT_PINS);
839
                list_database (ACFfile, PRESERVE_JUMPERS);
822
     fclose(ACFfile);
840
                list_jumper (ACFfile);
823
     return (TCL_OK);
841
                list_devices (
824
     }
842
                    ACFfile,
825
   }
843
                    PRINT_TYPE | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
826
/******************** Write Flatten command ***********************/
844
                        PRINT_EQUIVALENT_PINS | NO_PRINT_PINS);
827
/*
845
                fclose (ACFfile);
828
@title
846
                return (TCL_OK);
829
write flatten <filename>
847
        }
830
@application vertical_pcb
Line 850... Line 833...
850
/*
833
Write out an 'Extended ACF' file for the entire netlist and
851
@title
834
device and net assignments. If there are any sockets with
852
write flatten <filename>
835
names assigned to the socket identifier (implying the socket
853
@application vertical_pcb
836
contains something important) then their pinout will be
854
@application vertical_hdl
837
written as part of the netlist. Connections to sockets without
855
@text
838
names assigned are still written out.
856
Write out an 'Extended ACF' file for the entire netlist and
839
@break
857
device and net assignments. If there are any sockets with
840
In addition, all jumpers are flattened, and the joined together
858
names assigned to the socket identifier (implying the socket
841
nets created by jumpers are written out as a single wire. This is used with the
859
contains something important) then their pinout will be
842
equivalent pin connections on socket templates.
860
written as part of the netlist. Connections to sockets without
843
@end
861
names assigned are still written out.
844
*/
862
@break
845
int WriteFlattenHandler (ET_TCLARGS)
863
In addition, all jumpers are flattened, and the joined together
846
   {
864
nets created by jumpers are written out as a single wire. This is used with the
847
   FILE * ACFfile;
865
equivalent pin connections on socket templates.
848
 
866
@end
849
   if (argc < 1)
867
*/
850
     return(TCL_ERROR);
868
int WriteFlattenHandler (ET_TCLARGS)
851
 
869
{
852
   Log(LOG_GENERAL, "# producing a flattened ACF file <%s>\n", argv[0]);
870
        FILE *ACFfile;
853
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for reading */
871
 
854
   if (!ACFfile) {
872
        if (argc < 1)
-
 
873
                return (TCL_ERROR);
855
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
874
 
856
     return(TCL_ERROR);
875
        Log (LOG_GENERAL, "# producing a flattened ACF file <%s>\n", argv[0]);
857
     }
876
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
877
        if (!ACFfile)
858
   else {
878
        {
859
     create_unrouted_list();
879
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
860
     print_header(ACFfile,TOOL_NAME": WRITE FLATTEN");
880
                return (TCL_ERROR);
861
     list_database(ACFfile,FLATTEN_JUMPERS);
881
        }
862
     fclose(ACFfile);
882
        else
863
     return (TCL_OK);
883
        {
864
     }
884
                create_unrouted_list ();
865
   }
885
                print_header (ACFfile, TOOL_NAME ": WRITE FLATTEN");
866
/******************** Output an FRB file ***********************/
886
                list_database (ACFfile, FLATTEN_JUMPERS);
867
/*
887
                fclose (ACFfile);
868
@title
888
                return (TCL_OK);
869
write pcb <filename>
889
        }
870
@application vertical_pcb
Line 895... Line 876...
895
@application vertical_pcb
876
the unique and 'useful' way this has been setup at
896
@text
877
Southampton.
897
Write out a "neutral architecture file" PCB netlist file for
878
@end
898
CadStar. This is hard to use properly, as Southampton Cadstar
879
*/
899
users always seem to be coming up with different netlist
880
int WriteFrbHandler (ET_TCLARGS)
900
formats, and there are problems with library portability and
881
   {
901
the unique and 'useful' way this has been setup at
882
   FILE * FRBfile;
902
Southampton.
883
   if (argc < 1)
903
@end
884
     return(TCL_ERROR);
904
*/
885
 
905
int WriteFrbHandler (ET_TCLARGS)
886
   Log(LOG_GENERAL, "# producing an FRB file <%s>\n", argv[0]);
906
{
887
   FRBfile = trap_fopen(argv[0], "w");             /* open text file for reading */
907
        FILE *FRBfile;
888
   if (!FRBfile) {
908
        if (argc < 1)
-
 
909
                return (TCL_ERROR);
889
     Log(LOG_ERROR, "# Error opening FRB output file: <%s>\n",argv[0]);
910
 
890
     return(TCL_ERROR);
911
        Log (LOG_GENERAL, "# producing an FRB file <%s>\n", argv[0]);
891
     }
912
        FRBfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
913
        if (!FRBfile)
892
   else {
914
        {
893
     create_unrouted_list();
915
                Log (LOG_ERROR, "# Error opening FRB output file: <%s>\n", argv[0]);
894
     produce_frb(FRBfile);
916
                return (TCL_ERROR);
895
     fclose(FRBfile);
917
        }
896
     return (TCL_OK);
918
        else
897
     }
919
        {
898
   }
920
                create_unrouted_list ();
899
/******************** Output a list of templates to a file ***********************/
921
                produce_frb (FRBfile);
900
/*
922
                fclose (FRBfile);
901
@title
923
                return (TCL_OK);
902
write template <filename>
924
        }
903
@application vertical_pin
925
}
904
@application vertical_hdl
926
/******************** Output a list of templates to a file ***********************/
905
@text
Line 929... Line 908...
929
write template <filename>
908
which can be used to create a library of templates.
930
@application vertical_pin
909
@end
931
@application vertical_hdl
910
*/
932
@text
911
 
933
List out all of the socket templates (alternatively these are VHDL component declarations)
912
int WriteTemplateHandler (ET_TCLARGS)
934
loaded into the VERTICAL database into a file,
913
   {
935
which can be used to create a library of templates.
914
   FILE * Templatefile;
936
@end
915
 
937
*/
916
   if (argc < 1)
938
 
-
 
939
int WriteTemplateHandler (ET_TCLARGS)
-
 
940
{
-
 
941
        FILE *Templatefile;
-
 
942
 
-
 
943
        if (argc < 1)
-
 
944
                return (TCL_ERROR);
-
 
945
 
-
 
946
        Log (LOG_GENERAL, "# producing an Template file <%s>\n", argv[0]);
-
 
947
        Templatefile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
948
        if (!Templatefile)
-
 
949
        {
-
 
950
                Log (LOG_ERROR, "# Error opening Template output file: <%s>\n", argv[0]);
-
 
951
                return (TCL_ERROR);
-
 
952
        }
917
     return(TCL_ERROR);
953
        else
-
 
954
        {
918
 
-
 
919
   Log(LOG_GENERAL, "# producing an Template file <%s>\n", argv[0]);
-
 
920
   Templatefile = trap_fopen(argv[0], "w");             /* open text file for reading */
-
 
921
   if (!Templatefile) {
-
 
922
     Log(LOG_ERROR, "# Error opening Template output file: <%s>\n",argv[0]);
-
 
923
     return(TCL_ERROR);
-
 
924
     }
-
 
925
   else {
-
 
926
     template_list_pins(Templatefile);
-
 
927
     fclose(Templatefile);
-
 
928
     }
-
 
929
   return(TCL_OK);
-
 
930
   }
-
 
931
   
955
                template_list_pins (Templatefile);
932
/************ Output a device by Name to file - expanding VHDL busses ********/
956
                fclose (Templatefile);
933
/*
957
        }
934
@title
958
        return (TCL_OK);
935
write fit <device> <filename>
959
}
936
@application vertical_pcb
960
 
937
@application vertical_pin
961
/************ Output a device by Name to file - expanding VHDL busses ********/
938
@application vertical_hdl
962
/*
939
@text
963
@title
940
Write out a device socket, and expand out busses, using the VHDL declarations
964
write fit <device> <filename>
941
of the signals connected to produce the required number of pins. These databases
965
@application vertical_pcb
942
created can be used in the creation of an initial pin fit without the use of
966
@application vertical_pin
943
an FPGA fitter.
967
@application vertical_hdl
944
@break
968
@text
945
Partitioning use : If the 'chip' appears to have VHDL busses
969
Write out a device socket, and expand out busses, using the VHDL declarations
946
rather than individual wires on some of its 'pins' then these
970
of the signals connected to produce the required number of pins. These databases
947
busses will be expanded into unique signal names. This process
Line 977... Line 954...
977
is performed at the time of printout. A bus declared as
954
  fred_2 : INPUT_PIN :=  1_3 "STD_LOGIC"
978
@listing
955
  fred_3 : INPUT_PIN :=  1_4 "STD_LOGIC"
979
  fred : in STD_LOGIC (3 DOWNTO 0)
956
@end
980
in the input acfp file will be printed out as
957
*/
981
  fred_0 : INPUT_PIN :=  1_1 "STD_LOGIC"
958
int WriteFitHandler (ET_TCLARGS)
982
  fred_1 : INPUT_PIN :=  1_2 "STD_LOGIC"
959
   {
983
  fred_2 : INPUT_PIN :=  1_3 "STD_LOGIC"
960
   FILE * ACFfile;
984
  fred_3 : INPUT_PIN :=  1_4 "STD_LOGIC"
961
   socket_t * skt;
985
@end
962
 
986
*/
963
   if (argc < 2)
987
int WriteFitHandler (ET_TCLARGS)
964
     return(TCL_ERROR);
988
{
965
 
989
        FILE *ACFfile;
966
   skt = find_socket(Name,argv[0],Search,&socket_head);
990
        socket_t *skt;
967
 
991
 
968
   if(!skt) {
992
        if (argc < 2)
-
 
993
                return (TCL_ERROR);
969
     Log(LOG_GENERAL,"# Cannot find socket name '%s'\n",argv[0]);
994
 
970
     return(TCL_ERROR);
995
        skt = find_socket (Name, argv[0], Search, &socket_head);
971
     };
996
 
972
   Log(LOG_GENERAL, "# producing ACF for socket name '%s' in <%s>\n",
-
 
973
        argv[0],argv[1]);
997
        if (!skt)
974
   ACFfile = trap_fopen(argv[1], "w");    /* open text file for writing */
998
        {
975
   if (!ACFfile) {
999
                Log (LOG_GENERAL, "# Cannot find socket name '%s'\n", argv[0]);
-
 
1000
                return (TCL_ERROR);
976
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
1001
        };
977
     return(TCL_ERROR);
1002
        Log (LOG_GENERAL, "# producing ACF for socket name '%s' in <%s>\n", argv[0], argv[1]);
978
     }
1003
        ACFfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1004
        if (!ACFfile)
979
  else {
1005
        {
980
       create_unrouted_list();
1006
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
981
       print_header(ACFfile,TOOL_NAME": WRITE FIT");
1007
                return (TCL_ERROR);
982
       print_device(ACFfile,skt, PRINT_EXPAND_BUS ); /* include pins not connected to nets */
1008
        }
-
 
1009
        else
983
       fclose(ACFfile);
1010
        {
984
       return (TCL_OK);
1011
                create_unrouted_list ();
985
       }
1012
                print_header (ACFfile, TOOL_NAME ": WRITE FIT");
986
    }
1013
                print_device (ACFfile, skt, PRINT_EXPAND_BUS); /* include pins not connected to
987
 
1014
                                                                  nets */
988
/******************** Output a device by ID to file ***********************/
1015
                fclose (ACFfile);
989
/*
1016
                return (TCL_OK);
990
@title
1017
        }
991
write identifier <chip_ident> <filename>
Line 1031... Line 1005...
1031
are given so that the user can detertmine which socket pins
1005
It is also used to help with the creation of pin definition
1032
are usable for making connections to the socket. That is all
1006
files for external connectors.
1033
of those that are not VCC or Ground for example.
1007
@end
1034
@break
1008
*/
1035
This format is exactly compatible with maxplus2 so it is used
1009
int WriteIdHandler (ET_TCLARGS)
1036
to produce the new pin assignment files for maxplus2
1010
   {
1037
It is also used to help with the creation of pin definition
1011
   FILE * ACFfile;
1038
files for external connectors.
1012
   socket_t * skt;
1039
@end
1013
 
1040
*/
1014
   if (argc < 2)
1041
int WriteIdHandler (ET_TCLARGS)
1015
     return(TCL_ERROR);
1042
{
1016
   skt = find_socket(Ident,argv[0],Search,&socket_head);
1043
        FILE *ACFfile;
1017
 
1044
        socket_t *skt;
1018
   if(!skt) {
1045
 
-
 
1046
        if (argc < 2)
1019
     Log(LOG_GENERAL,"# Cannot find socket id '%s'\n",argv[0]);
1047
                return (TCL_ERROR);
1020
     return(TCL_ERROR);
1048
        skt = find_socket (Ident, argv[0], Search, &socket_head);
1021
     };
1049
 
1022
   Log(LOG_GENERAL, "# producing ACF for socket id '%s' in <%s>\n",
-
 
1023
        argv[0],argv[1]);
1050
        if (!skt)
1024
   ACFfile = trap_fopen(argv[1], "w");     /* open text file for writing */
1051
        {
1025
   if (!ACFfile) {
1052
                Log (LOG_GENERAL, "# Cannot find socket id '%s'\n", argv[0]);
-
 
1053
                return (TCL_ERROR);
1026
       Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
1054
        };
1027
       return(TCL_ERROR);
1055
        Log (LOG_GENERAL, "# producing ACF for socket id '%s' in <%s>\n", argv[0], argv[1]);
1028
       }
1056
        ACFfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1057
        if (!ACFfile)
1029
   else {
1058
        {
1030
       create_unrouted_list();
1059
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
1031
       print_header(ACFfile,TOOL_NAME": WRITE ID");
1060
                return (TCL_ERROR);
1032
       print_device(ACFfile,skt,PRINT_ALL | PRINT_USABLE ); /* include pins not connected to nets */
1061
        }
-
 
1062
        else
1033
       fclose(ACFfile);
1063
        {
1034
       }
1064
                create_unrouted_list ();
1035
    return (TCL_OK);
1065
                print_header (ACFfile, TOOL_NAME ": WRITE ID");
1036
    }
1066
                print_device (ACFfile, skt, PRINT_ALL | PRINT_USABLE); /* include pins not
1037
 
1067
                                                                          connected to nets */
1038
/******************** Output a device by name to file ***********************/
1068
                fclose (ACFfile);
1039
/*
1069
        }
1040
@title
1070
        return (TCL_OK);
1041
write name <chip_name> <filename>
Line 1078... Line 1049...
1078
@application vertical_pin
1049
induvidual sockets from the netlist into separate files.
1079
@application vertical_hdl
1050
@text
1080
@text
1051
@end
1081
Write out device info for the named device/socket  (with only
1052
*/
1082
pins that are used by routed nets). Tis is used for user
1053
int WriteNameHandler (ET_TCLARGS)
1083
documentation purposes and diagnostics, in separating out
1054
   {
1084
induvidual sockets from the netlist into separate files.
1055
   FILE * ACFfile;
1085
@text
1056
   socket_t * skt;
1086
@end
1057
   if (argc<2)
1087
*/
1058
       return(TCL_ERROR);
1088
int WriteNameHandler (ET_TCLARGS)
1059
 
1089
{
1060
   skt = find_socket(Name,argv[0],Search,&socket_head);
1090
        FILE *ACFfile;
1061
 
1091
        socket_t *skt;
1062
   if(!skt) {
1092
        if (argc < 2)
-
 
1093
                return (TCL_ERROR);
1063
     Log(LOG_GENERAL,"# Cannot find socket name '%s'\n",argv[0]);
1094
 
1064
     return(TCL_ERROR);
1095
        skt = find_socket (Name, argv[0], Search, &socket_head);
1065
     };
1096
 
1066
   Log(LOG_GENERAL, "# producing ACF for socket name '%s' in <%s>\n",
-
 
1067
        argv[0],argv[1]);
1097
        if (!skt)
1068
   ACFfile = trap_fopen(argv[1], "w");    /* open text file for writing */
1098
        {
1069
   if (!ACFfile) {
1099
                Log (LOG_GENERAL, "# Cannot find socket name '%s'\n", argv[0]);
-
 
1100
                return (TCL_ERROR);
1070
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
1101
        };
1071
     return(TCL_ERROR);
1102
        Log (LOG_GENERAL, "# producing ACF for socket name '%s' in <%s>\n", argv[0], argv[1]);
1072
     }
1103
        ACFfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1104
        if (!ACFfile)
1073
   else {
1105
        {
1074
     create_unrouted_list();
1106
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[1]);
1075
     print_header(ACFfile,TOOL_NAME" : WRITE NAME");
1107
                return (TCL_ERROR);
1076
     print_device(ACFfile,skt,0); /* used pins only */
1108
        }
1077
     fclose(ACFfile);
1109
        else
1078
     return (TCL_OK);
1110
        {
1079
    } ;
1111
                create_unrouted_list ();
1080
  }
1112
                print_header (ACFfile, TOOL_NAME " : WRITE NAME");
1081
/******************** Output a partition name to file ***********************/
1113
                print_device (ACFfile, skt, 0); /* used pins only */
1082
/*
1114
                fclose (ACFfile);
1083
@title
1115
                return (TCL_OK);
1084
write VHDl <new_entityname> <filename> [ <template_file> ]
1116
        };
1085
@text
Line 1147... Line 1116...
1147
use ieee.std_logic_1164.all;
1116
You will be warned if the template contains other than exactly
1148
use proj_std.dodgy_conversions.all;
1117
one $ENT$ and $ARCH$ string.
1149
 
1118
@end
1150
-- now an architecture --
1119
*/
1151
$ARCH$
1120
int WriteVHDLHandler (ET_TCLARGS)
1152
@text
1121
   {
1153
You will be warned if the template contains other than exactly
1122
   char * TemplateName;
1154
one $ENT$ and $ARCH$ string.
1123
   FILE * VHDLfile;
1155
@end
1124
 
1156
*/
1125
   if (argc < 2)
1157
int WriteVHDLHandler (ET_TCLARGS)
1126
     return(TCL_ERROR);
1158
{
1127
 
1159
        char *TemplateName;
1128
  /* template name is optional */
1160
        FILE *VHDLfile;
1129
   TemplateName = NULL;
1161
 
1130
   if(argc>2)
1162
        if (argc < 2)
1131
     TemplateName=argv[2];
-
 
1132
 
1163
                return (TCL_ERROR);
1133
 
1164
 
1134
   /* slip-up with a null pointer 17 Feb 2000  */
1165
        /* template name is optional */
1135
   if(TemplateName && strcmp(TemplateName,argv[0])==0)  {
1166
        TemplateName = NULL;
-
 
1167
        if (argc > 2)
-
 
1168
                TemplateName = argv[2];
-
 
1169
 
1136
    Log(LOG_ERROR, "# ERROR : VHDL template file name '%s' is the same as the template file name\n",
1170
        /* slip-up with a null pointer 17 Feb 2000  */
-
 
1171
        if (TemplateName && strcmp (TemplateName, argv[0]) == 0)
1137
         argv[1]);
1172
        {
1138
      return(TCL_ERROR);
1173
                Log (
1139
      }
1174
                    LOG_ERROR,
-
 
1175
                    "# ERROR : VHDL template file name '%s' is the same as the template file "
1140
   
1176
                    "name\n",
-
 
1177
                    argv[1]);
1141
   Log(LOG_GENERAL, "# producing VHDL of partition for new entity name '%s' in <%s>\n",
1178
                return (TCL_ERROR);
-
 
1179
        }
1142
        argv[0],argv[1]);
1180
 
1143
   VHDLfile = trap_fopen(argv[1], "w");  /* open text file for writing */
1181
        Log (
1144
   if (!VHDLfile) {
1182
            LOG_GENERAL,
-
 
1183
            "# producing VHDL of partition for new entity name '%s' in <%s>\n",
1145
     Log(LOG_ERROR, "# Error opening VHDL output file: <%s>\n", argv[1]);
1184
            argv[0],
1146
     return(TCL_ERROR);
1185
            argv[1]);
1147
     }
1186
        VHDLfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1187
        if (!VHDLfile)
1148
   else { /* include a template if it exists */
1188
        {
1149
     create_unrouted_list();
1189
                Log (LOG_ERROR, "# Error opening VHDL output file: <%s>\n", argv[1]);
1150
     produce_VHDL(VHDLfile,argv[0],TemplateName);
1190
                return (TCL_ERROR);
1151
     fclose(VHDLfile);
1191
        }
1152
     return (TCL_OK);
1192
        else
1153
    } ;
1193
        { /* include a template if it exists */
1154
  }
1194
                create_unrouted_list ();
1155
/******************** Output a partition name to file ***********************/
1195
                produce_VHDL (VHDLfile, argv[0], TemplateName);
1156
/*
1196
                fclose (VHDLfile);
1157
@title
1197
                return (TCL_OK);
1158
write VLOG <new_entityname> <filename>
1198
        };
1159
@text
Line 1203... Line 1164...
1203
write VLOG <new_entityname> <filename>
1164
the creation of large breadboards using VERTICAL to combine
1204
@text
1165
PCBs.
1205
This is an experimental function used primarily with Certify.
1166
@end
1206
It writes out a board level netlist Verilog (.vb) file with
1167
*/
1207
only sockets that are set as external actually instanced. This
1168
int WriteVLOGHandler (ET_TCLARGS)
1208
removes unnecessary clutter from the design, and allows for
1169
   {
1209
the creation of large breadboards using VERTICAL to combine
1170
   char *TemplateName;
1210
PCBs.
1171
   
1211
@end
1172
   FILE * VLOGfile;
1212
*/
1173
   if (argc < 2)
1213
int WriteVLOGHandler (ET_TCLARGS)
1174
       return(TCL_OK);
1214
{
1175
 
1215
        char *TemplateName;
1176
  /* template name is optional */
1216
 
1177
   TemplateName = NULL;
1217
        FILE *VLOGfile;
1178
   if (argc >2)
1218
        if (argc < 2)
1179
     TemplateName = argv[2];
1219
                return (TCL_OK);
1180
       
1220
 
1181
   /* slip-up with a null pointer 17 Feb 2000  */
1221
        /* template name is optional */
1182
   if(TemplateName && strcmp(TemplateName,argv[1])==0)  {
1222
        TemplateName = NULL;
-
 
1223
        if (argc > 2)
-
 
1224
                TemplateName = argv[2];
-
 
1225
 
1183
    Log(LOG_ERROR, "# ERROR : VLOG file name '%s' is the same as the template file name\n",
1226
        /* slip-up with a null pointer 17 Feb 2000  */
1184
         argv[1]);
1227
        if (TemplateName && strcmp (TemplateName, argv[1]) == 0)
1185
      return(TCL_ERROR);
1228
        {
1186
      }
1229
                Log (
-
 
1230
                    LOG_ERROR,
1187
   
1231
                    "# ERROR : VLOG file name '%s' is the same as the template file name\n",
-
 
1232
                    argv[1]);
1188
   Log(LOG_GENERAL, "# producing VLOG of partition for new entity name '%s' in <%s>\n",
1233
                return (TCL_ERROR);
-
 
1234
        }
1189
        argv[0],argv[1]);
1235
 
1190
   VLOGfile = trap_fopen(argv[1], "w");  /* open text file for writing */
1236
        Log (
1191
   if (!VLOGfile) {
1237
            LOG_GENERAL,
-
 
1238
            "# producing VLOG of partition for new entity name '%s' in <%s>\n",
1192
     Log(LOG_ERROR, "# Error opening VLOG output file: <%s>\n", argv[1]);
1239
            argv[0],
1193
     return(TCL_ERROR);
1240
            argv[1]);
1194
     }
1241
        VLOGfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1242
        if (!VLOGfile)
1195
   else { /* include a template if it exists */
1243
        {
1196
     create_unrouted_list();
1244
                Log (LOG_ERROR, "# Error opening VLOG output file: <%s>\n", argv[1]);
1197
     produce_VLOG(VLOGfile,argv[0],TemplateName);
1245
                return (TCL_ERROR);
1198
     fclose(VLOGfile);
1246
        }
1199
     return (TCL_OK);
1247
        else
1200
    } ;
1248
        { /* include a template if it exists */
1201
  }
1249
                create_unrouted_list ();
1202
/******************** Write Extern command ***********************/
1250
                produce_VLOG (VLOGfile, argv[0], TemplateName);
1203
/*
1251
                fclose (VLOGfile);
1204
@title
1252
                return (TCL_OK);
1205
write EXTernal <filename>
1253
        };
1206
@text
Line 1255... Line 1208...
1255
/******************** Write Extern command ***********************/
1208
Write  out  all sockets set as external to a file as  a  .acfp
1256
/*
1209
file.
1257
@title
1210
@break
1258
write EXTernal <filename>
1211
In addition a COMPONENTS block will be written
1259
@text
1212
@break
1260
 
1213
This is intended to provide Vertical write extern
1261
Write  out  all sockets set as external to a file as  a  .acfp
1214
with an explicit tie-up between the socket ID
1262
file.
1215
e.g. U1 and a device name in the socket e.g. BusChip or whatever. For example:
1263
@break
1216
@listing
1264
In addition a COMPONENTS block will be written
1217
COMPONENTS
1265
@break
1218
  BEGIN
1266
This is intended to provide Vertical write extern
1219
  U1 : BusChip EPM7234 "" ;
1267
with an explicit tie-up between the socket ID
1220
  END;
1268
e.g. U1 and a device name in the socket e.g. BusChip or whatever. For example:
1221
@text
1269
@listing
1222
@break
1270
COMPONENTS
1223
In fact in many cases where write ext is used,  the contents of socket U1 will be known as device name U1.
1271
  BEGIN
-
 
1272
  U1 : BusChip EPM7234 "" ;
1224
@break
1273
  END;
1225
@listing
1274
@text
1226
COMPONENTS
1275
@break
1227
  BEGIN
1276
In fact in many cases where write ext is used,  the contents of socket U1 will be known as
1228
  U1 : U1 EPM7234 "" ;
1277
device name U1.
1229
  END;
1278
@break
1230
@text
1279
@listing
1231
Without this info, the tool cannot locate sockets by name using the chip identifier
1280
COMPONENTS
1232
as ACF files do not contain the chip identifier, only the chip name.
Line 1283... Line 1235...
1283
  END;
1235
 
1284
@text
1236
(see set external command)
1285
Without this info, the tool cannot locate sockets by name using the chip identifier
1237
@end
1286
as ACF files do not contain the chip identifier, only the chip name.
1238
*/
1287
@break
1239
int WriteExternHandler (ET_TCLARGS)
1288
 
1240
   {
1289
 
1241
   FILE * ACFfile;
1290
(see set external command)
1242
 
1291
@end
1243
   if (argc < 1)
1292
*/
1244
     return(TCL_ERROR);
1293
int WriteExternHandler (ET_TCLARGS)
1245
 
1294
{
1246
   Log(LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
1295
        FILE *ACFfile;
1247
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for reading */
1296
 
1248
   if (!ACFfile) {
1297
        if (argc < 1)
-
 
1298
                return (TCL_ERROR);
1249
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
1299
 
1250
     return(TCL_ERROR);
1300
        Log (LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
1251
     }
1301
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for reading */
-
 
1302
        if (!ACFfile)
1252
   else {
1303
        {
1253
     create_unrouted_list();
1304
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
1254
     print_header(ACFfile,TOOL_NAME": WRITE EXTERN");
1305
                return (TCL_ERROR);
1255
     list_extern_sockets(ACFfile);
1306
        }
1256
     list_extern_devices(ACFfile);
1307
        else
1257
     fclose(ACFfile);
1308
        {
1258
     return (TCL_OK);
1309
                create_unrouted_list ();
1259
     }
1310
                print_header (ACFfile, TOOL_NAME ": WRITE EXTERN");
1260
   }
1311
                list_extern_sockets (ACFfile);
1261
/******************** Output a device pin assignments as Xilinx Virtex UCF format ***********************/
1312
                list_extern_devices (ACFfile);
-
 
1313
                fclose (ACFfile);
1262
/*
1314
                return (TCL_OK);
1263
@title
1315
        }
1264
write UCF <chip_ident> <filename>
1316
}
1265
@application vertical_pcb
1317
/******************** Output a device pin assignments as Xilinx Virtex UCF format
1266
@application vertical_pin
1318
 * ***********************/
1267
@application vertical_hdl
1319
/*
1268
@text
1320
@title
1269
Write out device info as a Xilinx Alliance (Virtex etc) UCF, naming socket
1321
write UCF <chip_ident> <filename>
1270
by ident  e.g. U1 or U2 . All pins that
1322
@application vertical_pcb
1271
are known either on routed nets or unrouted nets will be
1323
@application vertical_pin
1272
listed. The names of the routed nets attached to the chip pins
1324
@application vertical_hdl
1273
are given so that the user can detertmine which socket pins
1325
@text
1274
are usable for making connections to the socket. That is all
Line 1328... Line 1277...
1328
are known either on routed nets or unrouted nets will be
1277
This format is exactly compatible with Xilinx Alliance so it is used
1329
listed. The names of the routed nets attached to the chip pins
1278
to produce the new pin assignment files for Xilinx Alliance
1330
are given so that the user can detertmine which socket pins
1279
@end
1331
are usable for making connections to the socket. That is all
1280
*/
1332
of those that are not VCC or Ground for example.
1281
int WriteUCFHandler (ET_TCLARGS)
1333
@break
1282
   {
1334
This format is exactly compatible with Xilinx Alliance so it is used
1283
   FILE * UCFfile;
1335
to produce the new pin assignment files for Xilinx Alliance
1284
   socket_t * skt;
1336
@end
1285
 
1337
*/
1286
   if (argc < 2)
1338
int WriteUCFHandler (ET_TCLARGS)
1287
     return(TCL_ERROR);
1339
{
1288
   skt = find_socket(Ident,argv[0],Search,&socket_head);
1340
        FILE *UCFfile;
1289
 
1341
        socket_t *skt;
1290
   if(!skt) {
1342
 
-
 
1343
        if (argc < 2)
1291
     Log(LOG_GENERAL,"# Cannot find socket id '%s'\n",argv[0]);
1344
                return (TCL_ERROR);
1292
     return(TCL_ERROR);
1345
        skt = find_socket (Ident, argv[0], Search, &socket_head);
1293
     };
1346
 
1294
   Log(LOG_GENERAL, "# producing UCF for socket id '%s' in <%s>\n",
-
 
1295
        argv[0],argv[1]);
1347
        if (!skt)
1296
   UCFfile = trap_fopen(argv[1], "w");     /* open text file for writing */
1348
        {
1297
   if (!UCFfile) {
1349
                Log (LOG_GENERAL, "# Cannot find socket id '%s'\n", argv[0]);
-
 
1350
                return (TCL_ERROR);
1298
       Log(LOG_ERROR, "# Error opening UCF output file: <%s>\n", argv[1]);
1351
        };
1299
       return(TCL_ERROR);
1352
        Log (LOG_GENERAL, "# producing UCF for socket id '%s' in <%s>\n", argv[0], argv[1]);
1300
       }
1353
        UCFfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1354
        if (!UCFfile)
1301
   else {
1355
        {
1302
       create_unrouted_list();
1356
                Log (LOG_ERROR, "# Error opening UCF output file: <%s>\n", argv[1]);
1303
       print_UCF_instance(UCFfile,skt,PRINT_ALL | PRINT_USABLE ); /* include pins not connected to nets */
1357
                return (TCL_ERROR);
-
 
1358
        }
-
 
1359
        else
1304
       fclose(UCFfile);
1360
        {
1305
       return (TCL_OK);
1361
                create_unrouted_list ();
1306
       }
1362
                print_UCF_instance (UCFfile, skt, PRINT_ALL | PRINT_USABLE); /* include pins
1307
    }
1363
                                                                                not connected
1308
   
1364
                                                                                to nets */
1309
/******************** Write Sockets command ***********************/
1365
                fclose (UCFfile);
1310
/*
1366
                return (TCL_OK);
1311
@title
1367
        }
1312
write SOCkets <filename>
1368
}
1313
@text
1369
 
1314
Write  out  all sockets to a file as  a  .acfp
1370
/******************** Write Sockets command ***********************/
1315
file.
1371
/*
1316
@end
1372
@title
1317
*/
1373
write SOCkets <filename>
1318
int WriteSocketHandler (ET_TCLARGS)
1374
@text
1319
   {
1375
Write  out  all sockets to a file as  a  .acfp
1320
   FILE * ACFfile;
1376
file.
1321
 
1377
@end
1322
   if (argc < 2)
1378
*/
1323
     return(TCL_ERROR);
1379
int WriteSocketHandler (ET_TCLARGS)
1324
 
1380
{
1325
   Log(LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
1381
        FILE *ACFfile;
1326
   ACFfile = trap_fopen(argv[0], "w");             /* open text file for write*/
1382
 
1327
   if (!ACFfile) {
1383
        if (argc < 2)
-
 
1384
                return (TCL_ERROR);
1328
     Log(LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
1385
 
1329
     return(TCL_ERROR);
1386
        Log (LOG_GENERAL, "# producing an ACF file <%s>\n", argv[0]);
1330
     }
1387
        ACFfile = trap_fopen (argv[0], "w"); /* open text file for write*/
-
 
1388
        if (!ACFfile)
1331
   else {
1389
        {
1332
     create_unrouted_list();
1390
                Log (LOG_ERROR, "# Error opening ACF output file: <%s>\n", argv[0]);
1333
     print_header(ACFfile,TOOL_NAME": WRITE SOCKETS");
1391
                return (TCL_ERROR);
1334
     list_components(ACFfile);
1392
        }
1335
     fclose(ACFfile);
1393
        else
1336
     return (TCL_OK);
1394
        {
1337
     }
1395
                create_unrouted_list ();
1338
   }
1396
                print_header (ACFfile, TOOL_NAME ": WRITE SOCKETS");
1339
 
1397
                list_components (ACFfile);
1340
/******************** Output a device by name to file ***********************/
1398
                fclose (ACFfile);
1341
/*
1399
                return (TCL_OK);
1342
@title
1400
        }
1343
write PAR_acf <new_entityname> <filename>
Line 1407... Line 1350...
1407
@text
1350
partitioned pieces of the design back into a new toplevel
1408
Write out  partition  entity as Extended ACF so that it may be
1351
entitiy that may be simulated.
1409
read in as a description of the ports of the top level of a
1352
@end
1410
partitiion, in conjunction with the  extended ACF files for
1353
*/
1411
the other partitions in the system.
1354
int WriteParACFHandler (ET_TCLARGS)
1412
This then allows the connection together of all of the
1355
   {
1413
partitioned pieces of the design back into a new toplevel
1356
   FILE * Parfile;
1414
entitiy that may be simulated.
1357
   if (argc < 2)
1415
@end
1358
       return(TCL_ERROR);
1416
*/
1359
 
1417
int WriteParACFHandler (ET_TCLARGS)
1360
 
1418
{
-
 
1419
        FILE *Parfile;
1361
   Log(LOG_GENERAL, "# producing Extended ACF of partition for new entity name '%s' in <%s>\n",
1420
        if (argc < 2)
-
 
1421
                return (TCL_ERROR);
1362
        argv[0],argv[1]);
1422
 
1363
   Parfile = trap_fopen(argv[1], "w");  /* open text file for writing */
1423
        Log (
1364
   if (!Parfile) {
1424
            LOG_GENERAL,
-
 
1425
            "# producing Extended ACF of partition for new entity name '%s' in <%s>\n",
1365
     Log(LOG_ERROR, "# Error opening ACF+ output file: <%s>\n", argv[1]);
1426
            argv[0],
1366
     return(TCL_ERROR);
1427
            argv[1]);
1367
     }
1428
        Parfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1429
        if (!Parfile)
1368
   else {
1430
        {
1369
     create_unrouted_list();
1431
                Log (LOG_ERROR, "# Error opening ACF+ output file: <%s>\n", argv[1]);
1370
     print_header(Parfile,TOOL_NAME" : WRITE PAR_ACF");
1432
                return (TCL_ERROR);
1371
     print_ACF_entity(Parfile,argv[0]);
1433
        }
1372
     fclose(Parfile);
1434
        else
1373
     return (TCL_OK);
1435
        {
1374
    } ;
-
 
1375
  }
1436
                create_unrouted_list ();
1376
 
1437
                print_header (Parfile, TOOL_NAME " : WRITE PAR_ACF");
1377
 
1438
                print_ACF_entity (Parfile, argv[0]);
1378
/******************** Output a device by name to Quartus pinfit file ***********************/
1439
                fclose (Parfile);
1379
/*
1440
                return (TCL_OK);
1380
@title
1441
        };
1381
write quartus <chip_name> <filename>
1442
}
1382
@text
1443
 
1383
Writes out a Quartus .pin pin assignment file with reserved pins and recommended tiedown pins.
1444
/******************** Output a device by name to Quartus pinfit file ***********************/
1384
@end
1445
/*
1385
*/
1446
@title
1386
int WriteQuartusPinfitHandler (ET_TCLARGS)
1447
write quartus <chip_name> <filename>
1387
   {
1448
@text
1388
   FILE * ACFfile;
1449
Writes out a Quartus .pin pin assignment file with reserved pins and recommended tiedown pins.
1389
   socket_t * skt;
1450
@end
1390
   if (argc<2)
1451
*/
1391
       return(TCL_ERROR);
1452
int WriteQuartusPinfitHandler (ET_TCLARGS)
1392
 
1453
{
1393
   skt = find_socket(Name,argv[0],Search,&socket_head);
1454
        FILE *ACFfile;
1394
 
1455
        socket_t *skt;
1395
   if(!skt) {
1456
        if (argc < 2)
-
 
1457
                return (TCL_ERROR);
1396
     Log(LOG_GENERAL,"# Cannot find socket name '%s'\n",argv[0]);
1458
 
1397
     return(TCL_ERROR);
1459
        skt = find_socket (Name, argv[0], Search, &socket_head);
1398
     };
1460
 
-
 
1461
        if (!skt)
-
 
1462
        {
1399
   Log(LOG_GENERAL, "# producing Quartus pinfit for socket name '%s' in <%s>\n",
1463
                Log (LOG_GENERAL, "# Cannot find socket name '%s'\n", argv[0]);
-
 
1464
                return (TCL_ERROR);
1400
        argv[0],argv[1]);
1465
        };
1401
   ACFfile = trap_fopen(argv[1], "w");    /* open text file for writing */
1466
        Log (
1402
   if (!ACFfile) {
1467
            LOG_GENERAL,
-
 
1468
            "# producing Quartus pinfit for socket name '%s' in <%s>\n",
1403
     Log(LOG_ERROR, "# Error opening Quartus pinfit file: <%s>\n", argv[1]);
1469
            argv[0],
1404
     return(TCL_ERROR);
1470
            argv[1]);
1405
     }
1471
        ACFfile = trap_fopen (argv[1], "w"); /* open text file for writing */
-
 
1472
        if (!ACFfile)
1406
   else {
1473
        {
1407
     create_unrouted_list();
1474
                Log (LOG_ERROR, "# Error opening Quartus pinfit file: <%s>\n", argv[1]);
1408
     print_header(ACFfile,TOOL_NAME" : WRITE QUARTUS");
1475
                return (TCL_ERROR);
1409
     print_quartus_pinfit(ACFfile,skt,0); /* used pins only */
1476
        }
1410
     fclose(ACFfile);
1477
        else
1411
     return (TCL_OK);
1478
        {
1412
    } ;
1479
                create_unrouted_list ();
1413
  }
1480
                print_header (ACFfile, TOOL_NAME " : WRITE QUARTUS");
1414
 
1481
                print_quartus_pinfit (ACFfile, skt, 0); /* used pins only */
1415
/******************** Write PinList *************************/
1482
                fclose (ACFfile);
1416
/*
1483
                return (TCL_OK);
1417
@title
1484
        };
1418
write pinlist <socket_id*> <chip_id> [ <filename> ]
1485
}
1419
@text
1486
 
1420
Writes out a pinlist for the connections of socket(s) to an fpga. This is written to a file as HTML.
1487
/******************** Write PinList *************************/
1421
It also writes the pin index created by the 'bundle' command if this has been used on a socket.
1488
/*
-
 
1489
@title
1422
@break
1490
write pinlist <socket_id*> <chip_id> [ <filename> ]
1423
This command is extremely useful for checking pin assignments
1491
@text
1424
@listing
1492
Writes out a pinlist for the connections of socket(s) to an fpga. This is written to a file as
1425
write fit x.*_a u1_a u1_a.html
1493
HTML. It also writes the pin index created by the 'bundle' command if this has been used on a
1426
@text
1494
socket.
1427
This lists all of the pinouts of connectors 'x' on board '_a' which are
1495
@break
1428
connected to 'u1_a'.
1496
This command is extremely useful for checking pin assignments
1429
@end
1497
@listing
1430
*/
1498
write fit x.*_a u1_a u1_a.html
1431
 
1499
@text
1432
int WritePinlistHandler (ET_TCLARGS)
1500
This lists all of the pinouts of connectors 'x' on board '_a' which are
1433
   {
1501
connected to 'u1_a'.
1434
   FILE * ACFfile;
1502
@end
1435
   if (argc<2)
1503
*/
1436
       return(TCL_ERROR);
1504
 
1437
   if (argc>2)
1505
int WritePinlistHandler (ET_TCLARGS)
1438
     ACFfile = trap_fopen(argv[2], "w");    /* open text file for writing */
1506
{
1439
   else
1507
        FILE *ACFfile;
1440
     ACFfile = stdout;
1508
        if (argc < 2)
1441
 
1509
                return (TCL_ERROR);
1442
   if (!ACFfile) {
1510
        if (argc > 2)
-
 
1511
                ACFfile = trap_fopen (argv[2], "w"); /* open text file for writing */
1443
     Log(LOG_ERROR, "# Error opening Pinlist file: <%s>\n", argv[2]);
1512
        else
1444
     return(TCL_ERROR);
1513
                ACFfile = stdout;
1445
     }
1514
 
1446
   else
1515
        if (!ACFfile)
1447
     {
1516
        {
1448
      list_intersection(ACFfile,argv[0], argv[1]) ;
1517
                Log (LOG_ERROR, "# Error opening Pinlist file: <%s>\n", argv[2]);
1449
     if(ACFfile!=stdout)
1518
                return (TCL_ERROR);
1450
       {
1519
        }
1451
       fclose(ACFfile);
1520
        else
1452
       }
1521
        {
1453
     }
1522
                list_intersection (ACFfile, argv[0], argv[1]);
1454
   if(ACFfile!=stdout)
1523
                if (ACFfile != stdout)
1455
     {
1524
                {
1456
     fclose(ACFfile);
1525
                        fclose (ACFfile);
1457
     }
1526
                }
1458
   return TCL_OK;
-
 
1459
   } ;
1527
        }
1460
 
1528
        if (ACFfile != stdout)
1461
 
1529
        {
1462
/******************** Write xxx Menu  ***********************/
1530
                fclose (ACFfile);
1463
 
1531
        }
1464
  CommandMenu WriteMenu = {
1532
        return TCL_OK;
1465
    {"acf",       3, WriteAcfHandler,NULL,
1533
};
-
 
1534
 
1466
                     "Write out an 'Extended ACF' file",
1535
/******************** Write xxx Menu  ***********************/
1467
                     "<filename>",NULL},
1536
 
-
 
1537
CommandMenu const WriteMenu = {
1468
    {"connected",       3, WriteConnectedHandler,NULL,
1538
    {"acf",
-
 
1539
        3,
1469
                     "Write out an 'Extended ACF' file, with all connected pins",
1540
        WriteAcfHandler, NULL, "Write out an 'Extended ACF' file", "<filename>", NULL},
1470
                     "<filename>",NULL},
1541
    {"connected",
-
 
1542
     3,
-
 
1543
     WriteConnectedHandler,
-
 
1544
     NULL,
1471
    {"net",       3, WriteNetHandler,NULL,
1545
     "Write out an 'Extended ACF' file, with all connected pins",
-
 
1546
     "<filename>",
1472
                     "Write out an 'Extended ACF' file, just the netlist part",
1547
     NULL},
1473
                     "<filename>",NULL},
1548
    {"net",
-
 
1549
     3,
-
 
1550
     WriteNetHandler,
-
 
1551
     NULL,
1474
    {"pcb",       3, WriteFrbHandler,NULL,
1552
     "Write out an 'Extended ACF' file, just the netlist part",
-
 
1553
     "<filename>",
1475
                     "Write out an 'FRB' PCB netlist file",
1554
     NULL},
1476
                     "<filename>",NULL},
1555
    {"pcb",
-
 
1556
     3,
-
 
1557
     WriteFrbHandler,
-
 
1558
     NULL,
1477
    {"pinlist",2,    WritePinlistHandler,NULL,
1559
     "Write out an 'FRB' PCB netlist file",
-
 
1560
     "<filename>",
1478
                     "Write out Pin list for socket crossreferenced to FPGA",
1561
     NULL},
1479
                     "<socket ident> <fpga ident> <filename>",NULL},
1562
    {"pinlist",
-
 
1563
     2,
1480
 
1564
     WritePinlistHandler,
-
 
1565
     NULL,
-
 
1566
     "Write out Pin list for socket crossreferenced to FPGA",
1481
    {"identifier",2, WriteIdHandler,NULL,
1567
     "<socket ident> <fpga ident> <filename>",
-
 
1568
     NULL},
1482
                     "Write out device info by ident. (with all pins)",
1569
 
1483
                     "<ident> <filename>",NULL},
1570
    {"identifier",
-
 
1571
     2,
-
 
1572
     WriteIdHandler,
-
 
1573
     NULL,
1484
    {"name",      3, WriteNameHandler,NULL,
1574
     "Write out device info by ident. (with all pins)",
-
 
1575
     "<ident> <filename>",
1485
                     "Write out device info by Name (with used pins)",
1576
     NULL},
1486
                     "<name> <filename>",NULL},
1577
    {"name",
-
 
1578
     3,
-
 
1579
     WriteNameHandler,
-
 
1580
     NULL,
1487
    {"fit",      3,  WriteFitHandler,NULL,
1581
     "Write out device info by Name (with used pins)",
-
 
1582
     "<name> <filename>",
1488
                     "Write out device info by Name (with Expanded VHDL busses)",
1583
     NULL},
1489
                     "<name> <filename>",NULL},
1584
    {"fit",
-
 
1585
     3,
-
 
1586
     WriteFitHandler,
-
 
1587
     NULL,
1490
    {"flatten",  3,  WriteFlattenHandler,NULL,
1588
     "Write out device info by Name (with Expanded VHDL busses)",
-
 
1589
     "<name> <filename>",
1491
                     "Write out Flattened (no jumpers) netlist",
1590
     NULL},
1492
                     "<filename>",NULL},
1591
    {"flatten",
-
 
1592
     3,
-
 
1593
     WriteFlattenHandler,
-
 
1594
     NULL,
1493
    {"extern",    3, WriteExternHandler,NULL,
1595
     "Write out Flattened (no jumpers) netlist",
-
 
1596
     "<filename>",
1494
                     "Write sockets with external connection flags set ",
1597
     NULL},
1495
                     "<filename>",NULL},
1598
    {"extern",
-
 
1599
     3,
-
 
1600
     WriteExternHandler,
-
 
1601
     NULL,
1496
    {"quartus",    3, WriteQuartusPinfitHandler,NULL,
1602
     "Write sockets with external connection flags set ",
-
 
1603
     "<filename>",
1497
                     "Write Quartus pinfit file",
1604
     NULL},
1498
                     "<name> <filename>",NULL},
1605
    {"quartus",
1499
    {"sockets",    3, WriteSocketHandler,NULL,
1606
     3,
1500
                     "Write socket list to file ",
-
 
1501
                     "<filename>",NULL},
1607
     WriteQuartusPinfitHandler,
1502
    {"template",    3, WriteTemplateHandler,NULL,
1608
     NULL,
1503
                     "Write socket templates",
1609
     "Write Quartus pinfit file",
1504
                     "<filename>",NULL},
1610
     "<name> <filename>",
1505
    {"ucf",        3, WriteUCFHandler,NULL,
1611
     NULL},
-
 
1612
    {"sockets", 3, WriteSocketHandler, NULL, "Write socket list to file ", "<filename>", NULL},
1506
                     "Write Xilinx User configuration pin assignments",
1613
    {"template", 3, WriteTemplateHandler, NULL, "Write socket templates", "<filename>", NULL},
1507
                     "<ident> <filename>",NULL},
1614
    {"ucf",
-
 
1615
     3,
-
 
1616
     WriteUCFHandler,
-
 
1617
     NULL,
1508
    {"vhdl",      3, WriteVHDLHandler,NULL,
1618
     "Write Xilinx User configuration pin assignments",
-
 
1619
     "<ident> <filename>",
1509
                     "Write out partition as VHDL",
1620
     NULL},
1510
                     "<new_entityname> <filename> [<template VHDL>]",NULL},
1621
    {"vhdl",
-
 
1622
     3,
-
 
1623
     WriteVHDLHandler,
-
 
1624
     NULL,
1511
    {"vlog",      3, WriteVLOGHandler,NULL,
1625
     "Write out partition as VHDL",
-
 
1626
     "<new_entityname> <filename> [<template VHDL>]",
1512
                     "Write out partition as Verilog",
1627
     NULL},
1513
                     "<new_entityname> <filename> [<template Verilog>]",NULL},
1628
    {"vlog",
-
 
1629
     3,
-
 
1630
     WriteVLOGHandler,
-
 
1631
     NULL,
1514
    {"par_acf",      3, WriteParACFHandler,NULL,
1632
     "Write out partition as Verilog",
-
 
1633
     "<new_entityname> <filename> [<template Verilog>]",
1515
                     "Write out partition entity as Extended ACF",
1634
     NULL},
1516
                     "<new_entityname> <filename>",NULL},
1635
    {"par_acf",
-
 
1636
     3,
1517
    { NULL,0,        NULL,NULL,NULL,NULL,NULL } ,
-
 
1518
 
-
 
1519
    };
-
 
1520
 
1637
     WriteParACFHandler,
1521
 
1638
     NULL,
-
 
1639
     "Write out partition entity as Extended ACF",
1522
 
1640
     "<new_entityname> <filename>",
1523
/*********************** List components Command  ***************************/
1641
     NULL},
1524
/* this lists all of the sockets to standard output */
1642
    {NULL, 0, NULL, NULL, NULL, NULL, NULL},
1525
/*
1643
 
1526
@title
1644
};
1527
list SOCkets
1645
 
1528
@text
1646
/*********************** List components Command  ***************************/
1529
List all of the known components in acfp form to standard output
1647
/* this lists all of the sockets to standard output */
1530
@end
1648
/*
1531
*/
1649
@title
1532
int ListSktHandler(ET_TCLARGS)
1650
list SOCkets
1533
{
1651
@text
1534
  list_components(stdout);
1652
List all of the known components in acfp form to standard output
1535
  return(TCL_OK);
1653
@end
1536
}
1654
*/
1537
/*********************** List components Command  ***************************/
1655
int ListSktHandler (ET_TCLARGS)
1538
/* this lists all of the sockets to standard output */
1656
{
1539
/*
1657
        list_components (stdout);
1540
@title
Line 1659... Line 1542...
1659
}
1542
@text
1660
/*********************** List components Command  ***************************/
1543
List all of the pin renames in ACFP form to standard output
1661
/* this lists all of the sockets to standard output */
1544
@end
1662
/*
1545
*/
1663
@title
1546
 
1664
list RENames
1547
int ListRenamesHandler(ET_TCLARGS)
1665
@text
1548
{
1666
List all of the pin renames in ACFP form to standard output
1549
  print_pin_renames(stdout);
1667
@end
1550
  return(TCL_OK);
1668
*/
1551
}
1669
 
1552
/*********************** List joins Command  ***************************/
1670
int ListRenamesHandler (ET_TCLARGS)
1553
/* this lists all of the joins to standard output */
1671
{
1554
/*
1672
        print_pin_renames (stdout);
1555
@title
Line 1674... Line 1557...
1674
}
1557
@text
1675
/*********************** List joins Command  ***************************/
1558
List all of the netlist joins (jumpers and aliases) in ACFP form to standard output
1676
/* this lists all of the joins to standard output */
1559
@end
1677
/*
1560
*/
1678
@title
1561
 
-
 
1562
 
1679
list JOIn
1563
int ListJoinHandler(ET_TCLARGS)
1680
@text
1564
{
1681
List all of the netlist joins (jumpers and aliases) in ACFP form to standard output
1565
  list_joined(stdout);
1682
@end
1566
  return(TCL_OK);
1683
*/
1567
}
1684
 
1568
/*********************** List partition Command  ***************************/
1685
int ListJoinHandler (ET_TCLARGS)
1569
/* this lists all of the joins to standard output */
1686
{
1570
/*
1687
        list_joined (stdout);
1571
@title
Line 1690... Line 1574...
1690
/*********************** List partition Command  ***************************/
1574
List out to standard output all of the entities currently selected to to combine
1691
/* this lists all of the joins to standard output */
1575
in the top level entitiy when the partition is created
1692
/*
1576
@end
1693
@title
1577
*/
1694
list PARtition
1578
 
1695
@text
1579
int ListPartHandler(ET_TCLARGS)
1696
List out to standard output all of the entities currently selected to to combine
1580
{
1697
in the top level entitiy when the partition is created
1581
  list_partition(stdout);
1698
@end
1582
  return(TCL_OK);
1699
*/
1583
}
1700
 
1584
 
1701
int ListPartHandler (ET_TCLARGS)
1585
/*********************** List xref Command  ***************************/
1702
{
1586
/* this lists all of the links from one socket to another
1703
        list_partition (stdout);
1587
   to standard output */
Line 1750... Line 1634...
1750
calculated via interpretation of the array range given in the
1634
wire or an array of discrete wires given as separate signals
1751
component entity declaration  e.g. std_ulogic_vector ( 6
1635
in any case.
1752
downto 0 ) will be seen as 7 wires when doing a partition, and
1636
@end
1753
when the list xref command is given.
1637
*/
1754
@break
1638
 
-
 
1639
 
1755
After partition  and synthesis all signals become one physical
1640
int ListXrefHandler(ET_TCLARGS)
1756
wire or an array of discrete wires given as separate signals
1641
{
1757
in any case.
1642
  char * SocketName;
1758
@end
1643
  SocketName = NULL; /* no names given, pass null pointer down */
1759
*/
1644
  if (argc >0)
1760
 
1645
    SocketName = argv[0];    
1761
int ListXrefHandler (ET_TCLARGS)
1646
  count_paths(SocketName);
1762
{
1647
  return(TCL_OK);
1763
        char *SocketName;
1648
}
1764
        SocketName = NULL; /* no names given, pass null pointer down */
1649
/*********************** List Templates Command  ***************************/
1765
        if (argc > 0)
1650
/* this lists all of the available socket templates */
1766
                SocketName = argv[0];
1651
/*
1767
        count_paths (SocketName);
1652
@title
Line 1769... Line 1654...
1769
}
1654
@text
1770
/*********************** List Templates Command  ***************************/
1655
List out all of the CHIP pin templates (or VHDL components) that are available (the
1771
/* this lists all of the available socket templates */
1656
device types)
1772
/*
1657
@end
1773
@title
1658
*/
1774
list TEMplates
1659
int ListTemplHandler(ET_TCLARGS)
1775
@text
1660
{
1776
List out all of the CHIP pin templates (or VHDL components) that are available (the
1661
  template_list();
1777
device types)
1662
  return(TCL_OK);
1778
@end
1663
}
1779
*/
1664
/*********************** List Generic Command  ***************************/
1780
int ListTemplHandler (ET_TCLARGS)
1665
/* this lists all of the global generic values */
1781
{
1666
/*
1782
        template_list ();
1667
@title
1783
        return (TCL_OK);
1668
list GENerics
1784
}
1669
@text
1785
/*********************** List Generic Command  ***************************/
1670
List out all of the generics (variables)
1786
/* this lists all of the global generic values */
1671
@end
1787
/*
1672
*/
1788
@title
1673
int ListGenericHandler(ET_TCLARGS)
1789
list GENerics
1674
{
1790
@text
1675
  Log(LOG_GENERAL,"-- partition generics\n");
1791
List out all of the generics (variables)
1676
  list_generic_values(stdout,&partition_generics,0);
1792
@end
1677
  Log(LOG_GENERAL,"-- global generics\n");
1793
*/
1678
  list_generic_values(stdout,&global_generics,0);
1794
int ListGenericHandler (ET_TCLARGS)
1679
  return(TCL_OK);
1795
{
1680
}
1796
        Log (LOG_GENERAL, "-- partition generics\n");
1681
/*********************** List Unrouted Command  ***************************/
1797
        list_generic_values (stdout, &partition_generics, 0);
1682
/* this lists all of the unrouted nets */
1798
        Log (LOG_GENERAL, "-- global generics\n");
1683
/*
1799
        list_generic_values (stdout, &global_generics, 0);
1684
@title
1800
        return (TCL_OK);
1685
list UNRouted
1801
}
1686
@text
1802
/*********************** List Unrouted Command  ***************************/
1687
List out all of the currently unrouted nets. Use after ROUTE command to highlight those nets still not
1803
/* this lists all of the unrouted nets */
1688
routed.
1804
/*
1689
@end
1805
@title
1690
*/
1806
list UNRouted
1691
int ListUnroutedHandler(ET_TCLARGS)
1807
@text
1692
{
1808
List out all of the currently unrouted nets. Use after ROUTE command to highlight those nets
1693
  if(unrouted_list) {  
1809
still not routed.
-
 
1810
@end
1694
    fprintf(stdout,"-- Unrouted nets follow --\n");
1811
*/
1695
    list_nets(stdout,unrouted_list,0);
1812
int ListUnroutedHandler (ET_TCLARGS)
1696
    }
1813
{
1697
  else
1814
        if (unrouted_list)
1698
    fprintf(stdout,"-- Currently no unrouted nets --\n");
1815
        {
1699
     
1816
                fprintf (stdout, "-- Unrouted nets follow --\n");
1700
  return(TCL_OK);
1817
                list_nets (stdout, unrouted_list, 0);
1701
}
1818
        }
1702
 
1819
        else
1703
/*********************** List Net Command  ***************************/
1820
                fprintf (stdout, "-- Currently no unrouted nets --\n");
1704
/* this lists all of the nodes on the named net */
1821
 
1705
/*
1822
        return (TCL_OK);
1706
@title
1823
}
1707
list NET <netname>
1824
 
1708
@text
1825
/*********************** List Net Command  ***************************/
1709
Locates the named net, informs of which netlist it is found on, and then gives the node list of the net (devices visited).
1826
/* this lists all of the nodes on the named net */
-
 
1827
/*
1710
@end
1828
@title
1711
*/
1829
list NET <netname>
1712
 
1830
@text
1713
int ListNetHandler(ET_TCLARGS) {
-
 
1714
  net_t * Net;
-
 
1715
  if(argc > 0) {
1831
Locates the named net, informs of which netlist it is found on, and then gives the node list of
1716
 
1832
the net (devices visited).
1717
    Net = find_net(&named_list,
1833
@end
1718
                        Name,
1834
*/
1719
                        argv[0],
1835
 
1720
                        Search);
1836
int ListNetHandler (ET_TCLARGS)
1721
    if(Net)
1837
{
1722
      Log(LOG_GENERAL,"-- Net on named list\n");
-
 
1723
    else {
1838
        net_t *Net;
1724
        Net = find_net(&routed_list,
1839
        if (argc > 0)
1725
                        Name,
1840
        {
1726
                        argv[0],
1841
                Net = find_net (&named_list, Name, argv[0], Search);
1727
                        Search);
-
 
1728
      if(Net)
1842
                if (Net)
1729
        Log(LOG_GENERAL,"-- Net on routed list\n");
-
 
1730
      else {
-
 
1731
        Net = find_net(&unrouted_list,
1843
                        Log (LOG_GENERAL, "-- Net on named list\n");
1732
                        Name,
1844
                else
1733
                        argv[0],
1845
                {
1734
                        Search);
1846
                        Net = find_net (&routed_list, Name, argv[0], Search);
1735
        if(Net)
1847
                        if (Net)
1736
          Log(LOG_GENERAL,"-- Net on unrouted list\n");
1848
                                Log (LOG_GENERAL, "-- Net on routed list\n");
1737
                       
1849
                        else
1738
        }
-
 
1739
      }
1850
                        {
1740
   if(Net)
1851
                                Net = find_net (&unrouted_list, Name, argv[0], Search);
1741
     list_net_structure(stdout, Net,Net,0,0);
1852
                                if (Net)
1742
   };
1853
                                        Log (LOG_GENERAL, "-- Net on unrouted list\n");
1743
  return(TCL_OK);
-
 
1744
  }
-
 
1745
 
1854
                        }
1746
 
1855
                }
1747
 
1856
                if (Net)
1748
/*********************** List Command  ***************************/
1857
                        list_net_structure (stdout, Net, Net, 0, 0);
1749
 
1858
        };
1750
  CommandMenu ListMenu= {
1859
        return (TCL_OK);
1751
    {"sockets",    3, ListSktHandler,NULL,
-
 
1752
                     "List all known sockets",
-
 
1753
                     "",NULL},
1860
}
1754
    {"joined",     3, ListJoinHandler,NULL,
-
 
1755
                     "List all joined nets",
-
 
1756
                     "",NULL},
-
 
1757
    {"xref",       3, ListXrefHandler,NULL,
-
 
1758
                     "List cross reference",
1861
 
1759
                     "<socket_name>",NULL},
1862
/*********************** List Command  ***************************/
1760
 
1863
 
1761
    {"partition",  3, ListPartHandler,NULL,
-
 
1762
                     "List current partition",
-
 
1763
                     "",NULL},
1864
CommandMenu const ListMenu = {
1764
    {"templates",  3, ListTemplHandler,NULL,
-
 
1765
                     "List IC templates",
-
 
1766
                     "",NULL},
1865
    {"sockets", 3, ListSktHandler, NULL, "List all known sockets", "", NULL},
1767
    {"generics",  3, ListGenericHandler,NULL,
-
 
1768
                     "List Global Generics",
-
 
1769
                     "",NULL},
1866
    {"joined", 3, ListJoinHandler, NULL, "List all joined nets", "", NULL},
1770
    {"renames",   3, ListRenamesHandler,NULL,
-
 
1771
                     "List Pin Renames",
-
 
1772
                     "",NULL},
1867
    {"xref", 3, ListXrefHandler, NULL, "List cross reference", "<socket_name>", NULL},
1773
    {"unrouted",   3, ListUnroutedHandler,NULL,
-
 
1774
                     "List Unrouted nets ",
-
 
1775
                     "",NULL},
1868
 
1776
    {"net",   3, ListNetHandler,NULL,
-
 
1777
                     "List nodes on net",
-
 
1778
                     "<netname>",NULL},
-
 
1779
 
-
 
1780
    { NULL,0,        NULL,NULL,NULL,NULL,NULL } ,
-
 
1781
    };
1869
    {"partition", 3, ListPartHandler, NULL, "List current partition", "", NULL},
1782
 
1870
    {"templates", 3, ListTemplHandler, NULL, "List IC templates", "", NULL},
-
 
1871
    {"generics", 3, ListGenericHandler, NULL, "List Global Generics", "", NULL},
-
 
1872
    {"renames", 3, ListRenamesHandler, NULL, "List Pin Renames", "", NULL},
1783
 
1873
    {"unrouted", 3, ListUnroutedHandler, NULL, "List Unrouted nets ", "", NULL},
1784
/*********************** Connection handler  ***************************/
1874
    {"net", 3, ListNetHandler, NULL, "List nodes on net", "<netname>", NULL},
1785
/* connects the two sockets pin for pin */
1875
 
1786
/*
1876
    {NULL, 0, NULL, NULL, NULL, NULL, NULL},
1787
@title
Line 1915... Line 1826...
1915
PCBs. If it is known that a connection cable (or X-PCB) is to
1826
@break
1916
be used which has a different connection pattern and/or
1827
Reading this PCB in (using the socket/net name suffixing
1917
connector type at each end of the cable, then it would be
1828
feature of VERTICAL) and then issuing connection commands for
1918
possible to manually create a netlist for the cable as though
1829
each socket pair (one for each end of the new cable) will
1919
it were a PCB , with two sockets on it with appropriately
1830
result in the desired set of jumpers being created.
1920
connected via routed nets.
1831
e.g.
1921
@break
1832
@break
1922
Reading this PCB in (using the socket/net name suffixing
1833
A script to be executed by VERTICAL
1923
feature of VERTICAL) and then issuing connection commands for
1834
@listing
1924
each socket pair (one for each end of the new cable) will
1835
# Crossover script
1925
result in the desired set of jumpers being created.
1836
read conn_net _a
Line 1964... Line 1875...
1964
 CONNECTION "c3" "" CREATED_NET;
1875
END;
1965
X1(2); X2(3);
1876
 
1966
 END_CONN;
1877
@end
1967
 CONNECTION "c4" "" CREATED_NET;
1878
*/
1968
X1(1); X2(4);
1879
 
-
 
1880
 
1969
 END_CONN;
1881
int ConnectionHandler(ET_TCLARGS)
1970
END;
1882
{
1971
 
1883
  if (argc < 2)
1972
@end
1884
     return(TCL_ERROR);
1973
*/
1885
  create_all_jumpers(argv[0],argv[1]);
1974
 
1886
  return(TCL_OK);
1975
int ConnectionHandler (ET_TCLARGS)
1887
}
-
 
1888
 
-
 
1889
 
-
 
1890
 
-
 
1891