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

Subversion Repositories sc2v

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

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
 * -----------------------------------------------------------------------------
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
#include "sglib.h"
23
 
24
#define MAX_NAME_LENGTH 256
25
 
26
typedef struct _DefineNode
27
{
28
  char name[MAX_NAME_LENGTH];
29
  struct _DefineNode *next;
30
} DefineNode;
31
 
32
typedef struct _RegNode
33
{
34
  char name[MAX_NAME_LENGTH];
35
  char name2[MAX_NAME_LENGTH];
36
  struct _RegNode *next;
37
} RegNode;
38
 
39 33 jcastillo
/*Each struct has a name and a list of the registers declared inside it*/
40
typedef struct _StructRegNode
41
{
42
  char name[MAX_NAME_LENGTH];
43
  int length;
44
  struct _StructRegNode *next;
45
} StructRegNode;
46
 
47
typedef struct _StructNode
48
{
49
  char name[MAX_NAME_LENGTH];
50
  StructRegNode *list;
51
  struct _StructNode *next;
52
} StructNode;
53
 
54 14 jcastillo
/* Global var to store Regs */
55
  RegNode *regslist;
56
/* Global var to store Defines */
57
  DefineNode *defineslist;
58 33 jcastillo
/*Global var to store Structs */
59
  StructNode *structslist;
60
  StructRegNode *structsreglist;
61 14 jcastillo
 
62
/* Functions for defines list*/
63
DefineNode *InsertDefine(DefineNode *list,char *name);
64
int IsDefine(DefineNode *list,char *name);
65
 
66
/* Functions for registers list*/
67
RegNode *InsertReg(RegNode *list, char *name, char *name2);
68
char *IsReg (RegNode *list,char *name);
69
 
70 33 jcastillo
/* Functions for structs list*/
71
StructNode *InsertStruct(StructNode *list, char *name, StructRegNode *reglist);
72
StructRegNode *InsertStructReg(StructRegNode *list, char *name, int length);
73
void ShowStructs (StructNode * list);
74
 
75 14 jcastillo
 
76 33 jcastillo
 

powered by: WebSVN 2.1.0

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