Scope/module names are char* instead of string.
This commit is contained in:
parent
acf3a4ec16
commit
7a149a6943
14
Module.cc
14
Module.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: Module.cc,v 1.15 2001/07/25 03:10:48 steve Exp $"
|
#ident "$Id: Module.cc,v 1.16 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -27,14 +27,19 @@
|
||||||
# include "PWire.h"
|
# include "PWire.h"
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
|
|
||||||
Module::Module(const string&name, const svector<Module::port_t*>*pp)
|
Module::Module(const char*name, const svector<Module::port_t*>*pp)
|
||||||
: name_(name)
|
: name_(strdup(name))
|
||||||
{
|
{
|
||||||
if (pp)
|
if (pp)
|
||||||
ports_ = *pp;
|
ports_ = *pp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Module::~Module()
|
||||||
|
{
|
||||||
|
free(name_);
|
||||||
|
}
|
||||||
|
|
||||||
void Module::add_gate(PGate*gate)
|
void Module::add_gate(PGate*gate)
|
||||||
{
|
{
|
||||||
gates_.push_back(gate);
|
gates_.push_back(gate);
|
||||||
|
|
@ -137,6 +142,9 @@ const list<PProcess*>& Module::get_behaviors() const
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: Module.cc,v $
|
* $Log: Module.cc,v $
|
||||||
|
* Revision 1.16 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.15 2001/07/25 03:10:48 steve
|
* Revision 1.15 2001/07/25 03:10:48 steve
|
||||||
* Create a config.h.in file to hold all the config
|
* Create a config.h.in file to hold all the config
|
||||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||||
|
|
|
||||||
12
Module.h
12
Module.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: Module.h,v 1.21 2000/11/05 06:05:59 steve Exp $"
|
#ident "$Id: Module.h,v 1.22 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include <list>
|
# include <list>
|
||||||
|
|
@ -58,7 +58,8 @@ class Module {
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Module(const string&name, const svector<port_t*>*);
|
explicit Module(const char*name, const svector<port_t*>*);
|
||||||
|
~Module();
|
||||||
|
|
||||||
|
|
||||||
/* The module has parameters that are evaluated when the
|
/* The module has parameters that are evaluated when the
|
||||||
|
|
@ -88,7 +89,7 @@ class Module {
|
||||||
set by the `timescale directive. */
|
set by the `timescale directive. */
|
||||||
int time_unit, time_precision;
|
int time_unit, time_precision;
|
||||||
|
|
||||||
const string&get_name() const { return name_; }
|
const char*mod_name() const { return name_; }
|
||||||
|
|
||||||
void add_gate(PGate*gate);
|
void add_gate(PGate*gate);
|
||||||
|
|
||||||
|
|
@ -122,7 +123,7 @@ class Module {
|
||||||
bool elaborate_sig(Design*, NetScope*scope) const;
|
bool elaborate_sig(Design*, NetScope*scope) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const string name_;
|
char* name_;
|
||||||
|
|
||||||
/* This is an array of port descriptors, which is in turn a
|
/* This is an array of port descriptors, which is in turn a
|
||||||
named array of PEident pointers. */
|
named array of PEident pointers. */
|
||||||
|
|
@ -142,6 +143,9 @@ class Module {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: Module.h,v $
|
* $Log: Module.h,v $
|
||||||
|
* Revision 1.22 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.21 2000/11/05 06:05:59 steve
|
* Revision 1.21 2000/11/05 06:05:59 steve
|
||||||
* Handle connectsion to internally unconnected modules (PR#38)
|
* Handle connectsion to internally unconnected modules (PR#38)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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: elab_scope.cc,v 1.10 2001/10/09 02:01:04 steve Exp $"
|
#ident "$Id: elab_scope.cc,v 1.11 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -134,7 +134,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
|
||||||
for (tasks_it_t cur = tasks_.begin()
|
for (tasks_it_t cur = tasks_.begin()
|
||||||
; cur != tasks_.end() ; cur ++ ) {
|
; cur != tasks_.end() ; cur ++ ) {
|
||||||
|
|
||||||
NetScope*task_scope = new NetScope(scope, (*cur).first,
|
NetScope*task_scope = new NetScope(scope, (*cur).first.c_str(),
|
||||||
NetScope::TASK);
|
NetScope::TASK);
|
||||||
(*cur).second->elaborate_scope(des, task_scope);
|
(*cur).second->elaborate_scope(des, task_scope);
|
||||||
}
|
}
|
||||||
|
|
@ -149,7 +149,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
|
||||||
for (funcs_it_t cur = funcs_.begin()
|
for (funcs_it_t cur = funcs_.begin()
|
||||||
; cur != funcs_.end() ; cur ++ ) {
|
; cur != funcs_.end() ; cur ++ ) {
|
||||||
|
|
||||||
NetScope*func_scope = new NetScope(scope, (*cur).first,
|
NetScope*func_scope = new NetScope(scope, (*cur).first.c_str(),
|
||||||
NetScope::FUNC);
|
NetScope::FUNC);
|
||||||
(*cur).second->elaborate_scope(des, func_scope);
|
(*cur).second->elaborate_scope(des, func_scope);
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
||||||
{
|
{
|
||||||
if (get_name() == "") {
|
if (get_name() == "") {
|
||||||
cerr << get_line() << ": error: Instantiation of module "
|
cerr << get_line() << ": error: Instantiation of module "
|
||||||
<< mod->get_name() << " requires an instance name." << endl;
|
<< mod->mod_name() << " requires an instance name." << endl;
|
||||||
des->errors += 1;
|
des->errors += 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -227,11 +227,11 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
||||||
if (scn->type() != NetScope::MODULE)
|
if (scn->type() != NetScope::MODULE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mod->get_name() != scn->module_name())
|
if (strcmp(mod->mod_name(), scn->module_name()) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cerr << get_line() << ": error: You cannot instantiate "
|
cerr << get_line() << ": error: You cannot instantiate "
|
||||||
<< "module " << mod->get_name() << " within itself." << endl;
|
<< "module " << mod->mod_name() << " within itself." << endl;
|
||||||
|
|
||||||
cerr << get_line() << ": : The offending instance is "
|
cerr << get_line() << ": : The offending instance is "
|
||||||
<< sc->name() << "." << get_name() << " within "
|
<< sc->name() << "." << get_name() << " within "
|
||||||
|
|
@ -242,8 +242,8 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the new scope as a MODULE with my name.
|
// Create the new scope as a MODULE with my name.
|
||||||
NetScope*my_scope = new NetScope(sc, get_name(), NetScope::MODULE);
|
NetScope*my_scope = new NetScope(sc, get_name().c_str(), NetScope::MODULE);
|
||||||
my_scope->set_module_name(mod->get_name().c_str());
|
my_scope->set_module_name(mod->mod_name());
|
||||||
|
|
||||||
// Set time units and precision.
|
// Set time units and precision.
|
||||||
my_scope->time_unit(mod->time_unit);
|
my_scope->time_unit(mod->time_unit);
|
||||||
|
|
@ -349,7 +349,7 @@ void PBlock::elaborate_scope(Design*des, NetScope*scope) const
|
||||||
NetScope*my_scope = scope;
|
NetScope*my_scope = scope;
|
||||||
|
|
||||||
if (name_ != "") {
|
if (name_ != "") {
|
||||||
my_scope = new NetScope(scope, name_, bl_type_==BL_PAR
|
my_scope = new NetScope(scope, name_.c_str(), bl_type_==BL_PAR
|
||||||
? NetScope::FORK_JOIN
|
? NetScope::FORK_JOIN
|
||||||
: NetScope::BEGIN_END);
|
: NetScope::BEGIN_END);
|
||||||
}
|
}
|
||||||
|
|
@ -458,6 +458,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: elab_scope.cc,v $
|
* $Log: elab_scope.cc,v $
|
||||||
|
* Revision 1.11 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.10 2001/10/09 02:01:04 steve
|
* Revision 1.10 2001/10/09 02:01:04 steve
|
||||||
* Tasks can have sub-scopes.
|
* Tasks can have sub-scopes.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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.221 2001/10/19 21:53:24 steve Exp $"
|
#ident "$Id: elaborate.cc,v 1.222 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -2285,7 +2285,7 @@ struct root_elem {
|
||||||
|
|
||||||
Design* elaborate(const map<string,Module*>&modules,
|
Design* elaborate(const map<string,Module*>&modules,
|
||||||
const map<string,PUdp*>&primitives,
|
const map<string,PUdp*>&primitives,
|
||||||
list<string>roots)
|
list<const char*>roots)
|
||||||
{
|
{
|
||||||
svector<root_elem*> root_elems(roots.size());
|
svector<root_elem*> root_elems(roots.size());
|
||||||
bool rc = true;
|
bool rc = true;
|
||||||
|
|
@ -2298,7 +2298,7 @@ Design* elaborate(const map<string,Module*>&modules,
|
||||||
modlist = &modules;
|
modlist = &modules;
|
||||||
udplist = &primitives;
|
udplist = &primitives;
|
||||||
|
|
||||||
for (list<string>::const_iterator root = roots.begin();
|
for (list<const char*>::const_iterator root = roots.begin();
|
||||||
root != roots.end(); root++) {
|
root != roots.end(); root++) {
|
||||||
// Look for the root module in the list.
|
// Look for the root module in the list.
|
||||||
map<string,Module*>::const_iterator mod = modules.find(*root);
|
map<string,Module*>::const_iterator mod = modules.find(*root);
|
||||||
|
|
@ -2372,6 +2372,9 @@ Design* elaborate(const map<string,Module*>&modules,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: elaborate.cc,v $
|
* $Log: elaborate.cc,v $
|
||||||
|
* Revision 1.222 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.221 2001/10/19 21:53:24 steve
|
* Revision 1.221 2001/10/19 21:53:24 steve
|
||||||
* Support multiple root modules (Philip Blundell)
|
* Support multiple root modules (Philip Blundell)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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: expr_synth.cc,v 1.26 2001/08/31 22:59:48 steve Exp $"
|
#ident "$Id: expr_synth.cc,v 1.27 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -353,27 +353,36 @@ NetNet* NetEBLogic::synthesize(Design*des)
|
||||||
|
|
||||||
NetNet* NetEConcat::synthesize(Design*des)
|
NetNet* NetEConcat::synthesize(Design*des)
|
||||||
{
|
{
|
||||||
NetScope*scope = des->find_root_scope();
|
/* First, synthesize the operands. */
|
||||||
assert(scope);
|
NetNet**tmp = new NetNet*[parms_.count()];
|
||||||
assert(repeat_ == 1);
|
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1)
|
||||||
|
tmp[idx] = parms_[idx]->synthesize(des);
|
||||||
|
|
||||||
|
assert(tmp[0]);
|
||||||
|
NetScope*scope = tmp[0]->scope();
|
||||||
|
assert(scope);
|
||||||
|
|
||||||
|
/* Make a NetNet object to carry the output vector. */
|
||||||
string path = scope->name() + "." + scope->local_symbol();
|
string path = scope->name() + "." + scope->local_symbol();
|
||||||
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, expr_width());
|
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, expr_width());
|
||||||
osig->local_flag(true);
|
osig->local_flag(true);
|
||||||
|
|
||||||
|
/* Connect the output vector to the operands. */
|
||||||
unsigned obit = 0;
|
unsigned obit = 0;
|
||||||
for (unsigned idx = parms_.count() ; idx > 0 ; idx -= 1) {
|
for (unsigned idx = parms_.count() ; idx > 0 ; idx -= 1) {
|
||||||
NetNet*tmp = parms_[idx-1]->synthesize(des);
|
|
||||||
|
|
||||||
for (unsigned bit = 0 ; bit < tmp->pin_count() ; bit += 1) {
|
assert(tmp[idx-1]);
|
||||||
connect(osig->pin(obit), tmp->pin(bit));
|
|
||||||
|
for (unsigned bit = 0; bit < tmp[idx-1]->pin_count(); bit += 1) {
|
||||||
|
connect(osig->pin(obit), tmp[idx-1]->pin(bit));
|
||||||
obit += 1;
|
obit += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp->local_flag() && tmp->get_eref() == 0)
|
if (tmp[idx-1]->local_flag() && tmp[idx-1]->get_eref() == 0)
|
||||||
delete tmp;
|
delete tmp[idx-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete[]tmp;
|
||||||
return osig;
|
return osig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -553,6 +562,9 @@ NetNet* NetESignal::synthesize(Design*des)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: expr_synth.cc,v $
|
* $Log: expr_synth.cc,v $
|
||||||
|
* Revision 1.27 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.26 2001/08/31 22:59:48 steve
|
* Revision 1.26 2001/08/31 22:59:48 steve
|
||||||
* synthesize the special case of compare with 0.
|
* synthesize the special case of compare with 0.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
17
main.cc
17
main.cc
|
|
@ -19,7 +19,7 @@ const char COPYRIGHT[] =
|
||||||
* 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: main.cc,v 1.48 2001/10/19 21:53:24 steve Exp $"
|
#ident "$Id: main.cc,v 1.49 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -102,7 +102,7 @@ static void parm_to_flagmap(const string&flag)
|
||||||
|
|
||||||
extern Design* elaborate(const map<string,Module*>&modules,
|
extern Design* elaborate(const map<string,Module*>&modules,
|
||||||
const map<string,PUdp*>&primitives,
|
const map<string,PUdp*>&primitives,
|
||||||
list <string>root);
|
list <const char*>root);
|
||||||
|
|
||||||
extern void cprop(Design*des);
|
extern void cprop(Design*des);
|
||||||
extern void synth(Design*des);
|
extern void synth(Design*des);
|
||||||
|
|
@ -175,7 +175,7 @@ int main(int argc, char*argv[])
|
||||||
int opt;
|
int opt;
|
||||||
unsigned flag_errors = 0;
|
unsigned flag_errors = 0;
|
||||||
queue<net_func> net_func_queue;
|
queue<net_func> net_func_queue;
|
||||||
list<string> roots;
|
list<const char*> roots;
|
||||||
|
|
||||||
struct tms cycles[5];
|
struct tms cycles[5];
|
||||||
|
|
||||||
|
|
@ -218,7 +218,7 @@ int main(int argc, char*argv[])
|
||||||
parm_to_flagmap(optarg);
|
parm_to_flagmap(optarg);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
roots.push_back(string(optarg));
|
roots.push_back(optarg);
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
if (strcmp(optarg,"min") == 0) {
|
if (strcmp(optarg,"min") == 0) {
|
||||||
|
|
@ -359,10 +359,10 @@ int main(int argc, char*argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
for (mod = modules.begin(); mod != modules.end(); mod++) {
|
for (mod = modules.begin(); mod != modules.end(); mod++) {
|
||||||
if (mentioned_p[(*mod).second->get_name()] == false) {
|
if (mentioned_p[(*mod).second->mod_name()] == false) {
|
||||||
if (verbose_flag)
|
if (verbose_flag)
|
||||||
cout << " " << (*mod).second->get_name();
|
cout << " " << (*mod).second->mod_name();
|
||||||
roots.push_back((*mod).second->get_name());
|
roots.push_back((*mod).second->mod_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (verbose_flag)
|
if (verbose_flag)
|
||||||
|
|
@ -455,6 +455,9 @@ int main(int argc, char*argv[])
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: main.cc,v $
|
* $Log: main.cc,v $
|
||||||
|
* Revision 1.49 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.48 2001/10/19 21:53:24 steve
|
* Revision 1.48 2001/10/19 21:53:24 steve
|
||||||
* Support multiple root modules (Philip Blundell)
|
* Support multiple root modules (Philip Blundell)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -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: net_design.cc,v 1.21 2001/10/19 21:53:24 steve Exp $"
|
#ident "$Id: net_design.cc,v 1.22 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -77,11 +77,11 @@ unsigned long Design::scale_to_precision(unsigned long val,
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
NetScope* Design::make_root_scope(const string&root)
|
NetScope* Design::make_root_scope(const char*root)
|
||||||
{
|
{
|
||||||
NetScope *root_scope_;
|
NetScope *root_scope_;
|
||||||
root_scope_ = new NetScope(0, root, NetScope::MODULE);
|
root_scope_ = new NetScope(0, root, NetScope::MODULE);
|
||||||
root_scope_->set_module_name(root.c_str());
|
root_scope_->set_module_name(root);
|
||||||
root_scopes_.push_back(root_scope_);
|
root_scopes_.push_back(root_scope_);
|
||||||
return root_scope_;
|
return root_scope_;
|
||||||
}
|
}
|
||||||
|
|
@ -92,12 +92,6 @@ NetScope* Design::find_root_scope()
|
||||||
return root_scopes_.front();
|
return root_scopes_.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const NetScope* Design::find_root_scope() const
|
|
||||||
{
|
|
||||||
assert(root_scopes_.front());
|
|
||||||
return root_scopes_.front();
|
|
||||||
}
|
|
||||||
|
|
||||||
list<NetScope*> Design::find_root_scopes()
|
list<NetScope*> Design::find_root_scopes()
|
||||||
{
|
{
|
||||||
return root_scopes_;
|
return root_scopes_;
|
||||||
|
|
@ -495,6 +489,9 @@ void Design::delete_process(NetProcTop*top)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: net_design.cc,v $
|
* $Log: net_design.cc,v $
|
||||||
|
* Revision 1.22 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.21 2001/10/19 21:53:24 steve
|
* Revision 1.21 2001/10/19 21:53:24 steve
|
||||||
* Support multiple root modules (Philip Blundell)
|
* Support multiple root modules (Philip Blundell)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
11
net_scope.cc
11
net_scope.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: net_scope.cc,v 1.13 2001/07/25 03:10:49 steve Exp $"
|
#ident "$Id: net_scope.cc,v 1.14 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
* in question.
|
* in question.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NetScope::NetScope(NetScope*up, const string&n, NetScope::TYPE t)
|
NetScope::NetScope(NetScope*up, const char*n, NetScope::TYPE t)
|
||||||
: type_(t), up_(up), sib_(0), sub_(0)
|
: type_(t), up_(up), sib_(0), sub_(0)
|
||||||
{
|
{
|
||||||
memories_ = 0;
|
memories_ = 0;
|
||||||
|
|
@ -63,8 +63,8 @@ NetScope::NetScope(NetScope*up, const string&n, NetScope::TYPE t)
|
||||||
module_name_ = 0;
|
module_name_ = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
name_ = new char[n.length()+1];
|
name_ = new char[strlen(n)+1];
|
||||||
strcpy(name_, n.c_str());
|
strcpy(name_, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetScope::~NetScope()
|
NetScope::~NetScope()
|
||||||
|
|
@ -371,6 +371,9 @@ string NetScope::local_symbol()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: net_scope.cc,v $
|
* $Log: net_scope.cc,v $
|
||||||
|
* Revision 1.14 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.13 2001/07/25 03:10:49 steve
|
* Revision 1.13 2001/07/25 03:10:49 steve
|
||||||
* Create a config.h.in file to hold all the config
|
* Create a config.h.in file to hold all the config
|
||||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||||
|
|
|
||||||
10
netlist.h
10
netlist.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: netlist.h,v 1.217 2001/10/19 21:53:24 steve Exp $"
|
#ident "$Id: netlist.h,v 1.218 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2558,7 +2558,7 @@ class NetScope {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TYPE { MODULE, TASK, FUNC, BEGIN_END, FORK_JOIN };
|
enum TYPE { MODULE, TASK, FUNC, BEGIN_END, FORK_JOIN };
|
||||||
NetScope(NetScope*up, const string&name, TYPE t);
|
NetScope(NetScope*up, const char*name, TYPE t);
|
||||||
~NetScope();
|
~NetScope();
|
||||||
|
|
||||||
/* Parameters exist within a scope, and these methods allow
|
/* Parameters exist within a scope, and these methods allow
|
||||||
|
|
@ -2709,11 +2709,10 @@ class Design {
|
||||||
|
|
||||||
string get_flag(const string&key) const;
|
string get_flag(const string&key) const;
|
||||||
|
|
||||||
NetScope* make_root_scope(const string&name);
|
NetScope* make_root_scope(const char*name);
|
||||||
NetScope* find_root_scope();
|
NetScope* find_root_scope();
|
||||||
list<NetScope*> find_root_scopes();
|
list<NetScope*> find_root_scopes();
|
||||||
|
|
||||||
const NetScope* find_root_scope() const;
|
|
||||||
const list<NetScope*> find_root_scopes() const;
|
const list<NetScope*> find_root_scopes() const;
|
||||||
|
|
||||||
/* Attempt to set the precision to the specified value. If the
|
/* Attempt to set the precision to the specified value. If the
|
||||||
|
|
@ -2851,6 +2850,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: netlist.h,v $
|
* $Log: netlist.h,v $
|
||||||
|
* Revision 1.218 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.217 2001/10/19 21:53:24 steve
|
* Revision 1.217 2001/10/19 21:53:24 steve
|
||||||
* Support multiple root modules (Philip Blundell)
|
* Support multiple root modules (Philip Blundell)
|
||||||
*
|
*
|
||||||
|
|
|
||||||
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.78 2001/07/25 03:10:49 steve Exp $"
|
#ident "$Id: pform.cc,v 1.79 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -108,7 +108,7 @@ static unsigned long evaluate_delay(PExpr*delay)
|
||||||
return pp->value().as_ulong();
|
return pp->value().as_ulong();
|
||||||
}
|
}
|
||||||
|
|
||||||
void pform_startmodule(const string&name, svector<Module::port_t*>*ports)
|
void pform_startmodule(const char*name, svector<Module::port_t*>*ports)
|
||||||
{
|
{
|
||||||
assert( pform_cur_module == 0 );
|
assert( pform_cur_module == 0 );
|
||||||
|
|
||||||
|
|
@ -126,10 +126,10 @@ void pform_startmodule(const string&name, svector<Module::port_t*>*ports)
|
||||||
delete ports;
|
delete ports;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pform_endmodule(const string&name)
|
void pform_endmodule(const char*name)
|
||||||
{
|
{
|
||||||
assert(pform_cur_module);
|
assert(pform_cur_module);
|
||||||
assert(name == pform_cur_module->get_name());
|
assert(strcmp(name, pform_cur_module->mod_name()) == 0);
|
||||||
vl_modules[name] = pform_cur_module;
|
vl_modules[name] = pform_cur_module;
|
||||||
pform_cur_module = 0;
|
pform_cur_module = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1019,6 +1019,9 @@ int pform_parse(const char*path, map<string,Module*>&modules,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.cc,v $
|
* $Log: pform.cc,v $
|
||||||
|
* Revision 1.79 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.78 2001/07/25 03:10:49 steve
|
* Revision 1.78 2001/07/25 03:10:49 steve
|
||||||
* Create a config.h.in file to hold all the config
|
* Create a config.h.in file to hold all the config
|
||||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||||
|
|
|
||||||
9
pform.h
9
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.45 2000/12/11 00:31:43 steve Exp $"
|
#ident "$Id: pform.h,v 1.46 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "netlist.h"
|
# include "netlist.h"
|
||||||
|
|
@ -110,8 +110,8 @@ struct lgate {
|
||||||
* are to apply to the scope of that module. The endmodule causes the
|
* are to apply to the scope of that module. The endmodule causes the
|
||||||
* pform to close up and finish the named module.
|
* pform to close up and finish the named module.
|
||||||
*/
|
*/
|
||||||
extern void pform_startmodule(const string&, svector<Module::port_t*>*);
|
extern void pform_startmodule(const char*, svector<Module::port_t*>*);
|
||||||
extern void pform_endmodule(const string&);
|
extern void pform_endmodule(const char*);
|
||||||
|
|
||||||
extern void pform_make_udp(const char*name, list<string>*parms,
|
extern void pform_make_udp(const char*name, list<string>*parms,
|
||||||
svector<PWire*>*decl, list<string>*table,
|
svector<PWire*>*decl, list<string>*table,
|
||||||
|
|
@ -202,6 +202,9 @@ extern void pform_dump(ostream&out, Module*mod);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: pform.h,v $
|
* $Log: pform.h,v $
|
||||||
|
* Revision 1.46 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.45 2000/12/11 00:31:43 steve
|
* Revision 1.45 2000/12/11 00:31:43 steve
|
||||||
* Add support for signed reg variables,
|
* Add support for signed reg variables,
|
||||||
* simulate in t-vvm signed comparisons.
|
* simulate in t-vvm signed comparisons.
|
||||||
|
|
|
||||||
7
xnfio.cc
7
xnfio.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: xnfio.cc,v 1.18 2001/07/25 03:10:50 steve Exp $"
|
#ident "$Id: xnfio.cc,v 1.19 2001/10/20 05:21:51 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -317,7 +317,7 @@ bool xnfio_f::compare_sideb_const(Design*des, NetCompare*dev)
|
||||||
if (dev->width() > 4)
|
if (dev->width() > 4)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
NetScope*scope = des->find_root_scope();
|
NetScope*scope = dev->scope();
|
||||||
|
|
||||||
verinum side (verinum::V0, dev->width());
|
verinum side (verinum::V0, dev->width());
|
||||||
|
|
||||||
|
|
@ -367,6 +367,9 @@ void xnfio(Design*des)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: xnfio.cc,v $
|
* $Log: xnfio.cc,v $
|
||||||
|
* Revision 1.19 2001/10/20 05:21:51 steve
|
||||||
|
* Scope/module names are char* instead of string.
|
||||||
|
*
|
||||||
* Revision 1.18 2001/07/25 03:10:50 steve
|
* Revision 1.18 2001/07/25 03:10:50 steve
|
||||||
* Create a config.h.in file to hold all the config
|
* Create a config.h.in file to hold all the config
|
||||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue