logen_list *getlogen(logen_list *ptgen, char *name)
{
   name=namealloc(name);
   while (ptgen) {
      if (ptgen->NAME==name)
         return ptgen;
      ptgen=ptgen->NEXT;
   }
   return NULL;
}
static void renameinstance(lofig_list *f)
{
   loins_list *i;
   char tab[512];

   for (i=f->LOINS;i;i=i->NEXT) {
      strcpy(tab, "v_");
      strcat(tab, i->INSNAME);
      i->INSNAME=namealloc(tab);
   }
}
Esempio n. 3
0
void vexenv()
{
  char Buffer[ 16 ];
  int  Index;

  for ( Index = 0; Index < VEX_MAX_ID; Index++ )
  {
    sprintf( Buffer, "'%c'", VEX_LITERAL_BY_ID[ Index ] );
    VEX_ATOM_BY_ID[ Index ] = namealloc( Buffer );
  }

  for ( Index = 0; Index < VEX_MAX_OPERATOR; Index++ )
  {
    VEX_OPER_NAME[ Index ] = namealloc( VEX_OPER_UPPER_NAME[ Index ] );
  }

  for ( Index = 0; Index < VEX_MAX_STD_FUNC; Index++ )
  {
    VEX_STD_FUNC_NAME[ Index ] = namealloc( VEX_STD_FUNC_UPPER_NAME[ Index ] );
  }
}
Esempio n. 4
0
void CPhfig::saveas (string &name)
{
  char *current_name;

  cmess1 << "  o  Saving layout as \"" << name << "\"...\n";

  current_name = fig->NAME;
  fig->NAME = namealloc ((char*)name.c_str ());

  savephfig (fig);

  fig->NAME = current_name;
}
Esempio n. 5
0
void vpnenv()
{
  VPN_IN = namealloc( mbkgetenv( "VPN_IN") );

  if ( VPN_IN == (char *)0 )
  {
    VPN_IN = namealloc( VPN_DEFAULT_IN );
  }
 
  VPN_OUT = namealloc( mbkgetenv( "VPN_OUT") );

  if ( VPN_OUT == (char *)0 )
  {
    VPN_OUT = namealloc( VPN_DEFAULT_OUT );
  }

  VPN_VHDL_FORMAT = namealloc( "vhdl" );
  VPN_VPN_FORMAT  = namealloc( "vpn"  );
  VPN_SYN_FORMAT  = namealloc( "vhd"  );
  VPN_VBE_FORMAT  = namealloc( "vbe"  );
  VPN_VST_FORMAT  = namealloc( "vst"  );
  VPN_FSM_FORMAT  = namealloc( "fsm"  );
}
void DrealExitFatalError()
{
  rdsbegin();

  DrealExitCloseStream();

  if ( DrealHeadUndo != (drealundo *)NULL )
  {
    DrealFigureRds->NAME = namealloc( "dreal_dump" );
    DrealSaveFigure();
  }

  exit( 2 );

  rdsend();
}
Esempio n. 7
0
velocon *addvelocon (ptype_list *tcon, char *name, long left, long right)
{
velocon *c;

   name = namealloc(name);
   c=(velocon *)mbkalloc(sizeof(velocon));
   c->NEXT=(velocon *)tcon->DATA;
   c->NAME=name;
   c->LEFT=left;
   c->RIGHT=right;
   c->VSIG=NULL;
   c->ROOT=NULL;
   c->USER=NULL;
   tcon->DATA=c;
   return c;
}
Esempio n. 8
0
velosig *addvelosig (ptype_list *tsig, char *name,
                     long left, long right, char type)
{
velosig *s;

   name = namealloc(name);
   s = (velosig *)mbkalloc(sizeof(velosig));
   s->NEXT=(velosig *)tsig->DATA;
   s->NAME=name;
   s->LEFT=left;
   s->RIGHT=right;
   s->VSIG=NULL;
   s->NAMECHAIN=NULL;
   s->USER=NULL;
   s->TYPE=type;
   s->SUPER=NULL;
   tsig->DATA=s;
   return s;
}
logen_list *addlogen(logen_list *ptgen,char *name)
{
logen_list *p;
   
   if (name) {
      name=namealloc(name);
      for (p=ptgen;p;p=p->NEXT) {
         if (name==p->NAME) {
            fprintf(stderr,"Generic %s already exists\n",name);
            return p;
         }
      }
   }
   p=(logen_list *)mbkalloc(sizeof(logen_list));
   p->NAME=name;
   p->TYPE=0;
   p->TAG=0;
   p->NEXT=ptgen;
   return p;
}
Esempio n. 10
0
void SyfInitializeKeyword()
{
  if ( SyfClockKeyword == (char *)0 )
  {
    SyfClockKeyword        = namealloc( "clock"         );
    SyfCurrentStateKeyword = namealloc( "current_state" );
    SyfReturnStateKeyword  = namealloc( "return_state"  );
    SyfNextStateKeyword    = namealloc( "next_state"    );
    SyfControlKeyword      = namealloc( "control"       );
    SyfScanInKeyword       = namealloc( "scan_in"       );
    SyfScanOutKeyword      = namealloc( "scan_out"      );
    SyfScanTestKeyword     = namealloc( "scan_test"     );
    SyfToolsKeyword        = namealloc( "syf"           );

    SyfStackControlKeyword[ FSM_CTRL_NOP  ] = namealloc( "nop"  );
    SyfStackControlKeyword[ FSM_CTRL_PUSH ] = namealloc( "push" );
    SyfStackControlKeyword[ FSM_CTRL_POP  ] = namealloc( "pop"  );
  }

  SyfClockName        = SyfClockKeyword;
  SyfCurrentStateName = SyfCurrentStateKeyword;
  SyfReturnStateName  = SyfReturnStateKeyword;
  SyfNextStateName    = SyfNextStateKeyword;
  SyfControlName      = SyfControlKeyword;
  SyfScanInName       = SyfScanInKeyword;
  SyfScanOutName      = SyfScanOutKeyword;
  SyfScanTestName     = SyfScanTestKeyword;

  SyfStackControlName[ FSM_CTRL_NOP  ] = SyfStackControlKeyword[ FSM_CTRL_NOP  ];
  SyfStackControlName[ FSM_CTRL_PUSH ] = SyfStackControlKeyword[ FSM_CTRL_PUSH ];
  SyfStackControlName[ FSM_CTRL_POP  ] = SyfStackControlKeyword[ FSM_CTRL_POP  ];
}
int main(int argc, char **argv)
{
lofig_list *f;
char *filein=NULL, *fileout=NULL;
int i,j;
int opt=0;

   if (argc<2) {
      printusage();
      exit(1);
   }
   mbkenv();

   for (i=1; i<argc; i++)
      if (argv[i][0]=='-')
         for (j=1; argv[i][j]!='\0'; j++) {
            switch (argv[i][j]) {
               case 'a':
                  opt|=ADDSIG;
                  break;
               case 'n':
                  opt|=NOALIM;
                  break;
               case 'g':
                  opt|=NOLOGEN;
                  break;
               case 'r':
                  opt|=RENINS;
                  break;
               case 'v':
                  opt|=VSTDRV;
                  break;
               case 'c':
                  opt|=VECCON;
                  break;
               case 'm':
                  opt|=MBKDRV;
                  break;
               case 'u':
                  opt|=NOVECT;
                  break;
               default:
                  fprintf(stderr, "** Unknown option -%c\n", argv[i][1]);
                  printusage();
                  exit(2);
            }
         }
      else
         if (!filein)
            filein=argv[i];
         else
            if (!fileout)
               fileout=argv[i];
            else {
               fputs("** Too many filenames\n", stderr);
               printusage();
               exit(4);
            }
               
   if (!filein) {
      fputs("** Filename expected!\n", stderr);
      printusage();
      exit(3);
   }

   f=getlofig(filein,'A');

   guessextdir(f);

   if (opt & NOALIM)
      removepowers(f);

   if (opt & RENINS)
      renameinstance(f);

   if (opt & NOLOGEN)
      removelogen(f);

   #if 0
   if (opt & VECCON) {
      vectlocon(f);
      sortlocon(&f->LOCON);
      f->LOCON=(locon_list *)reverse(f->LOCON);
   }
   #endif

   if (fileout)
      f->NAME=namealloc(fileout);

   if (!(opt & NOVECT))
      vectlosig(&f->LOSIG);

   if (opt & MBKDRV)
      savelofig(f);
   else {
      if (opt&VSTDRV)
         vhdlsavevelofig(f, 0);
      else if (opt&ADDSIG)
         vhdlsavevelofig(f, 1);
      else
         vhdlsavevelofig(f, 2);
   }

#if 0
#ifdef VEL_DEBUG
   f->NAME=namealloc("netlist");
   vhdlsavevelofig(f,1);
#endif
#endif

   exit(0);
}