From 79b740284aaa459f3bf77008f19e106e6ea0c80b Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 1 Jul 2001 00:27:34 +0000 Subject: [PATCH] Make NetFF constructor take const char* for the name. --- netlist.cc | 25 +++++++++++++++++++++++-- netlist.h | 9 +++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/netlist.cc b/netlist.cc index 2ab20d9fa..8c4bc9d49 100644 --- a/netlist.cc +++ b/netlist.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.cc,v 1.163 2001/06/16 23:45:05 steve Exp $" +#ident "$Id: netlist.cc,v 1.164 2001/07/01 00:27:34 steve Exp $" #endif # include @@ -185,6 +185,19 @@ NetObj::NetObj(NetScope*s, const string&n, unsigned np) } } +NetObj::NetObj(NetScope*s, const char*n, unsigned np) +: scope_(s), npins_(np), delay1_(0), delay2_(0), delay3_(0) +{ + name_ = new char[strlen(n)+1]; + strcpy(name_, n); + + pins_ = new Link[npins_]; + for (unsigned idx = 0 ; idx < npins_ ; idx += 1) { + pins_[idx].node_ = this; + pins_[idx].pin_ = idx; + } +} + NetObj::~NetObj() { delete[]name_; @@ -259,6 +272,11 @@ NetNode::NetNode(NetScope*s, const string&n, unsigned npins) { } +NetNode::NetNode(NetScope*s, const char*n, unsigned npins) +: NetObj(s, n, npins), node_next_(0), node_prev_(0), design_(0) +{ +} + NetNode::~NetNode() { if (design_) @@ -492,7 +510,7 @@ const NetScope* NetProcTop::scope() const * ... */ -NetFF::NetFF(NetScope*s, const string&n, unsigned wid) +NetFF::NetFF(NetScope*s, const char*n, unsigned wid) : NetNode(s, n, 8 + 2*wid) { pin_Clock().set_dir(Link::INPUT); @@ -2323,6 +2341,9 @@ const NetProc*NetTaskDef::proc() const /* * $Log: netlist.cc,v $ + * Revision 1.164 2001/07/01 00:27:34 steve + * Make NetFF constructor take const char* for the name. + * * Revision 1.163 2001/06/16 23:45:05 steve * Add support for structural multiply in t-dll. * Add code generators and vvp support for both diff --git a/netlist.h b/netlist.h index cd68754d6..09e689c69 100644 --- a/netlist.h +++ b/netlist.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: netlist.h,v 1.209 2001/06/16 23:45:05 steve Exp $" +#ident "$Id: netlist.h,v 1.210 2001/07/01 00:27:34 steve Exp $" #endif /* @@ -81,6 +81,7 @@ class NetObj { public: explicit NetObj(const string&n, unsigned npins); explicit NetObj(NetScope*s, const string&n, unsigned npins); + explicit NetObj(NetScope*s, const char*n, unsigned npins); virtual ~NetObj(); NetScope* scope(); @@ -281,6 +282,7 @@ class NetNode : public NetObj { public: explicit NetNode(NetScope*s, const string&n, unsigned npins); + explicit NetNode(NetScope*s, const char*n, unsigned npins); explicit NetNode(const string&n, unsigned npins); virtual ~NetNode(); @@ -590,7 +592,7 @@ class NetModulo : public NetNode { class NetFF : public NetNode { public: - NetFF(NetScope*s, const string&n, unsigned width); + NetFF(NetScope*s, const char*n, unsigned width); ~NetFF(); unsigned width() const; @@ -2809,6 +2811,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.210 2001/07/01 00:27:34 steve + * Make NetFF constructor take const char* for the name. + * * Revision 1.209 2001/06/16 23:45:05 steve * Add support for structural multiply in t-dll. * Add code generators and vvp support for both