#include "e.h" #include "y.tab.h" out(tp) struct node *tp; { if (drawflag) cdl(); else if (plaflag) plaout(tp); else romout(tp); } plaout(tp) struct node *tp; { register unsigned i, j, o; unsigned x1, x2, bit, mask; long nperms; /* rows in rom */ long li; unsigned change[RCOL]; treedep(tp); nperms = 1L<depend; bit = 1<pin); bit = 1<pin); } } printf("\n"); x1 = ~mask; x2 = 0; for(li=0; li= 10) { x2 = 0; printf("\n"); } } } if(x2) printf("\n"); } } romout(tp) struct node *tp; { register int i,j,x; long nperms; /* rows in rom */ long li; int width; /* # bits per word */ int npline; /* # words per line */ int nline; int line; /* output word # */ if (treeflag) { treeprint(tp); printf("\n\n\n"); } if (labelflag) labels(); nperms = 1L< 16) npline = 1; line = 0; nline = npline; for(li=0;li=0; j--) { x <<= 1; x += (rom[j] & 01); if (j%width==0) { if (hexflag) printf("%x",x); else printf("%o",x); x = 0; } } nline--; line++; if (nline==0) { printf("\n"); nline = npline; } else { printf(" "); } } } exec(tp, in) struct node *tp; unsigned in; { int x, i; if(in < CACHE && cache[in] != ~0) return(cache[in]); for(i=0; ival = (in>>i) & 1; } eval(tp); x = 0; for(i=noutputs-1; i>=0; i--) { x <<= 1; x += rom[i] & 1; } if(in < CACHE) cache[in] = x; return(x); } take(v, m) unsigned v, m; { register i, x; int bit; x = 0; for(i=nleaves-1; i>=0; i--) { bit = 1<name); } printf("\n"); for(i=1; i<=noutputs; i++) { hp = outputs[i]; printf("%s ",hp->name); } printf("\n"); } cdl() { register struct hshtab *hp; register i; if ((hp=chiptype)!=NULL) { printf(".c lde %s\n", hp->name); } for(i=1; i<=nleaves; i++) { hp = leaves[i]; if (hp->type==0) continue; printf("\t%s\t%d\n", hp->name, hp->pin); } for(i=1; i<=noutputs; i++) { hp = outputs[i]; if (hp->type==0) continue; printf("\t%s\t%d\n", hp->name, hp->pin); } for(i=1; i<=nleaves; i++) { hp = leaves[i]; if (hp->type==0) continue; printf(".m\t%s\t%s\n", hp->name, hp->name); } for(i=1; i<=noutputs; i++) { hp = outputs[i]; if (hp->type==0) continue; printf(".m\t%s\t%s\n", hp->name, hp->name); } }