My Project
0.0.16
QUCS Mapping
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
DownLoad
QUCS-src
qucs-0.0.16
qucs-core
src
converter
check_vcd.h
Go to the documentation of this file.
1
/*
2
* check_vcd.h - checker definitions for a vcd file
3
*
4
* Copyright (C) 2005 Raimund Jacob <raimi@lkcc.org>
5
* Copyright (C) 2005, 2006, 2008 Stefan Jahn <stefan@lkcc.org>
6
*
7
* This 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, or (at your option)
10
* any later version.
11
*
12
* This software 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 General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this package; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
20
* Boston, MA 02110-1301, USA.
21
*
22
* $Id: check_vcd.h 1825 2011-03-11 20:42:14Z ela $
23
*
24
*/
25
26
#ifndef __CHECK_VCD_H__
27
#define __CHECK_VCD_H__
28
29
/* Externalize variables used by the scanner and parser. */
30
extern
int
vcd_lineno
;
31
extern
FILE *
vcd_in
;
32
33
/* Useful defines. */
34
#define VCD_NOSCOPE "noscope"
35
#define VCD_FAST 1
36
37
__BEGIN_DECLS
38
39
/* Externalize variables used by the scanner, parser, checker and producer. */
40
extern
struct
vcd_file
*
vcd
;
41
extern
struct
dataset_variable
*
dataset_root
;
42
extern
int
vcd_correct
;
43
44
/* Available functions of the checker. */
45
int
vcd_checker
(
void
);
46
int
vcd_parse
(
void
);
47
int
vcd_error
(
char
*);
48
int
vcd_lex
(
void
);
49
int
vcd_lex_destroy
(
void
);
50
void
vcd_destroy
(
void
);
51
void
vcd_init
(
void
);
52
53
__END_DECLS
54
55
/* Declaration of VCD data structures. */
56
57
// Types of VCD variables.
58
enum
vcd_vartypes
{
59
VAR_EVENT
,
60
VAR_INTEGER
,
61
VAR_PARAMETER
,
62
VAR_REAL
,
63
VAR_REG
,
64
VAR_SUPPLY0
,
65
VAR_SUPPLY1
,
66
VAR_TIME
,
67
VAR_TRI
,
68
VAR_TRIAND
,
69
VAR_TRIOR
,
70
VAR_TRIREG
,
71
VAR_TRI0
,
72
VAR_TRI1
,
73
VAR_WAND
,
74
VAR_WIRE
,
75
VAR_WOR
76
};
77
78
// Range definition.
79
struct
vcd_range
{
80
int
l
;
81
int
h
;
82
};
83
84
// Variable definition.
85
struct
vcd_vardef
{
86
enum
vcd_vartypes
type
;
// type
87
int
size
;
// size in bits
88
char
*
code
;
// identifier code, used to reference 'ident'
89
char
*
ident
;
// variable identifier
90
struct
vcd_range
*
range
;
// range, e.g. [0] or [3:15]
91
struct
vcd_scope
*
scope
;
// scope of variable
92
struct
vcd_vardef
*
next
;
93
};
94
95
// Types of VCD scopes.
96
enum
vcd_scopes
{
97
SCOPE_MODULE
,
98
SCOPE_TASK
,
99
SCOPE_FUNCTION
,
100
SCOPE_BEGIN
,
101
SCOPE_FORK
102
};
103
104
// Scope definition.
105
struct
vcd_scope
{
106
enum
vcd_scopes
type
;
// type
107
char
*
ident
;
// scope identifier
108
struct
vcd_vardef
*
vardefs
;
// variable definitions
109
struct
vcd_scope
*
scopes
;
// sub-scopes
110
struct
vcd_scope
*
parent
;
// parent scope
111
struct
vcd_scope
*
next
;
112
};
113
114
// Value change definition.
115
struct
vcd_change
{
116
char
*
value
;
// the value
117
char
*
code
;
// identifier code, references 'var'
118
int
isreal
;
// indicates type of value
119
struct
vcd_vardef
*
var
;
// pointer to variable
120
struct
vcd_change
*
next
;
121
};
122
123
// A full set of VCD value changes.
124
struct
vcd_changeset
{
125
double
t
;
// time stamp
126
struct
vcd_change
*
changes
;
// list of VCD changes
127
#ifndef VCD_FAST
128
int
done;
// flag for the checker
129
#endif
130
struct
vcd_changeset
*
next
;
131
};
132
133
// Representation of a VCD file.
134
struct
vcd_file
{
135
int
t
;
// time scale (1, 10 or 100)
136
double
scale
;
// time unit factor
137
struct
vcd_scope
*
scopes
;
// scopes
138
struct
vcd_scope
*
currentscope
;
// the current scope
139
struct
vcd_changeset
*
changesets
;
// change sets
140
};
141
142
/* Checker specific data structures. */
143
144
// A VCD variable.
145
struct
vcd_variable
{
146
char
*
code
;
// identifier code, references 'var'
147
char
*
ident
;
// variable identifer
148
char
*
value
;
// the value
149
int
isreal
;
// indicates type of value
150
int
type
;
// variable type
151
struct
vcd_variable
*
next
;
152
};
153
154
// A VCD change set.
155
struct
vcd_set
{
156
double
t
;
// time stamp
157
struct
vcd_variable
*
variables
;
// list of VCD variables
158
struct
vcd_set
*
next
;
159
};
160
161
/* Qucs dataset specific data structures. */
162
163
// Dataset value structure.
164
struct
dataset_value
{
165
char
*
value
;
// the value
166
struct
dataset_value
*
next
;
167
};
168
169
// Types of dataset variables.
170
enum
dataset_vartypes
{
171
DATA_UNKNOWN
,
172
DATA_DEPENDENT
,
173
DATA_INDEPENDENT
174
};
175
176
// The dataset vector representation.
177
struct
dataset_variable
{
178
enum
dataset_vartypes
type
;
// type of variable
179
int
output
;
// should it be exported?
180
int
size
;
// length of the vector
181
char
*
ident
;
// variable identifier
182
char
*
dependencies
;
// variable dependencies (if dependent)
183
int
isreal
;
// indicates type of values
184
struct
dataset_value
*
values
;
// list of values
185
struct
dataset_variable
*
next
;
186
};
187
188
#endif
/* __CHECK_VCD_H__ */
Generated on Tue Dec 25 2012 14:30:32 for My Project by
1.8.2