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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step1.y] - Diff between revs 22 and 23

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

Rev 22 Rev 23
Line 29... Line 29...
#include "sc2v_step1.h"
#include "sc2v_step1.h"
 
 
  int lineno = 1;
  int lineno = 1;
  int processfound = 0;
  int processfound = 0;
  int switchfound = 0;
  int switchfound = 0;
 
  int lastswitch=0;
  int switchparenthesis[256];
  int switchparenthesis[256];
  int ifdeffound = 0;
  int ifdeffound = 0;
  char *processname, *processname2;
  char *processname, *processname2;
  char *fileregs;
  char *fileregs;
  char *filename;
  char *filename;
Line 518... Line 519...
  defineparenthesis = 0;
  defineparenthesis = 0;
  if (translate == 1 && verilog == 0)
  if (translate == 1 && verilog == 0)
    {
    {
      if (processfound)
      if (processfound)
        {
        {
          if (openedcase)
          if(lastswitch){
 
            openedcase=0;
 
          }else if (openedcase)
            {
            {
              fprintf (file, " :\n");
              fprintf (file, " :\n");
 
 
              for (i = 0; i < openedkeys; i++)
              for (i = 0; i < openedkeys; i++)
                fprintf (file, "   ");
                fprintf (file, "   ");
Line 612... Line 615...
            }
            }
        }
        }
    }
    }
  else if (verilog == 1)
  else if (verilog == 1)
    fprintf (file, "%s ", (char *) $1);
    fprintf (file, "%s ", (char *) $1);
 
  lastswitch=0;
};
};
 
 
symbol:
symbol:
SYMBOL
SYMBOL
{
{
Line 983... Line 987...
 
 
switch:
switch:
SWITCH
SWITCH
  {
  {
    defineparenthesis = 0;
    defineparenthesis = 0;
 
    lastswitch=1;
    if (translate == 1 && verilog == 0)
    if (translate == 1 && verilog == 0)
      {
      {
        if (processfound)
        if (processfound && !openedcase)
          {
          {
            fprintf (file, "\n");
            fprintf (file, "\n");
            for (i = 0; i < openedkeys; i++)
            for (i = 0; i < openedkeys; i++)
              fprintf (file, "   ");
              fprintf (file, "   ");
            fprintf (file, "case");
            fprintf (file, "case");
            switchfound++;
            switchfound++;
            switchparenthesis[switchfound] = openedkeys + 1;
            switchparenthesis[switchfound] = openedkeys + 1;
 
          }else if (processfound)
 
          {
 
            fprintf (file, ":\n");
 
            for (i = 0; i < openedkeys; i++)
 
              fprintf (file, "   ");
 
            fprintf(file,"begin\n");
 
            for (i = 0; i < openedkeys; i++)
 
              fprintf (file, "   ");
 
            fprintf (file, "case");
 
            switchfound++;
 
            switchparenthesis[switchfound] = openedkeys + 1;
          }
          }
      }
      }
    else if (verilog == 1)
    else if (verilog == 1)
      fprintf (file, "switch");
      fprintf (file, "switch");
  };
  };
Line 1007... Line 1023...
  defineparenthesis = 0;
  defineparenthesis = 0;
  if (translate == 1 && verilog == 0)
  if (translate == 1 && verilog == 0)
    {
    {
      if (processfound)
      if (processfound)
        {
        {
 
         if (!openedcase)
          for (i = 0; i < openedkeys; i++)
          for (i = 0; i < openedkeys; i++)
            fprintf (file, "   ");
            fprintf (file, "   ");
          if (openedcase)
          if (openedcase)
            fprintf (file, ", %d", $2);
            fprintf (file, ", %d", $2);
          else
          else
Line 1031... Line 1048...
  defineparenthesis = 0;
  defineparenthesis = 0;
  if (translate == 1 && verilog == 0)
  if (translate == 1 && verilog == 0)
    {
    {
      if (processfound)
      if (processfound)
        {
        {
 
         if (!openedcase)
          for (i = 0; i < openedkeys; i++)
          for (i = 0; i < openedkeys; i++)
            fprintf (file, "   ");
            fprintf (file, "   ");
          if (openedcase)
          if (openedcase)
            fprintf (file, ", 'h%d", $3);
            fprintf (file, ", 'h%d", $3);
          else
          else
Line 1055... Line 1073...
  defineparenthesis = 0;
  defineparenthesis = 0;
  if (translate == 1 && verilog == 0)
  if (translate == 1 && verilog == 0)
    {
    {
      if (processfound)
      if (processfound)
        {
        {
 
         if (!openedcase)
          for (i = 0; i < openedkeys; i++)
          for (i = 0; i < openedkeys; i++)
            fprintf (file, "   ");
            fprintf (file, "   ");
          if (openedcase)
          if (openedcase)
            fprintf (file, ", %s", (char *) $2);
            fprintf (file, ", %s", (char *) $2);
          else
          else
Line 1079... Line 1098...
  defineparenthesis = 0;
  defineparenthesis = 0;
  if (translate == 1 && verilog == 0)
  if (translate == 1 && verilog == 0)
    {
    {
      if (processfound)
      if (processfound)
        {
        {
 
         if (!openedcase)
          for (i = 0; i < openedkeys; i++)
          for (i = 0; i < openedkeys; i++)
            fprintf (file, "   ");
            fprintf (file, "   ");
          fprintf (file, "default:\n");
          fprintf (file, "default:\n");
          for (i = 0; i < openedkeys; i++)
          for (i = 0; i < openedkeys; i++)
            fprintf (file, "   ");
            fprintf (file, "   ");

powered by: WebSVN 2.1.0

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