OpenCores
URL https://opencores.org/ocsvn/sc2v/sc2v/trunk

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step2.y] - Diff between revs 14 and 15

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 14 Rev 15
Line 31... Line 31...
 
 
 
 
  char *enumname;
  char *enumname;
 
 
  int reading_enumerates = 0;
  int reading_enumerates = 0;
 
  int lineno=1;
 
 
/*Multiple Declarations*/
/*Multiple Declarations*/
  int multipledec;
  int multipledec;
  char *storedtype;
  char *storedtype;
 
 
Line 69... Line 69...
  int translate;
  int translate;
 
 
 
 
  void yyerror (const char *str)
  void yyerror (const char *str)
  {
  {
    fprintf (stderr, "error: %s\n", str);
    fprintf (stderr, "line: %d error: %s\n", lineno, str);
  }
  }
 
 
  int yywrap ()
  int yywrap ()
  {
  {
    return 1;
    return 1;
Line 95... Line 95...
    translate = 1;
    translate = 1;
 
 
    fprintf(stderr,"\nSystemC to Verilog Translator v0.3\n\n");
    fprintf(stderr,"\nSystemC to Verilog Translator v0.3\n\n");
        fprintf(stderr,"Parsing header file.......\n\n");
        fprintf(stderr,"Parsing header file.......\n\n");
 
 
 
    FILE* yyin = stdin;
 
    FILE* yyout = stdout;
 
 
    yyparse ();
    yyparse ();
 
 
 
 
    printf ("module %s(", module_name);
    printf ("module %s(", module_name);
    EnumeratePorts (portlist);
    EnumeratePorts (portlist);
Line 113... Line 116...
 
 
    ShowEnumListList (enumlistlist);
    ShowEnumListList (enumlistlist);
 
 
    writeslist=ReadWritesFile (writeslist,(char *) "file_writes.sc2v");
    writeslist=ReadWritesFile (writeslist,(char *) "file_writes.sc2v");
 
 
    ShowSignalsList (signalslist);
    ShowSignalsList (signalslist, writeslist);
 
 
    printf ("\n");
    printf ("\n");
 
 
    ShowInstancedModules (instanceslist);
    ShowInstancedModules (instanceslist);
    printf ("\n");
    printf ("\n");
 
 
Line 228... Line 232...
 
 
      if (module_name_found)
      if (module_name_found)
 
 
        {
        {
 
 
          fprintf (stderr, "error: two or more modules found in the file\n");
          fprintf (stderr, "line: %d error: two or more modules found in the file\n",lineno);
 
 
          exit (1);
          exit (1);
 
 
        }
        }
 
 
Line 670... Line 674...
 
 
            }
            }
          else
          else
            {
            {
 
 
              fprintf (stderr, "\nType %s unknow\n", (char *) $1);
              fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $1);
 
 
              return (1);
              return (1);
 
 
            }
            }
 
 
Line 744... Line 748...
 
 
            }
            }
          else
          else
            {
            {
 
 
              fprintf (stderr, "\nType %s unknow\n", (char *) $1);
              fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $1);
 
 
              return (1);
              return (1);
 
 
            }
            }
 
 
Line 832... Line 836...
 
 
  if (translate == 1)
  if (translate == 1)
    {
    {
 
 
      if (instanceslist == NULL){
      if (instanceslist == NULL){
             fprintf (stderr, "error: no instances found\n");
             fprintf (stderr, "line: %d error: no instances found\n",lineno);
          }else{
          }else{
 
 
            InstanceNode *ill;
            InstanceNode *ill;
        SGLIB_LIST_MAP_ON_ELEMENTS (InstanceNode, instanceslist, ill, next,
        SGLIB_LIST_MAP_ON_ELEMENTS (InstanceNode, instanceslist, ill, next,
        {
        {
Line 953... Line 957...
 
 
        }
        }
      else
      else
        {
        {
 
 
          fprintf (stderr, "\nType %s unknow\n", (char *) $1);
          fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $1);
 
 
          return (1);
          return (1);
 
 
        }
        }
 
 
Line 996... Line 1000...
 
 
        }
        }
      else
      else
        {
        {
 
 
          fprintf (stderr, "\nType %s unknow\n", (char *) $3);
          fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $3);
 
 
          return (1);
          return (1);
 
 
        }
        }
 
 
Line 1044... Line 1048...
 
 
        }
        }
      else
      else
        {
        {
 
 
          fprintf (stderr, "\nType %s unknow\n", (char *) $1);
          fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $1);
 
 
          return (1);
          return (1);
 
 
        }
        }
 
 
Line 1089... Line 1093...
 
 
        }
        }
      else
      else
        {
        {
 
 
          fprintf (stderr, "\nType %s unknow\n", (char *) $3);
          fprintf (stderr, "\nline: %d Type %s unknow\n", lineno, (char *) $3);
 
 
          return (1);
          return (1);
 
 
        }
        }
 
 
Line 1107... Line 1111...
TRANSLATEOFF
TRANSLATEOFF
{
{
 
 
  translate = 0;
  translate = 0;
 
 
  fprintf (stderr, "Found Translate off directive \n");
  fprintf (stderr, "line: %d Found Translate off directive \n",lineno);
 
 
};
};
 
 
 
 
 
 
Line 1119... Line 1123...
TRANSLATEON
TRANSLATEON
{
{
 
 
  translate = 1;
  translate = 1;
 
 
  fprintf (stderr, "Found Translate on directive \n");
  fprintf (stderr, "line: %d Found Translate on directive \n",lineno);
 
 
};
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.