Permalink
Browse files

Merge branch 'master' of github.com:steveicarus/iverilog

  • Loading branch information...
2 parents e5f8400 + 679ef3a commit 4b3ef8a314d20ec1648860c7478b40aefa3caa32 @steveicarus committed Dec 23, 2012
Showing 540 changed files with 17,313 additions and 6,200 deletions.
View
@@ -13,6 +13,7 @@ tags
TAGS
cscope.*
*.patch
+*.orig
# Object files and libraries
*.[oa]
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
View
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include <map>
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
View
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "StringHeap.h"
View
@@ -2,7 +2,8 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +306,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Also add information on how to contact you by electronic and paper mail.
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2010 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2001-2012 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
@@ -31,21 +31,19 @@ hname_t::hname_t()
}
hname_t::hname_t(perm_string text)
+: name_(text)
{
- name_ = text;
number_ = INT_MIN;
}
hname_t::hname_t(perm_string text, int num)
+: name_(text), number_(num)
{
- name_ = text;
- number_ = num;
}
hname_t::hname_t(const hname_t&that)
+: name_(that.name_), number_(that.number_)
{
- name_ = that.name_;
- number_ = that.number_;
}
hname_t& hname_t::operator = (const hname_t&that)
View
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include <iostream>
View
@@ -12,9 +12,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free
-# Software Foundation, Inc.,
-# 59 Temple Place - Suite 330
-# Boston, MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
#
SHELL = /bin/sh
@@ -87,14 +86,15 @@ GIT = @GIT@
ifeq (@srcdir@,.)
INCLUDE_PATH = -I. -Ilibmisc
else
-INCLUDE_PATH = -I. -Ilibmisc -I$(srcdir) -I$(srcdir)/libmisc
+INCLUDE_PATH = -I. -I$(srcdir) -I$(srcdir)/libmisc
endif
CPPFLAGS = @DEFS@ $(INCLUDE_PATH) @CPPFLAGS@
CFLAGS = @WARNING_FLAGS@ @CFLAGS@
CXXFLAGS = @WARNING_FLAGS@ @WARNING_FLAGS_CXX@ @CXXFLAGS@
PICFLAGS = @PICFLAG@
LDFLAGS = @rdynamic@ @LDFLAGS@
+CTARGETFLAGS = @CTARGETFLAGS@
# Source files in the libmisc directory
M = LineInfo.o StringHeap.o
@@ -104,17 +104,20 @@ FF = cprop.o nodangle.o synth.o synth2.o syn-rules.o
O = main.o async.o design_dump.o discipline.o dup_expr.o elaborate.o \
elab_expr.o elaborate_analog.o elab_lval.o elab_net.o \
- elab_scope.o elab_sig.o elab_sig_analog.o emit.o eval.o eval_attrib.o \
+ elab_scope.o elab_sig.o elab_sig_analog.o elab_type.o \
+ emit.o eval.o eval_attrib.o \
eval_tree.o expr_synth.o functor.o lexor.o lexor_keyword.o link_const.o \
- load_module.o netlist.o netmisc.o net_analog.o net_assign.o net_design.o \
- netenum.o netstruct.o net_event.o net_expr.o net_func.o net_link.o net_modulo.o \
+ load_module.o netlist.o netmisc.o nettypes.o net_analog.o net_assign.o \
+ net_design.o netclass.o netdarray.o \
+ netenum.o netparray.o netstruct.o netvector.o net_event.o net_expr.o net_func.o \
+ net_func_eval.o net_link.o net_modulo.o \
net_nex_input.o net_nex_output.o net_proc.o net_scope.o net_tran.o \
net_udp.o pad_to_width.o parse.o parse_misc.o pform.o pform_analog.o \
- pform_disciplines.o pform_dump.o pform_pclass.o pform_struct_type.o \
- pform_types.o \
+ pform_disciplines.o pform_dump.o pform_package.o pform_pclass.o \
+ pform_class_type.o pform_string_type.o pform_struct_type.o pform_types.o \
symbol_search.o sync.o sys_funcs.o verinum.o verireal.o target.o \
Attrib.o HName.o Module.o PClass.o PDelays.o PEvent.o PExpr.o PGate.o \
- PGenerate.o PScope.o PSpec.o PTask.o PUdp.o PFunction.o PWire.o \
+ PGenerate.o PPackage.o PScope.o PSpec.o PTask.o PUdp.o PFunction.o PWire.o \
Statement.o AStatement.o $M $(FF) $(TT)
all: dep config.h _pli_types.h version_tag.h ivl@EXEEXT@ version.exe iverilog-vpi.man
@@ -170,8 +173,8 @@ endif
rm -rf autom4te.cache
cppcheck: $(O:.o=.cc) $(srcdir)/dosify.c $(srcdir)/version.c
- cppcheck --enable=all -f --suppressions $(srcdir)/cppcheck.sup \
- $(INCLUDE_PATH) $^
+ cppcheck --enable=all -f --suppressions-list=$(srcdir)/cppcheck.sup \
+ --relative-paths=$(srcdir) $(INCLUDE_PATH) $^
cppcheck-all:
$(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) cppcheck && ) true
@@ -226,6 +229,7 @@ iverilog-vpi: $(srcdir)/iverilog-vpi.sh Makefile
-e 's;@IVCXX@;$(CXX);' \
-e 's;@IVCFLAGS@;$(CFLAGS);' \
-e 's;@IVCXXFLAGS@;$(CXXFLAGS);' \
+ -e 's;@IVCTARGETFLAGS@;$(CTARGETFLAGS);' \
-e 's;@INCLUDEDIR@;$(includedir);' \
-e 's;@LIBDIR@;@libdir@;' $< > $@
chmod +x $@
@@ -377,7 +381,7 @@ uninstall:
do rm -f "$(DESTDIR)$(bindir)/$$f"; done
for f in ivl_target.h vpi_user.h _pli_types.h sv_vpi_user.h acc_user.h veriuser.h; \
do rm -f "$(DESTDIR)$(includedir)/$$f"; done
- -test X$(suffix) = X || rmdir "$(DESTDIR)/$(includedir)"
+ -test X$(suffix) = X || rmdir "$(DESTDIR)$(includedir)"
rm -f "$(DESTDIR)$(mandir)/man1/iverilog-vpi$(suffix).1" "$(DESTDIR)$(prefix)/iverilog-vpi$(suffix).pdf"
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
@@ -27,11 +27,12 @@
list<Module::named_expr_t> Module::user_defparms;
/* n is a permallocated string. */
-Module::Module(perm_string n)
-: PScopeExtra(n)
+Module::Module(LexicalScope*parent, perm_string n)
+: PScopeExtra(n, parent)
{
library_flag = false;
is_cell = false;
+ program_block = false;
uc_drive = UCD_NONE;
timescale_warn_done = false;
time_unit = 0;
@@ -89,6 +90,22 @@ unsigned Module::find_port(const char*name) const
return ports.size();
}
+perm_string Module::get_port_name(unsigned idx) const
+{
+
+ assert(idx < ports.size());
+ if (ports[idx] == 0) {
+ /* It is possible to have undeclared ports. These
+ are ports that are skipped in the declaration,
+ for example like so: module foo(x ,, y); The
+ port between x and y is unnamed and thus
+ inaccessible to binding by name. */
+ return perm_string::literal("");
+ }
+ return ports[idx]->name;
+}
+
+
PGate* Module::get_gate(perm_string name)
{
View
@@ -1,7 +1,7 @@
#ifndef __Module_H
#define __Module_H
/*
- * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 1998-2010,2012 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@@ -65,7 +65,7 @@ class Module : public PScopeExtra, public LineInfo {
public:
/* The name passed here is the module name, not the instance
name. This make must be a permallocated string. */
- explicit Module(perm_string name);
+ explicit Module(LexicalScope*parent, perm_string name);
~Module();
/* Initially false. This is set to true if the module has been
@@ -76,13 +76,18 @@ class Module : public PScopeExtra, public LineInfo {
bool is_cell;
+ /* This is true if the module represents a program block
+ instead of a module/cell. Program blocks have content
+ restrictions and slightly modify scheduling semantics. */
+ bool program_block;
+
enum UCDriveType { UCD_NONE, UCD_PULL0, UCD_PULL1 };
UCDriveType uc_drive;
- /* specparams are simpler than other params, in that they have
- no type information. They are merely constant
- expressions. */
- map<perm_string,PExpr*>specparams;
+ /* specparams are simpler than other parameters, in that they
+ can have a range, but not an explicit type. The restrictions
+ are enforced by the parser. */
+ map<perm_string,param_expr_t>specparams;
/* The module also has defparam assignments which don't create
new parameters within the module, but may be used to set
@@ -116,6 +121,10 @@ class Module : public PScopeExtra, public LineInfo {
the module definition. These are used at elaboration time. */
list<PGenerate*> generate_schemes;
+ /* Nested modules are placed here, and are not elaborated
+ unless they are instantiated, implicitly or explicitly. */
+ std::map<perm_string,Module*> nested_modules;
+
list<PSpecPath*> specify_paths;
// The mod_name() is the name of the module type.
@@ -127,6 +136,9 @@ class Module : public PScopeExtra, public LineInfo {
const vector<PEIdent*>& get_port(unsigned idx) const;
unsigned find_port(const char*name) const;
+ // Return port name ("" for undeclared port)
+ perm_string get_port_name(unsigned idx) const;
+
PGate* get_gate(perm_string name);
const list<PGate*>& get_gates() const;
@@ -140,6 +152,7 @@ class Module : public PScopeExtra, public LineInfo {
bool elaborate_sig(Design*, NetScope*scope) const;
private:
+ void dump_specparams_(ostream&out, unsigned indent) const;
list<PGate*> gates_;
private: // Not implemented
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "PClass.h"
View
@@ -16,12 +16,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "PScope.h"
# include "LineInfo.h"
# include "StringHeap.h"
+# include <iostream>
/*
* SystemVerilog supports class declarations with their own lexical
@@ -35,6 +36,10 @@ class PClass : public PScopeExtra, public LineInfo {
explicit PClass (perm_string name, LexicalScope*parent);
~PClass();
+ void dump(std::ostream&out, unsigned indent) const;
+
+ public:
+ class_type_t*type;
};
#endif
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
View
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "svector.h"
View
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "config.h"
View
@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
# include "LineInfo.h"
Oops, something went wrong.

0 comments on commit 4b3ef8a

Please sign in to comment.