Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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$
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 (const 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.
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 {
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.
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.
165  char * value; // the value
166  struct dataset_value * next;
167 };
168 
169 // Types of dataset variables.
174 };
175 
176 // The dataset vector representation.
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
186 };
187 
188 #endif /* __CHECK_VCD_H__ */
struct vcd_set * next
Definition: check_vcd.h:158
int isreal
Definition: check_vcd.h:118
int vcd_correct
Definition: check_vcd.cpp:52
dataset_vartypes
Definition: check_vcd.h:170
struct vcd_scope * scopes
Definition: check_vcd.h:137
struct vcd_change * next
Definition: check_vcd.h:120
struct vcd_scope * scopes
Definition: check_vcd.h:109
char * value
Definition: check_vcd.h:148
void vcd_init(void)
Definition: check_vcd.cpp:605
double t
Definition: check_vcd.h:156
char * code
Definition: check_vcd.h:88
__BEGIN_DECLS struct vcd_file * vcd
Definition: check_vcd.cpp:49
char * code
Definition: check_vcd.h:117
enum dataset_vartypes type
Definition: check_vcd.h:178
char * dependencies
Definition: check_vcd.h:182
struct dataset_value * next
Definition: check_vcd.h:166
char * code
Definition: check_vcd.h:146
double scale
Definition: check_vcd.h:136
char * value
Definition: check_vcd.h:165
struct vcd_range * range
Definition: check_vcd.h:90
struct vcd_changeset * changesets
Definition: check_vcd.h:139
struct vcd_variable * next
Definition: check_vcd.h:151
char * ident
Definition: check_vcd.h:107
int vcd_lineno
enum vcd_scopes type
Definition: check_vcd.h:106
struct dataset_value * values
Definition: check_vcd.h:184
enum vcd_vartypes type
Definition: check_vcd.h:86
struct dataset_variable * dataset_root
Definition: check_vcd.cpp:54
char * ident
Definition: check_vcd.h:147
struct dataset_variable * next
Definition: check_vcd.h:185
FILE * vcd_in
struct vcd_vardef * var
Definition: check_vcd.h:119
int vcd_error(const char *)
Definition: parse_vcd.y:344
struct vcd_variable * variables
Definition: check_vcd.h:157
int vcd_lex_destroy(void)
struct vcd_scope * next
Definition: check_vcd.h:111
struct vcd_scope * currentscope
Definition: check_vcd.h:138
struct vcd_scope * parent
Definition: check_vcd.h:110
struct vcd_changeset * next
Definition: check_vcd.h:130
struct vcd_scope * scope
Definition: check_vcd.h:91
char * value
Definition: check_vcd.h:116
vcd_vartypes
Definition: check_vcd.h:58
int vcd_parse(void)
void vcd_destroy(void)
Definition: check_vcd.cpp:594
int vcd_lex(void)
int size
Definition: check_vcd.h:87
struct vcd_vardef * vardefs
Definition: check_vcd.h:108
vcd_scopes
Definition: check_vcd.h:96
struct vcd_vardef * next
Definition: check_vcd.h:92
char * ident
Definition: check_vcd.h:89
int vcd_checker(void)
Definition: check_vcd.cpp:500
struct vcd_change * changes
Definition: check_vcd.h:126