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

Subversion Repositories sc2v

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

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

powered by: WebSVN 2.1.0

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