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

Subversion Repositories sc2v

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

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

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

powered by: WebSVN 2.1.0

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