From 9021f68996ed02f06674cdf5607018c38cb05ade Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 22 Jul 1999 02:05:20 +0000 Subject: [PATCH] is_constant method for PEConcat. --- PExpr.cc | 14 +++++++++++++- PExpr.h | 6 +++++- README.txt | 4 ++-- xnf.txt | 10 ++++++---- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/PExpr.cc b/PExpr.cc index 75d43382b..0862f14ec 100644 --- a/PExpr.cc +++ b/PExpr.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: PExpr.cc,v 1.6 1999/07/17 19:50:59 steve Exp $" +#ident "$Id: PExpr.cc,v 1.7 1999/07/22 02:05:20 steve Exp $" #endif # include "PExpr.h" @@ -43,6 +43,15 @@ bool PEBinary::is_constant(Module*mod) const return left_->is_constant(mod) && right_->is_constant(mod); } +bool PEConcat::is_constant(Module *mod) const +{ + bool constant = repeat_->is_constant(mod); + for (unsigned i = 0; constant && i < parms_.count(); ++i) { + constant = constant && parms_[i]->is_constant(mod); + } + return constant; +} + PEConcat::~PEConcat() { delete repeat_; @@ -93,6 +102,9 @@ bool PETernary::is_constant(Module*) const /* * $Log: PExpr.cc,v $ + * Revision 1.7 1999/07/22 02:05:20 steve + * is_constant method for PEConcat. + * * Revision 1.6 1999/07/17 19:50:59 steve * netlist support for ternary operator. * diff --git a/PExpr.h b/PExpr.h index 39b29e8cb..63ecaaaec 100644 --- a/PExpr.h +++ b/PExpr.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: PExpr.h,v 1.14 1999/07/17 19:50:59 steve Exp $" +#ident "$Id: PExpr.h,v 1.15 1999/07/22 02:05:20 steve Exp $" #endif # include @@ -79,6 +79,7 @@ class PEConcat : public PExpr { virtual void dump(ostream&) const; virtual NetNet* elaborate_net(Design*des, const string&path) const; virtual NetExpr*elaborate_expr(Design*des, const string&path) const; + virtual bool is_constant(Module*) const; private: svectorparms_; @@ -226,6 +227,9 @@ class PETernary : public PExpr { /* * $Log: PExpr.h,v $ + * Revision 1.15 1999/07/22 02:05:20 steve + * is_constant method for PEConcat. + * * Revision 1.14 1999/07/17 19:50:59 steve * netlist support for ternary operator. * diff --git a/README.txt b/README.txt index a5aed10bb..3c8782b7c 100644 --- a/README.txt +++ b/README.txt @@ -12,7 +12,7 @@ IVL is not aimed at being a simulator in the traditional sense, but a compiler that generates code employed by back-end tools. These back- end tools currently include a simulator written in C++ called VVM and an XNF (Xilinx Netlist Format) generator. See "vvm.txt" and -"xnf.txt" for further details on the back-end processors. +"xnf.txt" for further details on these back-end processors. 2.0 How IVL Works @@ -47,7 +47,7 @@ PFORM into the file named . This phase takes the pform and generates a netlist. The driver selects (by user request or lucky guess) the root module to elaborate, resolves references and expands the instantiations to form the design -netlist. +netlist. (See netlist.txt.) The elaborate() function performs the elaboration. diff --git a/xnf.txt b/xnf.txt index d1260711d..99fb6f0a6 100644 --- a/xnf.txt +++ b/xnf.txt @@ -18,10 +18,9 @@ programmer to use $attributes to control certain aspects of code generation. XNF code generation is enabled with the ``-t xnf'' flag on the command -line. The XNF code generator needs to know the type of part to -generate code for, so the ``-fpart='' flag is also needed. For -example, to generate code for the 4010E the command line might start -out as: +line. The code generator needs to know the type of part to generate +code for, so the ``-fpart='' flag is also needed. For example, +to generate code for the 4010E the command line might start out as: ivl -txnf -fpart=4010e -Fxnfsyn -Fxnfio [...] @@ -84,6 +83,9 @@ IBUF, NOT gates cannot be absorbed as in the OPAD case. $Log: xnf.txt,v $ + Revision 1.3 1999/07/22 02:05:20 steve + is_constant method for PEConcat. + Revision 1.2 1999/07/18 21:17:51 steve Add support for CE input to XNF DFF, and do complete cleanup of replaced design nodes.