Logic gates can take part select inputs
[iverilog.git] / compiler.h
blob6a1cb9f021df5f491ec38429b682f5d478da0ed9
1 #ifndef __compiler_H
2 #define __compiler_H
3 /*
4 * Copyright (c) 1999-2004 Stephen Williams (steve@icarus.com)
6 * This source code is free software; you can redistribute it
7 * and/or modify it in source code form under the terms of the GNU
8 * General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
10 * any later version.
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 General Public License for more details.
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
21 #ifdef HAVE_CVS_IDENT
22 #ident "$Id: compiler.h,v 1.33 2007/04/19 02:52:53 steve Exp $"
23 #endif
25 # include <list>
26 # include <map>
27 # include "netlist.h"
28 # include "StringHeap.h"
31 * This defines constants and defaults for the compiler in general.
35 /* The integer_width is the width of integer variables. */
36 extern unsigned integer_width;
38 /* The TIME_WIDTH is the width of time variables. */
39 #ifndef TIME_WIDTH
40 # define TIME_WIDTH 64
41 #endif
44 * When doing dynamic linking, we need a uniform way to identify the
45 * symbol. Some compilers put leading _, some trailing _. The
46 * configure script figures out which is the local convention and
47 * defines NEED_LU and NEED_TU as required.
49 #ifdef NEED_LU
50 #define LU "_"
51 #else
52 #define LU ""
53 #endif
55 #ifdef NEED_TU
56 #define TU "_"
57 #else
58 #define TU ""
59 #endif
63 * These are flags to enable various sorts of warnings. By default all
64 * the warnings are off, the -W<list> parameter arranges for each to be
65 * enabled.
68 /* Implicit definitions of wires. */
69 extern bool warn_implicit;
70 extern bool error_implicit;
72 /* inherit timescales across files. */
73 extern bool warn_timescale;
75 /* Warn about legal but questionable module port bindings. */
76 extern bool warn_portbinding;
78 /* This is true if verbose output is requested. */
79 extern bool verbose_flag;
81 extern bool debug_scopes;
82 extern bool debug_eval_tree;
83 extern bool debug_elaborate;
84 extern bool debug_synth2;
86 /* Path to a directory useful for finding subcomponents. */
87 extern const char*basedir;
89 /* This is an ordered list of library suffixes to search. */
90 extern list<const char*>library_suff;
91 extern int build_library_index(const char*path, bool key_case_sensitive);
93 /* This is the generation of Verilog that the compiler is asked to
94 support. Then there are also more detailed controls for more
95 specific language features. */
96 enum generation_t {
97 GN_VER1995 = 1,
98 GN_VER2001 = 2,
99 GN_VER2001X = 3,
100 GN_DEFAULT = 3
103 extern generation_t generation_flag;
105 extern bool gn_cadence_types_flag;
107 /* These functions test that specific features are enabled. */
108 inline bool gn_cadence_types_enabled()
109 { return gn_cadence_types_flag && generation_flag==GN_VER2001X; }
111 /* If this flag is true, then elaborate specify blocks. If this flag
112 is false, then skip elaboration of specify behavior. */
113 extern bool gn_specify_blocks_flag;
115 /* This is the string to use to invoke the preprocessor. */
116 extern char*ivlpp_string;
118 extern map<perm_string,unsigned> missing_modules;
120 /* Files that are library files are in this map. The lexor compares
121 file names as it processes `line directives, and if the file name
122 matches an entry in this table, it will turn on the
123 library_active_flag so that modules know that they are in a
124 library. */
125 extern map<string,bool> library_file_map;
128 * the lex_strings are perm_strings made up of tokens from the source
129 * file. Identifiers are so likely to be used many times that it makes
130 * much sense to use a StringHeapLex to hold them.
132 extern StringHeapLex lex_strings;
133 extern StringHeap misc_strings;
136 * system task/function listings.
139 * This table describes all the return values of various system
140 * functions. This table is used to elaborate expressions that are
141 * system function calls.
143 struct sfunc_return_type {
144 const char* name;
145 ivl_variable_type_t type;
146 unsigned wid;
147 int signed_flag;
150 extern const struct sfunc_return_type* lookup_sys_func(const char*name);
151 extern int load_sys_func_table(const char*path);
154 * $Log: compiler.h,v $
155 * Revision 1.33 2007/04/19 02:52:53 steve
156 * Add support for -v flag in command file.
158 * Revision 1.32 2007/03/07 04:24:59 steve
159 * Make integer width controllable.
161 * Revision 1.31 2006/09/28 04:35:18 steve
162 * Support selective control of specify and xtypes features.
164 * Revision 1.30 2005/07/11 16:56:50 steve
165 * Remove NetVariable and ivl_variable_t structures.
167 * Revision 1.29 2005/07/07 16:22:49 steve
168 * Generalize signals to carry types.
170 * Revision 1.28 2005/06/28 04:25:55 steve
171 * Remove reference to SystemVerilog.
173 * Revision 1.27 2005/04/24 23:44:01 steve
174 * Update DFF support to new data flow.
176 * Revision 1.26 2004/10/04 01:10:52 steve
177 * Clean up spurious trailing white space.
179 * Revision 1.25 2004/09/25 01:58:44 steve
180 * Add a debug_elaborate flag
182 * Revision 1.24 2004/09/10 23:51:42 steve
183 * Fix the evaluation of constant ternary expressions.
185 * Revision 1.23 2004/09/05 17:44:41 steve
186 * Add support for module instance arrays.
188 * Revision 1.22 2004/03/10 04:51:24 steve
189 * Add support for system function table files.
191 * Revision 1.21 2004/03/09 04:29:42 steve
192 * Separate out the lookup_sys_func table, for eventual
193 * support for function type tables.
195 * Remove ipal compile flags.
197 * Revision 1.20 2004/02/18 17:11:54 steve
198 * Use perm_strings for named langiage items.
200 * Revision 1.19 2003/11/13 05:55:33 steve
201 * Move the DLL= flag to target config files.
203 * Revision 1.18 2003/11/08 20:06:21 steve
204 * Spelling fixes in comments.
206 * Revision 1.17 2003/09/25 00:25:14 steve
207 * Summary list of missing modules.
209 * Revision 1.16 2003/03/01 06:25:30 steve
210 * Add the lex_strings string handler, and put
211 * scope names and system task/function names
212 * into this table. Also, permallocate event
213 * names from the beginning.
215 #endif