Module types in pform are char* instead of string.
This commit is contained in:
parent
56954356db
commit
9f3e64e11a
22
PGate.cc
22
PGate.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: PGate.cc,v 1.11 2001/10/19 01:55:32 steve Exp $"
|
#ident "$Id: PGate.cc,v 1.12 2001/10/21 00:42:47 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -142,17 +142,24 @@ void PGBuiltin::set_range(PExpr*msb, PExpr*lsb)
|
||||||
lsb_ = lsb;
|
lsb_ = lsb;
|
||||||
}
|
}
|
||||||
|
|
||||||
PGModule::PGModule(const string&type, const string&name, svector<PExpr*>*pins)
|
PGModule::PGModule(const char*type, const string&name, svector<PExpr*>*pins)
|
||||||
: PGate(name, pins), type_(type), overrides_(0), pins_(0),
|
: PGate(name, pins), overrides_(0), pins_(0),
|
||||||
npins_(0), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
npins_(0), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
||||||
{
|
{
|
||||||
|
type_ = strdup(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
PGModule::PGModule(const string&type, const string&name,
|
PGModule::PGModule(const char*type, const string&name,
|
||||||
named<PExpr*>*pins, unsigned npins)
|
named<PExpr*>*pins, unsigned npins)
|
||||||
: PGate(name, 0), type_(type), overrides_(0), pins_(pins),
|
: PGate(name, 0), overrides_(0), pins_(pins),
|
||||||
npins_(npins), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
npins_(npins), parms_(0), nparms_(0), msb_(0), lsb_(0)
|
||||||
{
|
{
|
||||||
|
type_ = strdup(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
PGModule::~PGModule()
|
||||||
|
{
|
||||||
|
free(type_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PGModule::set_parameters(svector<PExpr*>*o)
|
void PGModule::set_parameters(svector<PExpr*>*o)
|
||||||
|
|
@ -178,13 +185,16 @@ void PGModule::set_range(PExpr*msb, PExpr*lsb)
|
||||||
lsb_ = lsb;
|
lsb_ = lsb;
|
||||||
}
|
}
|
||||||
|
|
||||||
const string PGModule::get_type()
|
const char* PGModule::get_type()
|
||||||
{
|
{
|
||||||
return type_;
|
return type_;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: PGate.cc,v $
|
* $Log: PGate.cc,v $
|
||||||
|
* Revision 1.12 2001/10/21 00:42:47 steve
|
||||||
|
* Module types in pform are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.11 2001/10/19 01:55:32 steve
|
* Revision 1.11 2001/10/19 01:55:32 steve
|
||||||
* Method to get the type_ member
|
* Method to get the type_ member
|
||||||
*
|
*
|
||||||
|
|
|
||||||
15
PGate.h
15
PGate.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: PGate.h,v 1.20 2001/10/19 01:55:32 steve Exp $"
|
#ident "$Id: PGate.h,v 1.21 2001/10/21 00:42:47 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "svector.h"
|
# include "svector.h"
|
||||||
|
|
@ -173,15 +173,17 @@ class PGModule : public PGate {
|
||||||
public:
|
public:
|
||||||
// If the binding of ports is by position, this constructor
|
// If the binding of ports is by position, this constructor
|
||||||
// builds everything all at once.
|
// builds everything all at once.
|
||||||
explicit PGModule(const string&type, const string&name,
|
explicit PGModule(const char*type, const string&name,
|
||||||
svector<PExpr*>*pins);
|
svector<PExpr*>*pins);
|
||||||
|
|
||||||
// If the binding of ports is by name, this constructor takes
|
// If the binding of ports is by name, this constructor takes
|
||||||
// the bindings and stores them for later elaboration.
|
// the bindings and stores them for later elaboration.
|
||||||
explicit PGModule(const string&type, const string&name,
|
explicit PGModule(const char*type, const string&name,
|
||||||
named<PExpr*>*pins, unsigned npins);
|
named<PExpr*>*pins, unsigned npins);
|
||||||
|
|
||||||
|
|
||||||
|
~PGModule();
|
||||||
|
|
||||||
// Parameter overrides can come as an ordered list, or a set
|
// Parameter overrides can come as an ordered list, or a set
|
||||||
// of named expressions.
|
// of named expressions.
|
||||||
void set_parameters(svector<PExpr*>*o);
|
void set_parameters(svector<PExpr*>*o);
|
||||||
|
|
@ -196,10 +198,10 @@ class PGModule : public PGate {
|
||||||
virtual void elaborate_scope(Design*des, NetScope*sc) const;
|
virtual void elaborate_scope(Design*des, NetScope*sc) const;
|
||||||
virtual bool elaborate_sig(Design*des, NetScope*scope) const;
|
virtual bool elaborate_sig(Design*des, NetScope*scope) const;
|
||||||
|
|
||||||
const string get_type();
|
const char* get_type();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string type_;
|
char* type_;
|
||||||
svector<PExpr*>*overrides_;
|
svector<PExpr*>*overrides_;
|
||||||
named<PExpr*>*pins_;
|
named<PExpr*>*pins_;
|
||||||
unsigned npins_;
|
unsigned npins_;
|
||||||
|
|
@ -220,6 +222,9 @@ class PGModule : public PGate {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: PGate.h,v $
|
* $Log: PGate.h,v $
|
||||||
|
* Revision 1.21 2001/10/21 00:42:47 steve
|
||||||
|
* Module types in pform are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.20 2001/10/19 01:55:32 steve
|
* Revision 1.20 2001/10/19 01:55:32 steve
|
||||||
* Method to get the type_ member
|
* Method to get the type_ member
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: elaborate.cc,v 1.223 2001/10/20 23:02:40 steve Exp $"
|
#ident "$Id: elaborate.cc,v 1.224 2001/10/21 00:42:47 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -745,7 +745,7 @@ void PGModule::elaborate_scope(Design*des, NetScope*sc) const
|
||||||
// Not a module or primitive that I know about yet, so try to
|
// Not a module or primitive that I know about yet, so try to
|
||||||
// load a library module file (which parses some new Verilog
|
// load a library module file (which parses some new Verilog
|
||||||
// code) and try again.
|
// code) and try again.
|
||||||
if (load_module(type_.c_str())) {
|
if (load_module(type_)) {
|
||||||
|
|
||||||
// Try again to find the module type
|
// Try again to find the module type
|
||||||
mod = pform_modules.find(type_);
|
mod = pform_modules.find(type_);
|
||||||
|
|
@ -2382,6 +2382,9 @@ Design* elaborate(list<const char*>roots)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: elaborate.cc,v $
|
* $Log: elaborate.cc,v $
|
||||||
|
* Revision 1.224 2001/10/21 00:42:47 steve
|
||||||
|
* Module types in pform are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.223 2001/10/20 23:02:40 steve
|
* Revision 1.223 2001/10/20 23:02:40 steve
|
||||||
* Add automatic module libraries.
|
* Add automatic module libraries.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
11
pform.cc
11
pform.cc
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: pform.cc,v 1.80 2001/10/20 23:02:40 steve Exp $"
|
#ident "$Id: pform.cc,v 1.81 2001/10/21 00:42:48 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -439,7 +439,7 @@ void pform_makegates(PGBuiltin::Type type,
|
||||||
* functions handle the instantaions of modules (and UDP objects) by
|
* functions handle the instantaions of modules (and UDP objects) by
|
||||||
* making PGModule objects.
|
* making PGModule objects.
|
||||||
*/
|
*/
|
||||||
static void pform_make_modgate(const string&type,
|
static void pform_make_modgate(const char*type,
|
||||||
const string&name,
|
const string&name,
|
||||||
struct parmvalue_t*overrides,
|
struct parmvalue_t*overrides,
|
||||||
svector<PExpr*>*wires,
|
svector<PExpr*>*wires,
|
||||||
|
|
@ -470,7 +470,7 @@ static void pform_make_modgate(const string&type,
|
||||||
pform_cur_module->add_gate(cur);
|
pform_cur_module->add_gate(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pform_make_modgate(const string&type,
|
static void pform_make_modgate(const char*type,
|
||||||
const string&name,
|
const string&name,
|
||||||
struct parmvalue_t*overrides,
|
struct parmvalue_t*overrides,
|
||||||
svector<portname_t*>*bind,
|
svector<portname_t*>*bind,
|
||||||
|
|
@ -510,7 +510,7 @@ static void pform_make_modgate(const string&type,
|
||||||
pform_cur_module->add_gate(cur);
|
pform_cur_module->add_gate(cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pform_make_modgates(const string&type,
|
void pform_make_modgates(const char*type,
|
||||||
struct parmvalue_t*overrides,
|
struct parmvalue_t*overrides,
|
||||||
svector<lgate>*gates)
|
svector<lgate>*gates)
|
||||||
{
|
{
|
||||||
|
|
@ -1030,6 +1030,9 @@ int pform_parse(const char*path, FILE*file)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.cc,v $
|
* $Log: pform.cc,v $
|
||||||
|
* Revision 1.81 2001/10/21 00:42:48 steve
|
||||||
|
* Module types in pform are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.80 2001/10/20 23:02:40 steve
|
* Revision 1.80 2001/10/20 23:02:40 steve
|
||||||
* Add automatic module libraries.
|
* Add automatic module libraries.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
7
pform.h
7
pform.h
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT) && !defined(macintosh)
|
#if !defined(WINNT) && !defined(macintosh)
|
||||||
#ident "$Id: pform.h,v 1.47 2001/10/20 23:02:40 steve Exp $"
|
#ident "$Id: pform.h,v 1.48 2001/10/21 00:42:48 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "netlist.h"
|
# include "netlist.h"
|
||||||
|
|
@ -168,7 +168,7 @@ extern void pform_makegates(PGBuiltin::Type type,
|
||||||
svector<PExpr*>*delay,
|
svector<PExpr*>*delay,
|
||||||
svector<lgate>*gates);
|
svector<lgate>*gates);
|
||||||
|
|
||||||
extern void pform_make_modgates(const string&type,
|
extern void pform_make_modgates(const char*type,
|
||||||
struct parmvalue_t*overrides,
|
struct parmvalue_t*overrides,
|
||||||
svector<lgate>*gates);
|
svector<lgate>*gates);
|
||||||
|
|
||||||
|
|
@ -200,6 +200,9 @@ extern void pform_dump(ostream&out, Module*mod);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.h,v $
|
* $Log: pform.h,v $
|
||||||
|
* Revision 1.48 2001/10/21 00:42:48 steve
|
||||||
|
* Module types in pform are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.47 2001/10/20 23:02:40 steve
|
* Revision 1.47 2001/10/20 23:02:40 steve
|
||||||
* Add automatic module libraries.
|
* Add automatic module libraries.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue