-
Notifications
You must be signed in to change notification settings - Fork 0
/
palasm20.c
4990 lines (4352 loc) · 131 KB
/
palasm20.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* palasm20.f -- translated by f2c (version 12.02.01).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include <stdlib.h> /* For exit() */
#include <f2c.h>
/* Common Block Declarations */
struct {
logical lblank, lleft, land, lor, lslash, lequal, lright, lxor, lxnor;
} _BLNK__;
#define _BLNK__1 _BLNK__
struct {
integer ipage[16000] /* was [80][200] */;
} pge_;
#define pge_1 pge_
struct {
logical lfuses[2048] /* was [32][64] */, lphant[2048] /*
was [32][64] */;
} lfuses_;
#define lfuses_1 lfuses_
struct {
integer pms, pof, pdf;
} lunit_;
#define lunit_1 lunit_
struct {
integer ifunct, idesc, iend;
} ftest_;
#define ftest_1 ftest_
struct {
integer ntest, tstvec[1000] /* was [20][50] */;
} tstvec_;
#define tstvec_1 tstvec_
struct {
integer ipt;
} ipt_;
#define ipt_1 ipt_
struct {
integer isum[4], idec[4], ipbuf[32], bufio[32], nfuse;
} sum_;
#define sum_1 sum_
/* Table of constant values */
static integer c__1 = 1;
static integer c__4 = 4;
static integer c__73 = 73;
static integer c__80 = 80;
static logical c_false = FALSE_;
static logical c_true = TRUE_;
static integer c__64 = 64;
static integer c__32 = 32;
static integer c__10 = 10;
/* **PALASM20**PALASM20**PALASM20**PALASM20**PALASM20**PALASM20**PALASM20 */
/* P A L A S M 2 0 - TRANSLATES SYMBOLIC EQUATIONS INTO PAL OBJECT */
/* CODE FORMATTED FOR DIRECT INPUT TO STANDARD */
/* PROM PROGRAMMERS. */
/* REV LEVEL: VERSION 1.6C (08/16/83) */
/* (C) COPYRIGHT 1983 MONOLITHIC MEMORIES */
/* ********************************************* */
/* * * */
/* * APPROVAL * */
/* * * */
/* * 1:JOHN BIRKNER * */
/* * * */
/* * PROGRAMMABLE LOGIC PLANNER * */
/* * * */
/* * * */
/* * 2:VINCENT COLI * */
/* * * */
/* * APPLICATIONS ENGINEER * */
/* * * */
/* * * */
/* * 3:MANOUCHEHR VAFAI * */
/* * * */
/* * APPLICATIONS ENGINEER * */
/* * * */
/* * * */
/* ********************************************* */
/* INPUT: PAL DESIGN SPECIFICATION ASSIGNED */
/* TO RPD(1). OPERATION CODES ARE */
/* ASSIGNED TO ROP(5). */
/* OUTPUT: ECHO, SIMULATION, AND FUSE PATTERN */
/* ARE ASSIGNED TO POF(6). HEX AND */
/* BINARY PROGRAMMING FORMATS ARE */
/* ASSIGNED TO PDF(6). PROMPTS AND */
/* ERROR MESSAGES ARE ASSIGNED TO */
/* PMS(6). */
/* PART NUMBER: THE PAL PART NUMBER MUST APPEAR */
/* IN COLUMN ONE OF LINE ONE. */
/* PIN LIST: 20 SYMBOLIC PIN NAMES MUST APPEAR */
/* STARTING ON LINE FIVE. */
/* EQUATIONS: STARTING FIRST LINE AFTER THE */
/* PIN LIST IN THE FOLLOWING FORMS: */
/* A = B*C + D */
/* A := B*C + D */
/* IF( A*B ) C = D + E */
/* A2 := (A1:*:B1) + /C */
/* ALL CHARACTERS FOLLOWING ';' ARE */
/* IGNORED UNTIL THE NEXT LINE. */
/* BLANKS ARE IGNORED. */
/* OPERATORS: ( IN HIERARCHY OF EVALUATION ) */
/* ; COMMENT FOLLOWS */
/* / COMPLEMENT */
/* * AND (PRODUCT) */
/* + OR (SUM) */
/* :+: XOR (EXCLUSIVE OR) */
/* :*: XNOR (EXCLUSIVE NOR) */
/* ( ) CONDITIONAL THREE-STATE */
/* OR FIXED SYMBOL */
/* = EQUALITY */
/* := REPLACED BY (AFTER CLOCK) */
/* FIXED SYMBOLS */
/* FOR PAL16X4 */
/* AND PAL16A4 */
/* ONLY: (AN+/BN) WHERE N = 0,1,2,3 */
/* (AN+BN) FOR OUTPUT PINS */
/* (AN) 17,16,15,14, RESP */
/* (/AN+/BN) A IS OUTPUT */
/* (/BN) B IS INPUT */
/* (AN:+:BN) */
/* (AN+/BN) */
/* (/AN+BN) */
/* (AN:*:BN) */
/* (BN) */
/* (AN*BN) */
/* (/AN) */
/* (/AN+/BN) */
/* (/AN*BN) */
/* FUNCTION L, H, X, Z, AND C ARE VALID */
/* TABLE: FUNCTION TABLE VECTOR ENTRIES. */
/* REFERENCE: A COMPLETE USERS GUIDE TO */
/* DESIGNING WITH PALS USING PALASM */
/* IS PROVIDED IN THE MONOLITHIC */
/* MEMORIES PAL HANDBOOK. */
/* SUBROUTINES: INITLZ,GETSYM,INCR,MATCH,FIXSYM, */
/* IXLATE,ECHO,CAT,PINOUT,PLOT,TWEEK, */
/* BINR,HEX,SLIP,FANTOM,IODC2,IODC4, */
/* TEST,FIXTST,PLOTF,SUMCHK,INTEL */
/* AUTHORS: JOHN BIRKNER AND VINCENT COLI */
/* FAULT TESTING BY IMTIAZ BENGALI */
/* JEDEC FORMAT BY MANO VAFAI */
/* MONOLITHIC MEMORIES INC. */
/* 1165 EAST ARQUES AVENUE */
/* SUNNYVALE, CALIFORNIA 94043 */
/* (408) 739-3535 */
/* FINE PRINT: MONOLITHIC MEMORIES TAKES NO */
/* RESPONSIBILITY FOR THE OPERATION */
/* OR MAINTENANCE OF THIS PROGRAM. */
/* THE SOURCE CODE AS PRINTED HERE */
/* PRODUCED THE OBJECT CODE OF THE */
/* EXAMPLES IN THE APPLICATIONS */
/* SECTION ON A VAX/VMS 11/780 */
/* COMPUTER AND A NATIONAL CSS IBM */
/* SYSTEM/370 FORTRAN IV(G). */
/* *********************************************************************** */
/* *********************************************************************** */
/* MAIN PROGRAM */
/* Actual main program */
int main(int argc, char **argv)
{
extern int MAIN__();
libf2c_init(argc, argv);
MAIN__();
libf2c_close();
exit(0);
return 0;
}
/* Main program */
int MAIN__(void)
{
/* Initialized data */
static struct {
char e_1[4];
integer e_2;
} equiv_108 = { "E ", 0 };
#define e (*(integer *)&equiv_108)
static struct {
char e_1[4];
integer e_2;
} equiv_109 = { "C ", 0 };
#define c__ (*(integer *)&equiv_109)
static struct {
char e_1[4];
integer e_2;
} equiv_110 = { "Q ", 0 };
#define q (*(integer *)&equiv_110)
static struct {
char e_1[4];
integer e_2;
} equiv_111 = { "F ", 0 };
#define f (*(integer *)&equiv_111)
static struct {
char e_1[4];
integer e_2;
} equiv_112 = { "A ", 0 };
#define a (*(integer *)&equiv_112)
static struct {
char e_1[4];
integer e_2;
} equiv_113 = { "J ", 0 };
#define jj (*(integer *)&equiv_113)
static struct {
char e_1[4];
integer e_2;
} equiv_114 = { "B ", 0 };
#define bb (*(integer *)&equiv_114)
static struct {
char e_1[4];
integer e_2;
} equiv_115 = { "C ", 0 };
#define cc (*(integer *)&equiv_115)
static struct {
char e_1[4];
integer e_2;
} equiv_116 = { "O ", 0 };
#define o (*(integer *)&equiv_116)
static struct {
char e_1[4];
integer e_2;
} equiv_117 = { "D ", 0 };
#define dd (*(integer *)&equiv_117)
static struct {
char e_1[4];
integer e_2;
} equiv_118 = { "E ", 0 };
#define ee (*(integer *)&equiv_118)
static struct {
char e_1[4];
integer e_2;
} equiv_119 = { "F ", 0 };
#define ff (*(integer *)&equiv_119)
static struct {
char e_1[4];
integer e_2;
} equiv_120 = { "I ", 0 };
#define ii (*(integer *)&equiv_120)
static struct {
char e_1[4];
integer e_2;
} equiv_121 = { "N ", 0 };
#define nn (*(integer *)&equiv_121)
static struct {
char e_1[4];
integer e_2;
} equiv_122 = { "O ", 0 };
#define oo (*(integer *)&equiv_122)
static struct {
char e_1[4];
integer e_2;
} equiv_123 = { "P ", 0 };
#define pp (*(integer *)&equiv_123)
static struct {
char e_1[4];
integer e_2;
} equiv_124 = { "R ", 0 };
#define rr (*(integer *)&equiv_124)
static struct {
char e_1[4];
integer e_2;
} equiv_125 = { "S ", 0 };
#define ss (*(integer *)&equiv_125)
static struct {
char e_1[4];
integer e_2;
} equiv_126 = { "T ", 0 };
#define tt (*(integer *)&equiv_126)
static struct {
char e_1[4];
integer e_2;
} equiv_127 = { "T ", 0 };
#define t (*(integer *)&equiv_127)
static struct {
char e_1[4];
integer e_2;
} equiv_128 = { "U ", 0 };
#define uu (*(integer *)&equiv_128)
static integer bel = 7;
static struct {
char e_1[4];
integer e_2;
} equiv_129 = { "P ", 0 };
#define p (*(integer *)&equiv_129)
static struct {
char e_1[4];
integer e_2;
} equiv_130 = { "B ", 0 };
#define b (*(integer *)&equiv_130)
static struct {
char e_1[4];
integer e_2;
} equiv_131 = { "H ", 0 };
#define h__ (*(integer *)&equiv_131)
static struct {
char e_1[4];
integer e_2;
} equiv_132 = { "S ", 0 };
#define s (*(integer *)&equiv_132)
static struct {
char e_1[4];
integer e_2;
} equiv_133 = { "L ", 0 };
#define l (*(integer *)&equiv_133)
static struct {
char e_1[4];
integer e_2;
} equiv_134 = { "N ", 0 };
#define n (*(integer *)&equiv_134)
/* Format strings */
static char fmt_3[] = "(/,\002 MONOLITHIC MEMORIES INC. PALASM VERSION 1"
".6C\002)";
static char fmt_33[] = "(\002 (C) COPYRIGHT 1983 MONOLITHIC MEMORIES\002)"
;
static char fmt_1[] = "(/,\002 WHAT IS THE LOGICAL UNIT NUMBER FOR OUTPU"
"T(6)?: \002$)";
static char fmt_2[] = "(i4)";
static char fmt_10[] = "(4a1,a1,a1,a1,73a1,/,80a1,/,80a1,/,80a1)";
static char fmt_11[] = "(80a1)";
static char fmt_18[] = "(/,\002 PAL PART TYPE \002,4a1,a1,a1,a1,\002 IS "
"INCORRECT\002)";
static char fmt_23[] = "(/,\002 LESS THAN 20 PIN NAMES IN PIN LIST\002)";
static char fmt_99[] = "(\002 \002,a1)";
static char fmt_101[] = "(/,\002 ERROR SYMBOL = \002,8a1,\002 IN LI"
"NE NUMBER \002,i4,/,\002 \002,80a1)";
static char fmt_103[] = "(\002 OUTPUT MUST BE INVERTED SINCE \002,4a1,a1"
",a1,a1,\002 IS AN ACTIVE LOW DEVICE\002)";
static char fmt_109[] = "(\002 OUTPUT CANNOT BE INVERTED SINCE \002,4a1,"
"a1,a1,a1,\002 IS AN ACTIVE HIGH DEVICE\002)";
static char fmt_105[] = "(\002 THIS PIN NUMBER \002,i2,\002 IS AN INVALI"
"D OUTPUT PIN\002,\002 FOR \002,4a1,a1,a1,a1)";
static char fmt_115[] = "(\002 THIS PIN NUMBER \002,i2,\002 IS AN INVALI"
"D INPUT PIN\002,\002 FOR \002,4a1,a1,a1,a1)";
static char fmt_119[] = "(/,\002 OUTPUT PIN NAME = \002,8a1,\002 OUTPUT"
" PIN NUMBER = \002,i2,/,\002 MINTERM IN LINE NUMBER \002,i4,/"
",\002 \002,80a1)";
static char fmt_116[] = "(\002 THIS PRODUCT LINE NUMBER \002,i2,\002 IS "
"NOT VALID\002,\002 FOR \002,4a1,a1,a1,a1)";
static char fmt_117[] = "(\002 MAXIMUM OF 8 PRODUCT LINES ARE VALID FOR"
" \002,4a1,a1,a1,a1,/,\002 TOO MANY MINTERMS ARE SPECIFIED IN THI"
"S EQUATION\002)";
static char fmt_106[] = "(/,\002 OPERATION CODES:\002)";
static char fmt_107[] = "(/,\002 E=ECHO INPUT O=PINOUT T=SIMULATE P=P"
"LOT \002,/,\002 B=BRIEF H=HEX S=SHORT L=BHLF N=BNPF \002,/"
",\002 C=CATALOG Q=QUIT F=FAULT TESTING \002,/,\002 "
" J=JEDEC FORMAT I= INTEL HEX\002)";
static char fmt_110[] = "(/,\002 ENTER OPERATION CODE: \002,$)";
static char fmt_120[] = "(a1)";
static char fmt_220[] = "(/,\002 NUMBER OF STUCK AT ONE (SA1) FAULTS AR"
"E =\002i3)";
static char fmt_225[] = "(/,\002 NUMBER OF STUCK AT ZERO (SA0) FAULTS AR"
"E =\002i3)";
static char fmt_230[] = "(/,\002 PRODUCT TERM COVERAGE "
" =\002i3,\002%\002,//)";
/* System generated locals */
integer i__1;
logical L__1;
/* Local variables */
static integer g, i__, j, ic, il;
extern /* Subroutine */ int cat_(void);
static integer ile, ill, rpd, iop, roc;
extern /* Subroutine */ int hex_(logical *, integer *);
static integer iot, lun, isa0, isa1;
static logical lsa01, lsa11;
extern /* Subroutine */ int echo_(integer *, integer *, integer *,
integer *, integer *, integer *, integer *, integer *);
static logical lact;
static integer isaf, ipal[4], ibuf[160] /* was [8][20] */;
static logical lbuf[20];
extern /* Subroutine */ int binr_(logical *, integer *, integer *), incr_(
integer *, integer *, logical *);
static integer comp[80], iprd, ifix;
static logical lprd, lfix, linp, lerr;
static integer inoo;
extern /* Subroutine */ int slip_(logical *, integer *, integer *,
integer *, integer *, integer *), sub_exit(void);
static integer rest[73];
extern /* Subroutine */ int plot_(logical *, integer *, logical *,
integer *, integer *, logical *, integer *, logical *, integer *,
integer *, integer *), test_();
static integer isym[160] /* was [8][20] */, i8pro;
extern /* Subroutine */ int match_(integer *, integer *, integer *);
static integer inoai;
static logical lsame;
extern /* Subroutine */ int intel_(logical *, integer *);
static integer iblow, iprod, ilerr;
extern /* Subroutine */ int tweek_(integer *, integer *, logical *,
logical *);
static logical lprod[80];
static integer title[80], ipctr;
extern /* Subroutine */ int plotf_(integer *, integer *);
static integer count, i88pro, itype, ipctr0, ipctr1, imatch;
static logical lphase[20];
static integer ifault;
extern /* Subroutine */ int ixlate_(integer *, integer *, logical *,
logical *, integer *);
static logical lfirst, loperr;
static integer patnum[80];
extern /* Subroutine */ int getsym_(logical *, integer *, integer *,
integer *, integer *, logical *), initlz_(integer *, integer *,
integer *, integer *, logical *, logical *, integer *, integer *,
integer *, logical *, integer *);
static integer iinput;
extern /* Subroutine */ int pinout_(integer *, integer *, integer *,
integer *, integer *), fixsym_(logical *, integer *, integer *,
integer *, logical *, logical *, integer *, integer *, logical *);
/* Fortran I/O blocks */
static cilist io___32 = { 0, 6, 0, fmt_3, 0 };
static cilist io___33 = { 0, 6, 0, fmt_33, 0 };
static cilist io___34 = { 0, 6, 0, fmt_1, 0 };
static cilist io___35 = { 0, 5, 0, fmt_2, 0 };
static cilist io___44 = { 0, 0, 0, fmt_10, 0 };
static cilist io___54 = { 0, 0, 1, fmt_11, 0 };
static cilist io___63 = { 0, 0, 0, fmt_18, 0 };
static cilist io___66 = { 0, 0, 0, fmt_23, 0 };
static cilist io___81 = { 0, 0, 0, fmt_99, 0 };
static cilist io___82 = { 0, 0, 0, fmt_101, 0 };
static cilist io___83 = { 0, 0, 0, fmt_103, 0 };
static cilist io___84 = { 0, 0, 0, fmt_109, 0 };
static cilist io___85 = { 0, 0, 0, fmt_105, 0 };
static cilist io___86 = { 0, 0, 0, fmt_115, 0 };
static cilist io___87 = { 0, 0, 0, fmt_119, 0 };
static cilist io___88 = { 0, 0, 0, fmt_116, 0 };
static cilist io___89 = { 0, 0, 0, fmt_117, 0 };
static cilist io___90 = { 0, 6, 0, fmt_106, 0 };
static cilist io___91 = { 0, 6, 0, fmt_107, 0 };
static cilist io___92 = { 0, 6, 0, fmt_110, 0 };
static cilist io___93 = { 0, 0, 0, fmt_120, 0 };
static cilist io___105 = { 0, 0, 0, fmt_220, 0 };
static cilist io___106 = { 0, 0, 0, fmt_225, 0 };
static cilist io___107 = { 0, 0, 0, fmt_230, 0 };
/* ASSIGNMENT OF DATA SET REFERENCES */
/* RPD - PAL DESIGN SPECIFICATION (INPUT) */
/* ROC - OPERATION CODE (INPUT) */
/* POF - ECHO, PINOUT, TEST, AND PLOT (OUTPUT) */
/* PDF - HEX AND BINARY FORMAT PROGRAM TAPES (OUTPUT) */
/* PMS - PROMPTS AND ERROR MESSAGES (OUTPUT) */
s_wsfe(&io___32);
e_wsfe();
s_wsfe(&io___33);
e_wsfe();
s_wsfe(&io___34);
e_wsfe();
s_rsfe(&io___35);
do_fio(&c__1, (char *)&lun, (ftnlen)sizeof(integer));
e_rsfe();
rpd = 1;
roc = 5;
lunit_1.pof = lun;
lunit_1.pdf = lun;
lunit_1.pms = lun;
ftest_1.ifunct = 0;
ftest_1.idesc = 0;
/* INITIALIZE LSAME AND LACT TO FALSE (ACTIVE HIGH/LOW ERROR) */
lsame = FALSE_;
lact = FALSE_;
/* INITIALIZE LOPERR TO FALSE (OUTPUT PIN ERROR) */
loperr = FALSE_;
/* INITIALIZE LINP TO FALSE (INPUT PIN ERROR) */
linp = FALSE_;
/* INITIALIZE LPRD TO FALSE (PRODUCT LINE ERROR) */
lprd = FALSE_;
/* READ IN FIRST 4 LINES OF THE PAL DESIGN SPECIFICATION */
io___44.ciunit = rpd;
s_rsfe(&io___44);
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
do_fio(&c__73, (char *)&rest[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&patnum[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&title[0], (ftnlen)sizeof(integer));
do_fio(&c__80, (char *)&comp[0], (ftnlen)sizeof(integer));
e_rsfe();
/* READ IN PIN LIST (LINE 5) THROUGH THE END OF THE PAL DESIGN */
/* SPECIFICATION */
for (j = 1; j <= 200; ++j) {
io___54.ciunit = rpd;
i__1 = s_rsfe(&io___54);
if (i__1 != 0) {
goto L16;
}
for (i__ = 1; i__ <= 80; ++i__) {
i__1 = do_fio(&c__1, (char *)&pge_1.ipage[i__ + j * 80 - 81], (
ftnlen)sizeof(integer));
if (i__1 != 0) {
goto L16;
}
}
i__1 = e_rsfe();
if (i__1 != 0) {
goto L16;
}
/* CHECK FOR 'FUNCTION TABLE' AND SAVE ITS LINE NUMBER */
if (ftest_1.ifunct == 0 && pge_1.ipage[j * 80 - 80] == ff &&
pge_1.ipage[j * 80 - 79] == uu && pge_1.ipage[j * 80 - 78] ==
nn && pge_1.ipage[j * 80 - 77] == cc && pge_1.ipage[j * 80 -
76] == tt && pge_1.ipage[j * 80 - 75] == ii && pge_1.ipage[j *
80 - 74] == oo && pge_1.ipage[j * 80 - 73] == nn &&
pge_1.ipage[j * 80 - 71] == tt && pge_1.ipage[j * 80 - 69] ==
bb && pge_1.ipage[j * 80 - 67] == ee) {
ftest_1.ifunct = j;
}
/* CHECK FOR 'DESCRIPTION' AND SAVE ITS LINE NUMBER */
if (ftest_1.idesc == 0 && pge_1.ipage[j * 80 - 80] == dd &&
pge_1.ipage[j * 80 - 79] == ee && pge_1.ipage[j * 80 - 78] ==
ss && pge_1.ipage[j * 80 - 77] == cc && pge_1.ipage[j * 80 -
76] == rr && pge_1.ipage[j * 80 - 75] == ii && pge_1.ipage[j *
80 - 74] == pp && pge_1.ipage[j * 80 - 73] == tt &&
pge_1.ipage[j * 80 - 72] == ii && pge_1.ipage[j * 80 - 71] ==
oo && pge_1.ipage[j * 80 - 70] == nn) {
ftest_1.idesc = j;
}
/* L15: */
}
/* SAVE THE LAST LINE NUMBER OF THE PAL DESIGN SPECIFICATION */
L16:
ftest_1.iend = j - 1;
initlz_(&inoai, &iot, &inoo, &itype, lfuses_1.lfuses, lfuses_1.lphant, &
ic, &il, &iblow, &lfix, &ipctr);
ile = il + 1;
/* PRINT ERROR MESSAGE FOR INVALID PAL PART TYPE */
if (itype != 0) {
goto L17;
}
io___63.ciunit = lunit_1.pms;
s_wsfe(&io___63);
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
sub_exit();
/* GET 20 PIN NAMES */
L17:
for (j = 1; j <= 20; ++j) {
/* L20: */
getsym_(lphase, isym, &j, &ic, &il, &lfix);
}
if (! (_BLNK__1.lequal || _BLNK__1.lleft || _BLNK__1.land || _BLNK__1.lor
|| _BLNK__1.lright)) {
goto L24;
}
io___66.ciunit = lunit_1.pms;
s_wsfe(&io___66);
e_wsfe();
sub_exit();
L24:
ile = il;
/* BYPASS FUSE PLOT ASSEMBLY IF HAL (H IN COLUMN 1, LINE 1) */
if (ipal[0] == h__) {
goto L108;
}
L25:
getsym_(lbuf, ibuf, &c__1, &ic, &il, &lfix);
L28:
if (! _BLNK__1.lequal) {
goto L25;
}
count = 0;
ill = il;
match_(&imatch, ibuf, isym);
if (imatch == 0) {
goto L100;
}
iprd = imatch;
/* CHECK FOR VALID POLARITY */
lsame = lphase[imatch - 1] && lbuf[0] || ! lphase[imatch - 1] && ! lbuf[0]
;
if (iot == h__ && ! lsame) {
lact = TRUE_;
}
if (! (iot == h__ || iot == c__) && lsame) {
lact = TRUE_;
}
/* CHECK FOR VALID OUTPUT PIN */
if ((itype == 1 || itype == 5 || itype == 6) && iot != a && (imatch < 12
|| imatch > 19)) {
loperr = TRUE_;
}
if (itype == 2 && (imatch < 13 || imatch > 18)) {
loperr = TRUE_;
}
if (itype == 3 && (imatch < 14 || imatch > 17)) {
loperr = TRUE_;
}
if (itype == 4 && (imatch < 15 || imatch > 16)) {
loperr = TRUE_;
}
if (lact || loperr) {
goto L100;
}
i88pro = (19 - imatch << 3) + 1;
/* START PAL16C1 ON PRODUCT LINE 24 (I88PRO=25) */
if (iot == c__) {
i88pro = 25;
}
ic = 0;
L30:
incr_(&ic, &il, &lfix);
if (! (_BLNK__1.lequal || _BLNK__1.lleft)) {
goto L30;
}
lprod[i88pro - 1] = TRUE_;
if (! _BLNK__1.lleft && rest[2] != pp) {
slip_(lfuses_1.lfuses, &i88pro, &inoai, &iot, &inoo, &iblow);
}
for (i8pro = 1; i8pro <= 16; ++i8pro) {
++count;
if (_BLNK__1.lxor && i8pro != 5) {
goto L70;
}
iprod = i88pro + i8pro - 1;
lprod[iprod - 1] = TRUE_;
lfirst = TRUE_;
L50:
ill = il;
getsym_(lbuf, ibuf, &c__1, &ic, &il, &lfix);
if ((itype == 1 || itype == 2 && iprd > 13 && iprd < 18) && count > 2)
{
lprd = TRUE_;
}
if ((itype == 3 || itype == 2 && (iprd == 13 || iprd == 18)) && count
> 4) {
lprd = TRUE_;
}
if (iot != a && iot != c__ && count > 8) {
lprd = TRUE_;
}
if (! lprd) {
goto L69;
}
if (il != ftest_1.ifunct && il != ftest_1.idesc) {
ill = il;
}
--iprod;
goto L118;
L69:
if (lfix) {
goto L59;
}
match_(&imatch, ibuf, isym);
/* CHECK FOR INVALID INPUT PIN */
if (itype == 1 && (imatch >= 12 && imatch <= 19)) {
linp = TRUE_;
}
if (itype == 2 && (imatch >= 13 && imatch <= 18)) {
linp = TRUE_;
}
if (itype == 3 && (imatch >= 14 && imatch <= 17)) {
linp = TRUE_;
}
if (itype == 4 && (imatch == 15 || imatch == 16)) {
linp = TRUE_;
}
if (itype == 5 && (imatch == 12 || imatch == 19)) {
linp = TRUE_;
}
if (itype == 6 && (imatch == 1 || imatch == 11)) {
linp = TRUE_;
}
ill = il;
if (linp) {
goto L100;
}
if (imatch == 0) {
goto L100;
}
if (imatch == 10 || imatch == 99) {
goto L64;
}
if (! lfirst) {
goto L58;
}
lfirst = FALSE_;
for (i__ = 1; i__ <= 32; ++i__) {
++iblow;
/* L56: */
lfuses_1.lfuses[i__ + (iprod << 5) - 33] = TRUE_;
}
L58:
ixlate_(&iinput, &imatch, lphase, lbuf, &itype);
if (iinput <= 0) {
goto L60;
}
--iblow;
lfuses_1.lfuses[iinput + (iprod << 5) - 33] = FALSE_;
plot_(lbuf, ibuf, lfuses_1.lfuses, &iprod, title, &c_false, &itype,
lprod, &iop, &iblow, &ipctr);
goto L60;
L59:
fixsym_(lbuf, ibuf, &ic, &il, &lfirst, lfuses_1.lfuses, &iblow, &
iprod, &lfix);
L60:
if (_BLNK__1.land) {
goto L50;
}
L64:
if (! _BLNK__1.lright) {
goto L68;
}
L66:
incr_(&ic, &il, &lfix);
if (! _BLNK__1.lequal) {
goto L66;
}
L68:
if (! (_BLNK__1.lor || _BLNK__1.lequal)) {
goto L74;
}
L70:
;
}
L74:
ill = il;
getsym_(lbuf, ibuf, &c__1, &ic, &il, &lfix);
if (_BLNK__1.lleft || _BLNK__1.lequal) {
goto L28;
}
L100:
if (ill == ftest_1.ifunct || ill == ftest_1.idesc) {
goto L102;
}
/* PRINT AN ERROR MESSAGE IF UNRECOGNIZABLE SYMBOL */
ilerr = ill + 4;
io___81.ciunit = lunit_1.pms;
s_wsfe(&io___81);
do_fio(&c__1, (char *)&bel, (ftnlen)sizeof(integer));
e_wsfe();
io___82.ciunit = lunit_1.pms;
s_wsfe(&io___82);
for (i__ = 1; i__ <= 8; ++i__) {
do_fio(&c__1, (char *)&ibuf[i__ - 1], (ftnlen)sizeof(integer));
}
do_fio(&c__1, (char *)&ilerr, (ftnlen)sizeof(integer));
for (i__ = 1; i__ <= 80; ++i__) {
do_fio(&c__1, (char *)&pge_1.ipage[i__ + ill * 80 - 81], (ftnlen)
sizeof(integer));
}
e_wsfe();
/* PRINT AN ERROR MESSAGE FOR ACTIVE HIGH/LOW PART */
if (lact && lsame && ! loperr) {
io___83.ciunit = lunit_1.pms;
s_wsfe(&io___83);
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
if (lact && ! lsame && ! loperr) {
io___84.ciunit = lunit_1.pms;
s_wsfe(&io___84);
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
/* PRINT AN ERROR MESSAGE FOR AN INVALID OUTPUT PIN */
if (loperr && imatch != 0) {
io___85.ciunit = lunit_1.pms;
s_wsfe(&io___85);
do_fio(&c__1, (char *)&imatch, (ftnlen)sizeof(integer));
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
/* PRINT AN ERROR MESSAGE FOR AN INVALID INPUT PIN */
if (linp) {
io___86.ciunit = lunit_1.pms;
s_wsfe(&io___86);
do_fio(&c__1, (char *)&imatch, (ftnlen)sizeof(integer));
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
/* PRINT AN ERROR MESSAGE FOR INVALID PRODUCT LINE */
L118:
ilerr = ill + 4;
if (lprd) {
io___87.ciunit = lunit_1.pms;
s_wsfe(&io___87);
for (i__ = 1; i__ <= 8; ++i__) {
do_fio(&c__1, (char *)&isym[i__ + (iprd << 3) - 9], (ftnlen)
sizeof(integer));
}
do_fio(&c__1, (char *)&iprd, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&ilerr, (ftnlen)sizeof(integer));
for (i__ = 1; i__ <= 80; ++i__) {
do_fio(&c__1, (char *)&pge_1.ipage[i__ + ill * 80 - 81], (ftnlen)
sizeof(integer));
}
e_wsfe();
}
if (lprd && count < 8) {
io___88.ciunit = lunit_1.pms;
s_wsfe(&io___88);
do_fio(&c__1, (char *)&iprod, (ftnlen)sizeof(integer));
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
if (lprd && count > 8) {
io___89.ciunit = lunit_1.pms;
s_wsfe(&io___89);
do_fio(&c__4, (char *)&ipal[0], (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoai, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&iot, (ftnlen)sizeof(integer));
do_fio(&c__1, (char *)&inoo, (ftnlen)sizeof(integer));
e_wsfe();
}
sub_exit();
L102:
if (itype <= 4) {
tweek_(&itype, &iot, lfuses_1.lfuses, lfuses_1.lphant);
}
L108:
s_wsfe(&io___90);
e_wsfe();
s_wsfe(&io___91);
e_wsfe();
s_wsfe(&io___92);
e_wsfe();
io___93.ciunit = roc;
s_rsfe(&io___93);
do_fio(&c__1, (char *)&iop, (ftnlen)sizeof(integer));
e_rsfe();
/* CALL IODC2 */
/* IF(POF.NE.6) WRITE(POF,125) */
/* 125 FORMAT('1') */
if (iop == e) {
echo_(ipal, &inoai, &iot, &inoo, rest, patnum, title, comp);
}
if (iop == o) {
pinout_(ipal, &inoai, &iot, &inoo, title);
}
if (iop == t) {
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &inoo,
&lfix, &ipctr, &lerr, &isaf, &ipctr1, &c_false, &c_false, &
L__1);
}
/* THE FOLLOWING IS ADDED FOR SA1 TEST */
/* INITIALIZING THE TOTAL FAULTS. CALLING FOR SA1/SA0 TEST */
isaf = 0;
if (iop == f) {
goto L200;
}
/* END OF ADDITION */
/* ADDITIONS MADE TO GENERATE TEST VECTORS */
/* FOR JEDEC FORMAT */
if (iop != jj) {
goto L135;
}
L__1 = iop != jj;
test_(lphase, lbuf, title, &ic, &il, &ile, isym, ibuf, &itype, &inoo, &
lfix, &ipctr, &lerr, &isaf, &ipctr1, &c_false, &c_false, &L__1);
plotf_(&itype, &iot);