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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step1.y] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jcastillo
/* -----------------------------------------------------------------------------
2
 *
3 16 jcastillo
 *  SystemC to Verilog Translator v0.4
4 31 jcastillo
 *  Provided by Universidad Rey Juan Carlos
5 2 jcastillo
 *
6
 * -----------------------------------------------------------------------------
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  (at your option) any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU Library General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program; if not, write to the Free Software
19
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
 */
21
 
22
 
23
%{
24
#include 
25
#include 
26 33 jcastillo
#include "sglib.h"
27 14 jcastillo
#include "sc2v_step1.h"
28 2 jcastillo
 
29 16 jcastillo
  int lineno = 1;
30 12 jcastillo
  int processfound = 0;
31
  int switchfound = 0;
32 23 jcastillo
  int lastswitch=0;
33 12 jcastillo
  int switchparenthesis[256];
34
  int ifdeffound = 0;
35
  char *processname, *processname2;
36
  char *fileregs;
37
  char *filename;
38
  int openedkeys = 0;
39
  int newline = 0;
40
  int reg_found = 0;
41 35 jcastillo
  int sigreg_found = 0;
42 25 jcastillo
  int reglenght = 0;
43
  int writelenght = 0;
44 20 jcastillo
  int array_size=0;
45 19 jcastillo
  int integer_found=0;
46 12 jcastillo
  int regs_end;
47
  int i = 0;                    //for loops counter
48
  FILE *file;
49
  FILE *regs_file;
50
  char *regname, *regname2;
51
  char *lastword;               // Stores last WORD for use it in WRITE
52
  char *file_defines;
53
  FILE *FILE_DEFINES;
54
  char *file_writes;
55
  FILE *FILE_WRITES;            //FILE to store .write to know if it is a wire or reg
56
  int definefound = 0;
57
  int defineinvocationfound = 0;
58
  int opencorchfound = 0;
59
  int defineparenthesis = 0;
60
  int openedcase = 0;
61 28 jcastillo
  int writingvar=0;
62 2 jcastillo
 
63 12 jcastillo
  int default_break_found = 0;
64
  int default_found;
65 2 jcastillo
 
66 33 jcastillo
  int struct_found=0;
67
  int end_struct=0;
68
  int ignore_semicolon=0;
69
  char *structname;
70
 
71 4 jcastillo
//Directives variables
72 12 jcastillo
  int translate;
73
  int verilog;
74
  int writemethod;
75 4 jcastillo
 
76 12 jcastillo
  void yyerror (const char *str)
77
  {
78 15 jcastillo
    fprintf (stderr, "line: %d error: %s\n", lineno, str);
79 12 jcastillo
  }
80 2 jcastillo
 
81 12 jcastillo
  int yywrap ()
82
  {
83
    return 1;
84
  }
85 2 jcastillo
 
86 12 jcastillo
  main ()
87
  {
88
    int i;
89 10 jcastillo
 
90 16 jcastillo
    defineslist = NULL;
91
    regslist = NULL;
92 33 jcastillo
    structslist = NULL;
93
    structsreglist = NULL;
94 2 jcastillo
 
95 35 jcastillo
    fprintf (stderr, "\nSystemC to Verilog Translator v0.6");
96 16 jcastillo
    fprintf (stderr,
97 35 jcastillo
             "\nProvided by URJC(Universidad Rey Juan Carlos)\nhttp://gdhwsw.escet.urjc.es\n\n");
98 16 jcastillo
    fprintf (stderr, "Parsing implementation file.......\n\n");
99
 
100 14 jcastillo
    processname = (char *) malloc (256 * sizeof (char));
101
    processname2 = (char *) malloc (256 * sizeof (char));
102
    fileregs = (char *) malloc (256 * sizeof (char));
103 12 jcastillo
 
104 14 jcastillo
    file_defines = (char *) malloc (256 * sizeof (char));
105 12 jcastillo
    strcpy (file_defines, (char *) "file_defines.sc2v");
106
    FILE_DEFINES = fopen (file_defines, (char *) "w");
107 16 jcastillo
 
108 14 jcastillo
    file_writes = (char *) malloc (256 * sizeof (char));
109 12 jcastillo
    strcpy (file_writes, (char *) "file_writes.sc2v");
110
    FILE_WRITES = fopen (file_writes, (char *) "w");
111
 
112 16 jcastillo
    lastword = (char *) malloc (sizeof (char) * 256);
113 33 jcastillo
    structname = (char *) malloc (sizeof (char) * 256);
114 12 jcastillo
 
115
    for (i = 0; i < 256; i++)
116
      switchparenthesis[i] = 0;
117
 
118
    translate = 1;
119
    verilog = 0;
120
    writemethod = 0;
121 16 jcastillo
 
122
    FILE *yyin = stdin;
123
    FILE *yyout = stdout;
124 12 jcastillo
    yyparse ();
125
    fclose (FILE_WRITES);
126
    fclose (FILE_DEFINES);
127 16 jcastillo
 
128
    fprintf (stderr, "\nDone\n\n");
129 12 jcastillo
  }
130
 
131 2 jcastillo
%}
132
 
133 35 jcastillo
%token NUMBER WORD SC_REG SC_SIGREG BOOL BIGGER LOWER OPENKEY CLOSEKEY WRITE SYMBOL NEWLINE ENUM INCLUDE
134 16 jcastillo
%token COLON SEMICOLON RANGE OPENPAR CLOSEPAR TWODOUBLEPOINTS OPENCORCH CLOSECORCH SWITCH CASE DEFAULT BREAK
135 19 jcastillo
%token HEXA DEFINE READ TRANSLATEOFF TRANSLATEON VERILOGBEGIN VERILOGEND TAB DOLLAR MINEQ
136
%token VOID TTRUE TFALSE ENDFUNC INC DEC INTEGER EQUALS
137 33 jcastillo
%token PIFDEF PIFNDEF PENDDEF PELSE COMMENT STRUCT DOT
138 2 jcastillo
 
139 16 jcastillo
%% commands:    /* empty */
140 12 jcastillo
|commands command;
141 2 jcastillo
 
142
command:
143 33 jcastillo
  struct_dec
144 16 jcastillo
  |
145 33 jcastillo
  endfunc
146
  |
147 12 jcastillo
  voidword
148
  |
149
  include
150
  |
151
  dollar
152
  |
153
  tab
154
  |
155
  read
156
  |
157 16 jcastillo
  sc_reg
158 12 jcastillo
  |
159 35 jcastillo
  sc_sigreg
160
  |
161 19 jcastillo
  integer
162
  |
163 12 jcastillo
  number
164
  |
165
  bool
166
  |
167
  word
168
  |
169
  symbol
170
  |
171
  write
172
  |
173
  newline
174
  |
175
  openkey
176
  |
177
  closekey
178
  |
179
  colon
180
  |
181
  semicolon
182
  |
183
  range
184
  |
185
  openpar
186
  |
187 19 jcastillo
  closepar
188
  |
189
  void
190
  |
191
  opencorch
192
  |
193
  closecorch
194
  |
195
  bigger
196
  |
197
  lower
198
  |
199
  switch
200
  |
201
  case_only
202
  |
203
  case_number
204
  |
205
  case_hexnumber
206
  |
207 24 jcastillo
  case_hexword
208
  |
209
  case_hexnumberword
210
  |
211 19 jcastillo
  case_word
212
  |
213
  case_default
214
  |
215
  break
216
  |
217
  hexa
218
  |
219
  definemacro
220
  |
221
  defineword
222
  |
223
  definenumber
224
  |
225
  translateoff
226
  |
227
  translateon
228
  |
229
  verilogbegin
230
  |
231
  verilogend
232
  |
233
  ifdef
234 27 jcastillo
  |
235
  ifndef
236 19 jcastillo
  |
237
  endif
238
  |
239
  pelse
240
  |
241
  ttrue
242
  |
243
  tfalse
244
  |
245
  increment
246
  |
247
  decrement
248
  |
249
  equal
250
  |
251 28 jcastillo
  minorequal
252
  |
253 33 jcastillo
  comment
254
  |
255
  struct_access
256
  ;
257
 
258
struct_access:
259
WORD DOT WORD
260
{
261 35 jcastillo
 
262 33 jcastillo
/*Struct access
263
 Check if it is a var acess or a reg*/
264
 if (newline){
265
   for (i = 0; i < openedkeys; i++)
266
      fprintf (file, "   ");
267
 }
268 35 jcastillo
 
269 33 jcastillo
 strcpy(structname,(char *)$3);
270
 strcat(structname,(char *)$1);
271
 regname2 = IsReg (regslist, structname);
272 35 jcastillo
 
273
 if (regname2 == NULL){
274 33 jcastillo
  fprintf (file, "%s ", structname);
275 35 jcastillo
 }else{
276 33 jcastillo
  fprintf (file, "%s", regname2);
277 35 jcastillo
}
278 33 jcastillo
  newline = 0;
279
 
280 35 jcastillo
 
281
 /*printf("Access to struct %s.%s\n",(char *)$1,(char *)$3);*/
282 33 jcastillo
}
283
 
284 19 jcastillo
minorequal:
285
MINEQ
286
{
287
 //This rule is needed because <= in the step two could be confused with a non-blocking assignment
288
 defineparenthesis = 0;
289
  if (translate == 1 && verilog == 0)
290
    {
291
      if (processfound)
292
        {
293
          fprintf (file, "<1+");
294
        }
295
    }
296
  else if (verilog == 1)
297
    fprintf (file, "<=");
298
};
299 4 jcastillo
 
300 16 jcastillo
endfunc:
301
ENDFUNC
302
{
303
  defineparenthesis = 0;
304
  if (translate == 1 && verilog == 0)
305
    {
306
      if (processfound)
307
        {
308
          for (i = 0; i < openedkeys; i++)
309
            fprintf (file, "   ");
310
          fprintf (file, "%s = ", processname);
311
        }
312
    }
313
  else if (verilog == 1)
314
    fprintf (file, "return ");
315
};
316 12 jcastillo
 
317 16 jcastillo
 
318 4 jcastillo
voidword:
319 12 jcastillo
VOID
320
{
321
  defineparenthesis = 0;
322
  if (verilog == 1)
323
    fprintf (file, " void");
324
};
325 4 jcastillo
 
326 12 jcastillo
 
327 4 jcastillo
include:
328 12 jcastillo
INCLUDE
329
{
330
  defineparenthesis = 0;
331
  if (verilog == 1)
332
    fprintf (file, " #include");
333
};
334 4 jcastillo
 
335
 
336
dollar:
337 12 jcastillo
DOLLAR
338
{
339
  defineparenthesis = 0;
340
  if (verilog == 1)
341
    fprintf (file, " $");
342
};
343 4 jcastillo
 
344
 
345
tab:
346 12 jcastillo
TAB
347
{
348
  defineparenthesis = 0;
349
  if (verilog == 1)
350
    fprintf (file, " \t");
351
};
352
 
353 2 jcastillo
read:
354 12 jcastillo
READ OPENPAR CLOSEPAR
355
{
356
  defineparenthesis = 0;
357
  if (verilog == 1)
358
    fprintf (file, ".read()");
359 4 jcastillo
 
360 12 jcastillo
}
361
 
362
defineword:
363
DEFINE WORD WORD
364
{
365 16 jcastillo
 
366 12 jcastillo
  defineparenthesis = 0;
367
  if (translate == 1 && verilog == 0)
368
    {
369
      if (processfound)
370
        {
371
          fprintf (file, "`define %s %s\n", (char *) $2, (char *) $3);
372 16 jcastillo
          defineslist = InsertDefine (defineslist, (char *) $2);
373 12 jcastillo
        }
374
      else
375
        {
376
          fprintf (FILE_DEFINES, "`define %s %s\n", (char *) $2, (char *) $3);
377 16 jcastillo
          defineslist = InsertDefine (defineslist, (char *) $2);
378 12 jcastillo
        }
379
    }
380
  else if (verilog == 1)
381
    fprintf (file, "#define %s %s\n", (char *) $2, (char *) $3);
382
 
383
};
384
 
385
definenumber:
386
DEFINE WORD NUMBER
387
{
388 16 jcastillo
 
389 12 jcastillo
  defineparenthesis = 0;
390
  if (translate == 1 && verilog == 0)
391
    {
392
      if (processfound)
393
        {
394
          fprintf (file, "`define %s %d\n", (char *) $2, (int) $3);
395 16 jcastillo
          defineslist = InsertDefine (defineslist, (char *) $2);
396 12 jcastillo
        }
397
      else
398
        {
399
          fprintf (FILE_DEFINES, "`define %s %d\n", (char *) $2, (int) $3);
400 16 jcastillo
          defineslist = InsertDefine (defineslist, (char *) $2);
401 12 jcastillo
        }
402
    }
403
  else if (verilog == 1)
404
    fprintf (file, "#define %s %d\n", (char *) $2, (int) $3);
405
 
406
};
407
 
408
 
409
definemacro:
410
DEFINE WORD OPENPAR CLOSEPAR
411
{
412
  defineparenthesis = 0;
413
  //Macro found
414
  if (translate == 1 && verilog == 0)
415
    {
416 16 jcastillo
      defineslist = InsertDefine (defineslist, (char *) $2);
417
 
418 12 jcastillo
      definefound = 1;
419
      if (processfound)
420
        fprintf (file, "`define %s ", (char *) $2);
421
      else
422
        fprintf (FILE_DEFINES, "`define %s ", (char *) $2);
423
    }
424
  else if (verilog == 1)
425
    fprintf (file, "#define %s ()", (char *) $2);
426
}
427
 
428 19 jcastillo
void:
429
WORD TWODOUBLEPOINTS WORD OPENPAR
430 12 jcastillo
{
431
  defineparenthesis = 0;
432
  if (translate == 1 && verilog == 0)
433
    {
434
      strcpy (processname, (char *) $4);
435
      strcpy (processname2, (char *) $4);
436
      strcat (processname2, (char *) ".sc2v");
437
      strcpy (fileregs, (char *) $4);
438
      strcat (fileregs, (char *) "_regs.sc2v");
439
    }
440
  else if (verilog == 1)
441
    fprintf (file, " %s::%s()", (char *) $1, (char *) $3);
442
 
443
}
444
 
445 16 jcastillo
sc_reg:
446
SC_REG LOWER NUMBER BIGGER
447 12 jcastillo
{
448
  defineparenthesis = 0;
449
  if (translate == 1 && verilog == 0)
450
    {
451
      if (processfound)
452
        {
453 25 jcastillo
          writelenght=1;
454
          reglenght = $3;
455 12 jcastillo
          reg_found = 1;
456
        }
457
    }
458 16 jcastillo
};
459 2 jcastillo
 
460 35 jcastillo
sc_sigreg:
461
SC_SIGREG LOWER NUMBER BIGGER
462
{
463
  defineparenthesis = 0;
464
  if (translate == 1 && verilog == 0)
465
    {
466
      if (processfound)
467
        {
468
          writelenght=1;
469
          reglenght = $3;
470
          sigreg_found = 1;
471
        }
472
    }
473
};
474
 
475 19 jcastillo
integer:
476
INTEGER
477
{
478
  defineparenthesis = 0;
479
  if (translate == 1 && verilog == 0)
480
    {
481
      if (processfound)
482
        {
483
          fprintf (regs_file, "integer ");
484
          integer_found = 1;
485
        }
486
    }
487
};
488
 
489
 
490 2 jcastillo
bool:
491 12 jcastillo
BOOL
492
{
493
  defineparenthesis = 0;
494
  if (translate == 1 && verilog == 0)
495
    {
496
      if (processfound)
497
        {
498 25 jcastillo
          writelenght=1;
499
          reglenght=0;
500 12 jcastillo
          reg_found = 1;
501
        }
502
    }
503
  else if (verilog == 1)
504
    fprintf (file, "bool");
505
}
506 2 jcastillo
 
507 12 jcastillo
;
508
 
509 2 jcastillo
range:
510 12 jcastillo
RANGE OPENPAR NUMBER COLON NUMBER CLOSEPAR
511
{
512
  defineparenthesis = 0;
513
  if (translate == 1 && verilog == 0)
514
    {
515
      if (processfound)
516
        fprintf (file, "[%d:%d]", $3, $5);
517
      else if (definefound)
518
        fprintf (FILE_DEFINES, "[%d:%d]", $3, $5);
519
    }
520
  else if (verilog == 1)
521
    fprintf (file, ".range(%d,%d)", $3, $5);
522
}
523
 
524
;
525
 
526
number:
527
NUMBER
528
{
529
  defineparenthesis = 0;
530
  if (translate == 1 && verilog == 0)
531
    {
532
      if (processfound)
533 35 jcastillo
       if(opencorchfound && (reg_found || sigreg_found))
534 25 jcastillo
        fprintf (regs_file, "%d:0",$1-1);
535
       else
536
        fprintf (file, "%d", $1);
537 12 jcastillo
      else if (definefound)
538
        fprintf (FILE_DEFINES, "%d", $1);
539
    }
540
  else if (verilog == 1)
541
    fprintf (file, "%d", $1);
542 19 jcastillo
};
543 12 jcastillo
 
544 19 jcastillo
increment:
545
WORD INC
546
{
547
  defineparenthesis = 0;
548
  if (translate == 1 && verilog == 0)
549
       if (processfound){
550
        regname2 = IsReg (regslist, (char *) $1);
551
        if (regname2 == NULL){
552
            fprintf (file, "%s=%s+1", (char *) $1,(char *)$1);
553
        }else
554
            fprintf (file, "%s=%s+1", regname2,regname2);
555
       }
556
  else if (verilog == 1)
557
    fprintf (file, "%s++ ", (char *) $1);
558
};
559
 
560
decrement:
561
WORD DEC
562
{
563
  defineparenthesis = 0;
564
  if (translate == 1 && verilog == 0)
565
      if (processfound){
566
        regname2 = IsReg (regslist, (char *) $1);
567
        if (regname2 == NULL){
568
            fprintf (file, "%s=%s+1", (char *) $1,(char *)$1);
569
        }else
570
            fprintf (file, "%s=%s+1", regname2,regname2);
571
      }
572
  else if (verilog == 1)
573
    fprintf (file, "%s-- ", (char *) $1);
574
};
575 20 jcastillo
 
576 12 jcastillo
word:
577
WORD
578
{
579 16 jcastillo
 
580 12 jcastillo
  defineparenthesis = 0;
581
  if (translate == 1 && verilog == 0)
582
    {
583 28 jcastillo
          if(opencorchfound==0){
584
                strcpy (lastword, (char *) $1);
585
          }
586
 
587 12 jcastillo
      if (processfound)
588
        {
589 23 jcastillo
          if(lastswitch){
590
            openedcase=0;
591 33 jcastillo
          }else if (openedcase){
592 12 jcastillo
              fprintf (file, " :\n");
593
 
594
              for (i = 0; i < openedkeys; i++)
595
                fprintf (file, "   ");
596
 
597 23 jcastillo
              fprintf(file,"begin\n");
598
              openedcase=0;
599 33 jcastillo
          }
600
          if (end_struct){
601
             end_struct=0;
602
             struct_found=0;
603
             ignore_semicolon=1;
604
             structslist=InsertStruct(structslist,(char *)$1,structsreglist);
605 12 jcastillo
 
606 33 jcastillo
             //ShowStructs(structslist);
607
 
608
             /*Now we should convert all the elements of the struct into regs*/
609
             StructRegNode *srll;
610
             SGLIB_LIST_MAP_ON_ELEMENTS (StructRegNode,structsreglist, srll,next,
611
             {
612
               if(srll->length==0)
613
                 fprintf (regs_file, "reg ");
614
               else
615
                 fprintf (regs_file, "reg[%d:0] ", (-1 +srll->length));
616
 
617
               regname =(char *) malloc (sizeof (char) * (strlen (srll->name) + 1));
618
               regname2 = (char *) malloc (sizeof (char) * (strlen (srll->name) + strlen (processname)+strlen((char *)$1)) + 1);
619
               strcpy (regname, srll->name);
620
               strcpy (regname2, srll->name);
621
               strcat (regname, (char *)$1);
622
               strcat (regname2, (char *)$1);
623
               strcat (regname2, processname);
624
               fprintf (regs_file, "%s;\n", regname2); /*By the moment no arrays inside the struct supported*/
625
 
626
               regslist = InsertReg (regslist, regname, regname2);
627
               free (regname);
628
               free (regname2);
629
               structsreglist=NULL;
630
               reg_found=0; /*To avoid arrays in sructs the interpretation finish here*/
631 35 jcastillo
          sigreg_found = 0;
632 33 jcastillo
             );}
633
 
634 35 jcastillo
          }else if(struct_found && (reg_found || sigreg_found)){
635 33 jcastillo
              structsreglist=InsertStructReg(structsreglist,(char *)$1,reglenght);
636
 
637 35 jcastillo
          }else if (reg_found || sigreg_found){
638 25 jcastillo
              if(writelenght){
639
               writelenght=0;
640
               if(reglenght==0)
641 35 jcastillo
            if(sigreg_found)
642
                    fprintf (regs_file, "reg signed");
643
            else
644
               fprintf (regs_file, "reg ");
645 25 jcastillo
               else
646 35 jcastillo
            if(sigreg_found)
647
               fprintf (regs_file, "reg signed [%d:0] ", (-1 +reglenght));
648
            else
649
                fprintf (regs_file, "reg [%d:0] ", (-1 +reglenght));
650
              }
651
 
652 19 jcastillo
              regname = (char *) malloc (sizeof (char) * (strlen ((char *) $1) + 1));
653
              regname2 = (char *) malloc (sizeof (char) * (strlen ((char *) $1) + strlen (processname)) + 1);
654
              strcpy (regname, (char *) $1);
655
              strcpy (regname2, (char *) $1);
656
              strcat (regname2, processname);
657
              fprintf (regs_file, "%s", regname2);
658 12 jcastillo
 
659 19 jcastillo
              regslist = InsertReg (regslist, regname, regname2);
660
              free (regname);
661
              free (regname2);
662 33 jcastillo
          }else if(integer_found){
663 19 jcastillo
              regname = (char *) malloc (sizeof (char) * (strlen ((char *) $1) + 1));
664
              regname2 = (char *) malloc (sizeof (char) * (strlen ((char *) $1) + strlen (processname)) + 1);
665 12 jcastillo
              strcpy (regname, (char *) $1);
666
              strcpy (regname2, (char *) $1);
667
              strcat (regname2, processname);
668 19 jcastillo
              fprintf (regs_file, "%s;\n", regname2);
669 16 jcastillo
 
670
              regslist = InsertReg (regslist, regname, regname2);
671
 
672 19 jcastillo
              //After adding to list print it
673
              fprintf (file, "%s ", regname2);
674
              integer_found=0;
675 16 jcastillo
              free (regname);
676 12 jcastillo
              free (regname2);
677 19 jcastillo
 
678 33 jcastillo
          }else{
679
 
680
              if (newline){
681
                for (i = 0; i < openedkeys; i++)
682
                  fprintf (file, "   ");
683
              }
684
 
685 16 jcastillo
              regname2 = IsReg (regslist, (char *) $1);
686 33 jcastillo
              if (regname2 == NULL){
687
                if (IsDefine (defineslist, (char *) $1)){
688
                   if (ifdeffound == 0){
689
                      fprintf (file, "`%s", (char *) $1);
690
                      defineinvocationfound = 1;
691
                   }else{
692
                      fprintf (file, "%s", (char *) $1);
693
                      ifdeffound = 0;
694
                   }
695
                }else{
696
                   fprintf (file, "%s ", (char *) $1);
697
                }
698
             }else
699 12 jcastillo
                fprintf (file, "%s", regname2);
700 2 jcastillo
 
701 33 jcastillo
             newline = 0;
702
          }
703 12 jcastillo
 
704 33 jcastillo
        }else if (definefound)
705 12 jcastillo
        {
706 16 jcastillo
 
707
          if (IsDefine (defineslist, (char *) $1))
708 12 jcastillo
            {
709
 
710
              fprintf (FILE_DEFINES, "`%s", (char *) $1);
711
            }
712
          else
713
            {
714
              fprintf (FILE_DEFINES, "%s ", (char *) $1);
715
            }
716
        }
717
    }
718
  else if (verilog == 1)
719 19 jcastillo
    fprintf (file, "%s ", (char *) $1);
720 23 jcastillo
  lastswitch=0;
721 12 jcastillo
};
722
 
723 2 jcastillo
symbol:
724 12 jcastillo
SYMBOL
725
{
726
  defineparenthesis = 0;
727
  if (translate == 1 && verilog == 0)
728
    {
729
      if (processfound)
730
        {
731 35 jcastillo
          if (reg_found || sigreg_found)
732 12 jcastillo
            fprintf (regs_file, "%s", (char *) $1);
733
          else
734
            fprintf (file, "%s", (char *) $1);
735
        }
736
      else if (definefound)
737
        {
738
          fprintf (FILE_DEFINES, "%s", (char *) $1);
739
        }
740
    }
741
  else if (verilog == 1)
742
    fprintf (file, "%s", (char *) $1);
743
};
744 2 jcastillo
 
745 19 jcastillo
equal:
746
EQUALS
747
{
748
  defineparenthesis = 0;
749
  reg_found=0;
750 35 jcastillo
  sigreg_found=0;
751 19 jcastillo
  if (translate == 1 && verilog == 0)
752
  {
753 28 jcastillo
   if (processfound)
754 19 jcastillo
        fprintf (file, "=");
755 28 jcastillo
        writingvar=1;
756 19 jcastillo
  }
757
  else if (definefound)
758
    fprintf (FILE_DEFINES, "=");
759
  else if (verilog == 1)
760
    fprintf (file, "=");
761
 
762
}
763 12 jcastillo
 
764 2 jcastillo
write:
765 12 jcastillo
WRITE
766
{
767
  defineparenthesis = 0;
768
  if (translate == 1 && verilog == 0)
769
    {
770
      writemethod = 1;
771
      if (processfound)
772
        {
773
          fprintf (file, " <= ");
774
          fprintf (FILE_WRITES, "%s\n", lastword);
775
        }
776
      else if (definefound)
777
        {
778
          fprintf (FILE_DEFINES, " <= ");
779
        }
780 2 jcastillo
 
781 12 jcastillo
    }
782
  else if (verilog == 1)
783
    {
784
      fprintf (file, ".write");
785
    }
786
};
787
 
788 2 jcastillo
newline:
789 12 jcastillo
NEWLINE
790
{
791
  defineparenthesis = 0;
792 28 jcastillo
  writingvar=0;
793 12 jcastillo
  if (translate == 1 && verilog == 0)
794
    {
795 35 jcastillo
      if (processfound & !reg_found & !openedcase & !sigreg_found)
796 12 jcastillo
        {
797
          fprintf (file, "\n");
798
          newline = 1;
799
        }
800
      else if (definefound)
801
        {
802
          fprintf (FILE_DEFINES, "\n");
803
        }
804 2 jcastillo
 
805 12 jcastillo
    }
806
  else if (verilog == 1)
807
    fprintf (file, "\n");
808
};
809
 
810 2 jcastillo
colon:
811 12 jcastillo
COLON
812
{
813
  defineparenthesis = 0;
814
  if (translate == 1 && verilog == 0)
815
    {
816
      if (processfound)
817
        {
818 35 jcastillo
          if (reg_found || sigreg_found)
819 12 jcastillo
            {
820
              fprintf (regs_file, ",");
821
            }
822
          else
823
            fprintf (file, ",");
824
        }
825
      else if (definefound)
826
        {
827
          fprintf (FILE_DEFINES, ",");
828
        }
829
    }
830
  else if (verilog == 1)
831
    fprintf (file, ",");
832
};
833 2 jcastillo
 
834
semicolon:
835 12 jcastillo
SEMICOLON
836
{
837
  defineparenthesis = 0;
838
  if (translate == 1 && verilog == 0)
839
    {
840 33 jcastillo
      if (processfound && !struct_found && !ignore_semicolon)
841 12 jcastillo
        {
842 35 jcastillo
          if (reg_found || sigreg_found)
843 12 jcastillo
            {
844
              fprintf (regs_file, ";\n");
845
              reg_found = 0;
846 35 jcastillo
         sigreg_found = 0;
847 12 jcastillo
            }
848
          else
849
            {
850 28 jcastillo
            if (defineinvocationfound == 0 || writingvar)
851
                  fprintf (file, ";");
852 12 jcastillo
            }
853
        }
854
      else if (definefound)
855
        {
856
          fprintf (FILE_DEFINES, ";");
857
        }
858
    }
859
  else if (verilog == 1)
860
    fprintf (file, ";");
861 28 jcastillo
 
862
  writingvar=0;
863 12 jcastillo
  defineinvocationfound = 0;
864 33 jcastillo
  ignore_semicolon=0;
865 12 jcastillo
};
866
 
867
 
868 2 jcastillo
openpar:
869 12 jcastillo
OPENPAR
870
{
871
  defineparenthesis = 1;
872
  if (translate == 1 && verilog == 0 && defineinvocationfound == 0)
873
    {
874
      if (processfound)
875
        {
876
          fprintf (file, "(");
877
        }
878
      else if (definefound)
879
        {
880
          fprintf (FILE_DEFINES, "(");
881
        }
882
 
883
    }
884
  else if (verilog == 1)
885
    {
886
      fprintf (file, "(");
887
    }
888 24 jcastillo
  //If par after a sc_reg declaration the declaration is a type cast
889
  reg_found=0;
890 35 jcastillo
  sigreg_found=0;
891 12 jcastillo
}
892
 
893 2 jcastillo
closepar:
894 12 jcastillo
CLOSEPAR
895
{
896
  if (translate == 1 && verilog == 0)
897
    {
898 2 jcastillo
 
899 12 jcastillo
      if (processfound)
900
        {
901
          if (defineparenthesis == 0)
902
            {
903
              fprintf (file, ")");
904
              defineinvocationfound = 0;
905
            }
906
        }
907
      else if (definefound)
908
        {
909
          fprintf (FILE_DEFINES, ")");
910
        }
911
    }
912
  else if (verilog == 1)
913
    fprintf (file, ")");
914
 
915
};
916
 
917
 
918 2 jcastillo
opencorch:
919 12 jcastillo
OPENCORCH
920
{
921
  defineparenthesis = 0;
922
  if (translate == 1 && verilog == 0)
923
    {
924
      if (processfound)
925
        {
926 28 jcastillo
          opencorchfound = 1;
927 35 jcastillo
          if (reg_found || sigreg_found)
928 12 jcastillo
            {
929
              fprintf (regs_file, "[");
930
            }
931
          else
932
            fprintf (file, "[");
933
        }
934
      else if (definefound)
935
        {
936
          fprintf (FILE_DEFINES, "[");
937
 
938
        }
939
    }
940
  else if (verilog == 1)
941
    fprintf (file, "[");
942
};
943
 
944 2 jcastillo
closecorch:
945 12 jcastillo
CLOSECORCH
946
{
947
  defineparenthesis = 0;
948
  if (translate == 1 && verilog == 0)
949
    {
950
      if (processfound)
951 28 jcastillo
          {
952
          opencorchfound = 0;
953 35 jcastillo
          if (reg_found || sigreg_found)
954 12 jcastillo
            {
955
              fprintf (regs_file, "]");
956
            }
957
          else
958
            fprintf (file, "]");
959
        }
960
      else if (definefound)
961
        {
962
          fprintf (FILE_DEFINES, "]");
963
        }
964
    }
965
  else if (verilog == 1)
966
    fprintf (file, "]");
967
};
968
 
969
 
970 2 jcastillo
openkey:
971 12 jcastillo
OPENKEY
972
{
973
  defineparenthesis = 0;
974
  if (translate == 1 && verilog == 0)
975
    {
976
      openedkeys++;
977
      if (!definefound)
978
        {
979
          if (openedkeys == 1)
980
            {
981 14 jcastillo
              printf ("Found process %s\n", processname);
982 12 jcastillo
              file = fopen (processname2, (char *) "w");
983
              regs_file = fopen (fileregs, (char *) "w");
984
              processfound = 1;
985 16 jcastillo
            }
986 12 jcastillo
          if (processfound)
987
            if (openedkeys != switchparenthesis[switchfound])
988
              {
989
                fprintf (file, "\n");
990
                for (i = 0; i < openedkeys; i++)
991
                  fprintf (file, "   ");
992
                fprintf (file, "begin\n");
993
                newline = 1;
994
              }
995
        }
996
    }
997
  else if (verilog == 1)
998
    fprintf (file, "{");
999
};
1000 2 jcastillo
 
1001
closekey:
1002 12 jcastillo
CLOSEKEY
1003
{
1004
  defineparenthesis = 0;
1005 33 jcastillo
  if(struct_found){
1006
    end_struct=1;
1007
  }else if (translate == 1 && verilog == 0){
1008
      if (processfound && !definefound){
1009
          if (openedkeys == switchparenthesis[switchfound] && switchfound > 0){
1010 12 jcastillo
              fprintf (file, "\n");
1011 33 jcastillo
              if (default_found & !default_break_found){
1012 12 jcastillo
                  for (i = 0; i < openedkeys - 1; i++)
1013
                    fprintf (file, "   ");
1014
                  fprintf (file, "end\n");
1015
                  default_found = 0;
1016 33 jcastillo
              }
1017 12 jcastillo
              for (i = 0; i < openedkeys - 1; i++)
1018 33 jcastillo
                fprintf (file, "   ");
1019 2 jcastillo
 
1020 33 jcastillo
              fprintf (file, "endcase\n");
1021
              newline = 1;
1022
              switchparenthesis[switchfound] = 0;
1023
              switchfound--;
1024
          }else{
1025 12 jcastillo
              fprintf (file, "\n");
1026
              for (i = 0; i < openedkeys; i++)
1027 16 jcastillo
                fprintf (file, "   ");
1028 12 jcastillo
              fprintf (file, "end\n");
1029
              newline = 1;
1030 33 jcastillo
          }
1031
      }
1032 2 jcastillo
 
1033 12 jcastillo
      openedkeys--;
1034
      if (definefound)
1035
        {
1036
          definefound = 0;
1037
          if (processfound)
1038
            fprintf (file, "\n//Dummy Comment\n");
1039
          else
1040
            fprintf (FILE_DEFINES, "\n//Dummy Comment\n");
1041
        }
1042
      else if (openedkeys == 0)
1043
        {
1044
          fclose (file);
1045
          fclose (regs_file);
1046
          processfound = 0;
1047 33 jcastillo
          /*Clear process struct list*/
1048
          structslist=NULL;
1049 12 jcastillo
        }
1050
    }
1051
  else if (verilog == 1)
1052
    fprintf (file, "}");
1053
};
1054
 
1055
 
1056 4 jcastillo
bigger:
1057 12 jcastillo
BIGGER
1058
{
1059
  defineparenthesis = 0;
1060
  if (translate == 1 && verilog == 0)
1061
    {
1062
      if (processfound)
1063
        {
1064
          fprintf (file, ">");
1065
        }
1066
      else if (definefound)
1067
        {
1068
          fprintf (FILE_DEFINES, ">");
1069
        }
1070
    }
1071
  else if (verilog == 1)
1072
    fprintf (file, ">");
1073
};
1074 2 jcastillo
 
1075 4 jcastillo
lower:
1076 12 jcastillo
LOWER
1077
{
1078
  defineparenthesis = 0;
1079
  if (translate == 1 && verilog == 0)
1080
    {
1081
      if (processfound)
1082
        {
1083
          fprintf (file, "<");
1084
        }
1085
      else if (definefound)
1086
        {
1087
          fprintf (FILE_DEFINES, "<");
1088
        }
1089
    }
1090
  else if (verilog == 1)
1091
    fprintf (file, "<");
1092
};
1093 2 jcastillo
 
1094 12 jcastillo
 
1095 2 jcastillo
switch:
1096 12 jcastillo
SWITCH
1097
  {
1098
    defineparenthesis = 0;
1099 23 jcastillo
    lastswitch=1;
1100 12 jcastillo
    if (translate == 1 && verilog == 0)
1101
      {
1102 23 jcastillo
        if (processfound && !openedcase)
1103 12 jcastillo
          {
1104
            fprintf (file, "\n");
1105
            for (i = 0; i < openedkeys; i++)
1106
              fprintf (file, "   ");
1107
            fprintf (file, "case");
1108
            switchfound++;
1109
            switchparenthesis[switchfound] = openedkeys + 1;
1110 23 jcastillo
          }else if (processfound)
1111
          {
1112
            fprintf (file, ":\n");
1113
            for (i = 0; i < openedkeys; i++)
1114
              fprintf (file, "   ");
1115
            fprintf(file,"begin\n");
1116
            for (i = 0; i < openedkeys; i++)
1117
              fprintf (file, "   ");
1118
            fprintf (file, "case");
1119
            switchfound++;
1120
            switchparenthesis[switchfound] = openedkeys + 1;
1121 12 jcastillo
          }
1122
      }
1123
    else if (verilog == 1)
1124
      fprintf (file, "switch");
1125
  };
1126
 
1127 2 jcastillo
case_number:
1128 12 jcastillo
CASE NUMBER SYMBOL
1129
{
1130
  defineparenthesis = 0;
1131
  if (translate == 1 && verilog == 0)
1132
    {
1133
      if (processfound)
1134
        {
1135 23 jcastillo
         if (!openedcase)
1136 12 jcastillo
          for (i = 0; i < openedkeys; i++)
1137
            fprintf (file, "   ");
1138
          if (openedcase)
1139
            fprintf (file, ", %d", $2);
1140
          else
1141
            fprintf (file, "%d", $2);
1142 4 jcastillo
 
1143 12 jcastillo
          newline = 1;
1144
          openedcase = 1;
1145
 
1146
        }
1147
    }
1148
  else if (verilog == 1)
1149
    fprintf (file, "case %d %s", $2, (char *) $3);
1150
};
1151
 
1152 19 jcastillo
case_hexnumber:
1153
CASE HEXA NUMBER SYMBOL
1154
{
1155 24 jcastillo
  //Is a dec number
1156 19 jcastillo
  defineparenthesis = 0;
1157
  if (translate == 1 && verilog == 0)
1158
    {
1159
      if (processfound)
1160
        {
1161 23 jcastillo
         if (!openedcase)
1162 19 jcastillo
          for (i = 0; i < openedkeys; i++)
1163
            fprintf (file, "   ");
1164
          if (openedcase)
1165
            fprintf (file, ", 'h%d", $3);
1166
          else
1167
            fprintf (file, "'h%d", $3);
1168
 
1169
          newline = 1;
1170
          openedcase = 1;
1171
 
1172
        }
1173
    }
1174
  else if (verilog == 1)
1175
    fprintf (file, "case %d %s", $3, (char *) $4);
1176
};
1177
 
1178 24 jcastillo
case_hexword:
1179
CASE HEXA WORD SYMBOL
1180
{
1181
  //Begin with a-F
1182
  defineparenthesis = 0;
1183
  if (translate == 1 && verilog == 0)
1184
    {
1185
      if (processfound)
1186
        {
1187
         if (!openedcase)
1188
          for (i = 0; i < openedkeys; i++)
1189
            fprintf (file, "   ");
1190
          if (openedcase)
1191
            fprintf (file, ", 'h%s", (char *)$3);
1192
          else
1193
            fprintf (file, "'h%s", (char *)$3);
1194
 
1195
          newline = 1;
1196
          openedcase = 1;
1197
 
1198
        }
1199
    }
1200
  else if (verilog == 1)
1201
    fprintf (file, "case 0x%s %s", (char *)$3, (char *) $4);
1202
};
1203
 
1204
case_hexnumberword:
1205
CASE HEXA NUMBER WORD SYMBOL
1206
{
1207
  //Hex number beginning with dec number
1208
  defineparenthesis = 0;
1209
  if (translate == 1 && verilog == 0)
1210
    {
1211
      if (processfound)
1212
        {
1213
         if (!openedcase)
1214
          for (i = 0; i < openedkeys; i++)
1215
            fprintf (file, "   ");
1216
          if (openedcase)
1217
            fprintf (file, ", 'h%d%s", $3,(char *)$4);
1218
          else
1219
            fprintf (file, "'h%d%s", $3,(char *)$4);
1220
 
1221
          newline = 1;
1222
          openedcase = 1;
1223
 
1224
        }
1225
    }
1226
  else if (verilog == 1)
1227
    fprintf (file, "case %d%s %s", $3, (char *) $4, (char *)$5);
1228
};
1229
 
1230 4 jcastillo
case_word:
1231 12 jcastillo
CASE WORD SYMBOL
1232
{
1233
  defineparenthesis = 0;
1234
  if (translate == 1 && verilog == 0)
1235
    {
1236
      if (processfound)
1237
        {
1238 23 jcastillo
         if (!openedcase)
1239 12 jcastillo
          for (i = 0; i < openedkeys; i++)
1240
            fprintf (file, "   ");
1241 28 jcastillo
          if (openedcase){
1242
            if (IsDefine (defineslist, (char *) $2))
1243
              fprintf (file, ", `%s", (char *) $2);
1244
                else
1245
                  fprintf (file, ", %s", (char *) $2);
1246
          }else{
1247
            if (IsDefine (defineslist, (char *) $2))
1248
              fprintf (file, "`%s", (char *) $2);
1249
                else
1250
                  fprintf (file, "%s", (char *) $2);
1251
      }
1252 12 jcastillo
          newline = 1;
1253
          openedcase = 1;
1254
 
1255
        }
1256
    }
1257
  else if (verilog == 1)
1258
    fprintf (file, "case %s %s", (char *) $2, (char *) $3);
1259
};
1260
 
1261 2 jcastillo
case_default:
1262 12 jcastillo
DEFAULT SYMBOL
1263
{
1264
  defineparenthesis = 0;
1265
  if (translate == 1 && verilog == 0)
1266
    {
1267
      if (processfound)
1268
        {
1269 23 jcastillo
         if (!openedcase)
1270 12 jcastillo
          for (i = 0; i < openedkeys; i++)
1271
            fprintf (file, "   ");
1272
          fprintf (file, "default:\n");
1273
          for (i = 0; i < openedkeys; i++)
1274
            fprintf (file, "   ");
1275
          fprintf (file, "begin\n");
1276
          newline = 1;
1277
          default_found = 1;
1278
        }
1279
    }
1280
  else if (verilog == 1)
1281
    fprintf (file, "default %s", (char *) $2);
1282
};
1283 2 jcastillo
 
1284 4 jcastillo
case_only:
1285 12 jcastillo
CASE OPENPAR
1286
{
1287
  defineparenthesis = 0;
1288
  //This rule occurs when in Verilog mode a case appears
1289
  if (verilog == 1)
1290
    fprintf (file, "case(");
1291
};
1292 4 jcastillo
 
1293 2 jcastillo
break:
1294 12 jcastillo
BREAK SEMICOLON
1295
{
1296
  defineparenthesis = 0;
1297
  if (translate == 1 && verilog == 0)
1298
    {
1299
      if (processfound)
1300
        {
1301
          if (newline == 0)
1302
            fprintf (file, "\n");
1303
          for (i = 0; i < openedkeys; i++)
1304
            fprintf (file, "   ");
1305
          fprintf (file, "end\n");
1306
          if (default_found)
1307
            {
1308
              default_break_found = 1;
1309
            }
1310
        }
1311
    }
1312
  else if (verilog == 1)
1313
    fprintf (file, "break;");
1314
};
1315 2 jcastillo
 
1316
hexa:
1317 12 jcastillo
HEXA
1318
{
1319
  defineparenthesis = 0;
1320
  if (translate == 1 && verilog == 0)
1321
    {
1322
      if (processfound)
1323
        {
1324
          fprintf (file, "'h");
1325
        }
1326
      else if (definefound)
1327
        {
1328
          fprintf (FILE_DEFINES, "'h");
1329
        }
1330
    }
1331
  else if (verilog == 1)
1332
    fprintf (file, "0x");
1333
};
1334
 
1335 4 jcastillo
translateoff:
1336 12 jcastillo
TRANSLATEOFF
1337
{
1338
  defineparenthesis = 0;
1339
  translate = 0;
1340 15 jcastillo
  fprintf (stderr, "line: %d Found Translate off directive \n", lineno);
1341 12 jcastillo
};
1342 4 jcastillo
 
1343
translateon:
1344 12 jcastillo
TRANSLATEON
1345
{
1346
  defineparenthesis = 0;
1347
  translate = 1;
1348 15 jcastillo
  fprintf (stderr, "line: %d Found Translate on directive \n", lineno);
1349 12 jcastillo
};
1350
 
1351 4 jcastillo
verilogbegin:
1352 12 jcastillo
VERILOGBEGIN
1353
{
1354
  defineparenthesis = 0;
1355
  verilog = 1;
1356 15 jcastillo
  fprintf (stderr, "line: %d Found Verilog Begin directive \n", lineno);
1357 12 jcastillo
};
1358 4 jcastillo
 
1359
verilogend:
1360 12 jcastillo
VERILOGEND
1361
{
1362
  defineparenthesis = 0;
1363
  verilog = 0;
1364 15 jcastillo
  fprintf (stderr, "line: %d Found Verilog End directive \n", lineno);
1365 12 jcastillo
};
1366 4 jcastillo
 
1367
ifdef:
1368 12 jcastillo
PIFDEF
1369
{
1370
  defineparenthesis = 0;
1371
  if (translate == 1 && verilog == 0)
1372
    {
1373
      if (processfound)
1374
        {
1375
          ifdeffound = 1;
1376
          fprintf (file, "`ifdef");
1377
        }
1378
      else if (definefound)
1379
        {
1380
          fprintf (FILE_DEFINES, "`ifdef");
1381
        }
1382
    }
1383
  else if (verilog == 1)
1384
    fprintf (file, "#ifdef");
1385
};
1386
 
1387 27 jcastillo
ifndef:
1388
PIFNDEF
1389
{
1390
  defineparenthesis = 0;
1391
  if (translate == 1 && verilog == 0)
1392
    {
1393
      if (processfound)
1394
        {
1395
          ifdeffound = 1;
1396
          fprintf (file, "`ifndef");
1397
        }
1398
      else if (definefound)
1399
        {
1400
          fprintf (FILE_DEFINES, "`ifndef");
1401
        }
1402
    }
1403
  else if (verilog == 1)
1404
    fprintf (file, "#ifndef");
1405
};
1406
 
1407 4 jcastillo
endif:
1408 12 jcastillo
PENDDEF
1409
{
1410
  defineparenthesis = 0;
1411
  if (translate == 1 && verilog == 0)
1412
    {
1413
      if (processfound)
1414
        {
1415
          fprintf (file, "`endif");
1416
        }
1417
      else if (definefound)
1418
        {
1419
          fprintf (FILE_DEFINES, "`endif");
1420
        }
1421
    }
1422
  else if (verilog == 1)
1423
    fprintf (file, "#endif");
1424
};
1425
 
1426 6 jcastillo
pelse:
1427 12 jcastillo
PELSE
1428
{
1429
  defineparenthesis = 0;
1430
  if (translate == 1 && verilog == 0)
1431
    {
1432
      if (processfound)
1433
        {
1434
          fprintf (file, "`else");
1435
        }
1436
      else if (definefound)
1437
        {
1438
          fprintf (FILE_DEFINES, "`else");
1439
        }
1440
    }
1441
  else if (verilog == 1)
1442
    fprintf (file, "#else");
1443
};
1444
 
1445 6 jcastillo
ttrue:
1446 12 jcastillo
TTRUE
1447
{
1448
  defineparenthesis = 0;
1449
  if (translate == 1 && verilog == 0)
1450
    {
1451
      if (processfound)
1452
        {
1453
          fprintf (file, "1");
1454
        }
1455
    }
1456
  else if (verilog == 1)
1457
    fprintf (file, "1");
1458
};
1459 6 jcastillo
 
1460
 
1461
tfalse:
1462 12 jcastillo
TFALSE
1463
{
1464
  defineparenthesis = 0;
1465
  if (translate == 1 && verilog == 0)
1466
    {
1467
      if (processfound)
1468
        {
1469
          fprintf (file, "0");
1470
        }
1471
    }
1472
  else if (verilog == 1)
1473
    fprintf (file, "0");
1474
};
1475 28 jcastillo
 
1476
comment:
1477
COMMENT
1478
{
1479
if(processfound){
1480
  //To manage comments inside switch statements
1481
  if(lastswitch){
1482
        openedcase=0;
1483
  }else if (openedcase){
1484
        fprintf (file, " :\n");
1485
      for (i = 0; i < openedkeys; i++)
1486
                fprintf (file, "   ");
1487
        fprintf(file,"begin\n");
1488
        openedcase=0;
1489
  }
1490
  //indent
1491
  if(newline){
1492
    for (i = 0; i < openedkeys; i++)
1493
          fprintf (file, "   ");
1494
        newline=0;
1495
  }
1496
  fprintf (file, " %s", (char *)$1);
1497
 }
1498 33 jcastillo
}
1499
 
1500
struct_dec:
1501
STRUCT OPENKEY
1502
{
1503
  struct_found=1;
1504
}
1505
 

powered by: WebSVN 2.1.0

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