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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step2.h] - Blame information for rev 20

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 14 jcastillo
 *  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 "sglib.h"
25
 
26
#define MAX_NAME_LENGTH 256
27
 
28
typedef struct _write_node
29
{
30
  char name[MAX_NAME_LENGTH];
31
  struct _write_node *next;
32
} WriteNode;
33
 
34
typedef struct _port_node
35
{
36
  char name[MAX_NAME_LENGTH];
37
  char tipo[MAX_NAME_LENGTH];
38
  int size;
39
  struct _port_node *next;
40
} PortNode;
41
 
42
typedef struct _signal_node
43
{
44
  char name[MAX_NAME_LENGTH];
45
  int size;
46 20 jcastillo
  int arraysize;
47 14 jcastillo
  struct _signal_node *next;
48
} SignalNode;
49
 
50
typedef struct _bind_node
51
{
52
  char nameport[MAX_NAME_LENGTH];
53
  char namebind[MAX_NAME_LENGTH];
54
  struct _bind_node *next;
55
} BindNode;
56
 
57
typedef struct _instance_node
58
{
59
  char nameinstance[MAX_NAME_LENGTH];
60
  char namemodulo[MAX_NAME_LENGTH];
61
  BindNode *bindslist;
62
  struct _instance_node *next;
63
} InstanceNode;
64
 
65 16 jcastillo
typedef struct _funcinput_node
66
{
67
  int lenght;
68
  char name[MAX_NAME_LENGTH];
69
  struct _funcinput_node *next;
70
} FunctionInputNode;
71
 
72
 
73
typedef struct _function_node
74
{
75
  char name[MAX_NAME_LENGTH];
76
  int outputlenght;
77
  FunctionInputNode *list;
78
  struct _function_node *next;
79
} FunctionNode;
80
 
81 14 jcastillo
typedef struct _sensibility_node
82
{
83
  char tipo[MAX_NAME_LENGTH];
84
  char name[MAX_NAME_LENGTH];
85
  struct _sensibility_node *next;
86
} SensibilityNode;
87
 
88
 
89
typedef struct _process_node
90
{
91
  char name[MAX_NAME_LENGTH];
92
  char tipo[MAX_NAME_LENGTH];                   //comb or seq
93
  SensibilityNode *list;
94
  struct _process_node *next;
95
} ProcessNode;
96
 
97
typedef struct _enumerates_node
98
{
99
  char name[MAX_NAME_LENGTH];
100
  struct _enumerates_node *next;
101
} EnumeratesNode;
102
 
103
typedef struct _enumlist_node
104
{
105
  char name[MAX_NAME_LENGTH];
106
  int istype;
107
  EnumeratesNode *list;
108
  struct _enumlist_node *next;
109
} EnumListNode;
110
 
111
 
112
/*Global var to read from file_writes.sc2v*/
113
  WriteNode *writeslist;
114
/*Global var to store ports*/
115
  PortNode *portlist;
116
/* Global var to store signals*/
117
  SignalNode *signalslist;
118
/* Global var to store sensitivity list*/
119
  SensibilityNode *sensibilitylist;
120
/* Global var to store process list*/
121
  ProcessNode *processlist;
122
/* Global var to store instantiated modules*/
123
  InstanceNode *instanceslist;
124
/*List of enumerates*/
125
  EnumeratesNode *enumerateslist;
126
  EnumListNode *enumlistlist;
127 16 jcastillo
/* Global var to store functions inputs list*/
128
  FunctionInputNode *funcinputslist;
129
/* Global var to store process list*/
130
  FunctionNode *functionslist;
131 14 jcastillo
 
132 16 jcastillo
 
133
 
134 14 jcastillo
/* Functions for DEFINES list*/
135
void ShowDefines (char *filedefines);
136
 
137
/* Functions for WRITES list*/
138
WriteNode *InsertWrite (WriteNode *list,char *name);
139
int IsWrite (WriteNode *list,char *name);
140
WriteNode *ReadWritesFile (WriteNode *list,char *name);
141
 
142
/* Functions for ports list*/
143
PortNode *InsertPort (PortNode *list,char *name, char *tipo, int size);
144
void ShowPortList (PortNode *list);
145
void EnumeratePorts (PortNode *list);
146
 
147
/* Functions for signals list*/
148 20 jcastillo
SignalNode *InsertSignal (SignalNode *list,char *name, int size,int arraysize);
149 15 jcastillo
void ShowSignalsList (SignalNode* list, WriteNode* writeslist);
150 14 jcastillo
int IsWire (char *name, InstanceNode * list);
151
 
152
/* Functions for sensitivity list*/
153
SensibilityNode *InsertSensibility (SensibilityNode * list, char *name, char *tipo);
154
void ShowSensibilityList (SensibilityNode * list);
155
 
156
/* Functions for process list*/
157
ProcessNode *InsertProcess (ProcessNode * list, char *name,SensibilityNode *SensibilityList, char *tipo);
158
void ShowProcessList (ProcessNode *list);
159
void ShowProcessCode (ProcessNode *list);
160
 
161
/* Functions for instances and binds list*/
162
InstanceNode *InsertInstance (InstanceNode *list, char *nameInstance,char *namemodulo);
163
BindNode *InsertBind (BindNode *list, char *namePort, char *namebind);
164
void ShowInstancedModules (InstanceNode * list);
165
 
166
/* Functions for enumerates list*/
167
EnumeratesNode *InsertEnumerates (EnumeratesNode * list, char *name);
168
int ShowEnumeratesList (EnumeratesNode * list);
169
 
170
/*Functions of list of enumerates list*/
171
EnumListNode *InsertEnumList (EnumListNode * list, EnumeratesNode * enumlist,char *name, int istype);
172
void ShowEnumListList (EnumListNode * list);
173
int findEnumList (EnumListNode * list, char *name);
174
int findEnumerateLength (EnumListNode * list, int offset);
175 16 jcastillo
 
176
/* Functions for functions inputs list*/
177
FunctionInputNode *InsertFunctionInput (FunctionInputNode * list, char *name, int lenght);
178
void ShowFunctionInputs (FunctionInputNode * list);
179
 
180
/* Functions for functions list*/
181
FunctionNode *InsertFunction (FunctionNode *list, char *name,FunctionInputNode *InputsList,int outputlenght);
182
void ShowFunctionCode (FunctionNode *list);

powered by: WebSVN 2.1.0

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