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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step1.c] - Blame information for rev 31

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

Line No. Rev Author Line
1 14 jcastillo
/* -----------------------------------------------------------------------------
2
 *
3 16 jcastillo
 *  SystemC to Verilog Translator v0.4
4 31 jcastillo
 *  Provided by Universidad Rey Juan Carlos
5 14 jcastillo
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU Library General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston,MA 02111-1307, USA.
19
 */
20
 
21
#include <stdlib.h>
22
#include <stdio.h>
23
#include <math.h>
24
 
25
#include "sc2v_step1.h"
26
 
27
DefineNode *InsertDefine(DefineNode *list,char *name){
28
    DefineNode *dl;
29
 
30
        dl=(DefineNode *)malloc(sizeof(DefineNode));
31
        strcpy(dl->name,name);
32
        SGLIB_LIST_ADD(DefineNode,list,dl,next);
33
 
34
        return(list);
35
}
36
 
37
int IsDefine(DefineNode *list,char *name){
38
 
39
        DefineNode *dll;
40
        SGLIB_LIST_MAP_ON_ELEMENTS (DefineNode, list, dll, next,
41
         {
42
                 if ((strcmp (name, (char *)dll->name) == 0)) return(1);
43
     }
44
     );
45
         return(0);
46
}
47
 
48
 
49
RegNode *InsertReg(RegNode *list, char *name, char *name2){
50
 
51
        RegNode *rl;
52
 
53
        rl=(RegNode *)malloc(sizeof(RegNode));
54
        strcpy(rl->name,name);
55
        strcpy(rl->name2,name2);
56
        SGLIB_LIST_ADD(RegNode,list,rl,next);
57
        return(list);
58
 
59
}
60
 
61
 
62
/*Looks if a WORD of func.y file is a register of the process*/
63
char *
64
IsReg (RegNode *list, char *name)
65
{
66
 
67
  RegNode *rll;
68
  SGLIB_LIST_MAP_ON_ELEMENTS (RegNode, list, rll, next,
69
                              {
70
                                  if ((strcmp (name, (char *)rll->name) == 0))
71
                              {
72
                              return (rll->name2);}
73
                              }
74
  );
75
  return NULL;
76
}

powered by: WebSVN 2.1.0

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