diff --git a/Module.h b/Module.h index 543b2f30e..e2823c934 100644 --- a/Module.h +++ b/Module.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: Module.h,v 1.35 2004/02/20 18:53:33 steve Exp $" +#ident "$Id: Module.h,v 1.36 2004/05/25 19:21:06 steve Exp $" #endif # include @@ -84,7 +84,7 @@ class Module : public LineInfo { /* specparams are simpler then other params, in that they have no type information. They are merely constant expressions. */ - mapspecparams; + mapspecparams; /* The module also has defparam assignments which don't create new parameters within the module, but may be used to set @@ -105,7 +105,7 @@ class Module : public LineInfo { svector ports; /* Keep a table of named events declared in the module. */ - mapevents; + mapevents; /* Keep a table of datum variables declared in the module. */ mapdatum; @@ -166,6 +166,9 @@ class Module : public LineInfo { /* * $Log: Module.h,v $ + * Revision 1.36 2004/05/25 19:21:06 steve + * More identifier lists use perm_strings. + * * Revision 1.35 2004/02/20 18:53:33 steve * Addtrbute keys are perm_strings. * diff --git a/elab_scope.cc b/elab_scope.cc index 1697a69be..25a548b07 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: elab_scope.cc,v 1.30 2004/02/20 06:22:56 steve Exp $" +#ident "$Id: elab_scope.cc,v 1.31 2004/05/25 19:21:06 steve Exp $" #endif # include "config.h" @@ -226,7 +226,7 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const // elaboration, so do it now. This allows for normal // elaboration to reference these events. - for (map::const_iterator et = events.begin() + for (map::const_iterator et = events.begin() ; et != events.end() ; et ++ ) { (*et).second->elaborate_scope(des, scope); @@ -549,6 +549,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const /* * $Log: elab_scope.cc,v $ + * Revision 1.31 2004/05/25 19:21:06 steve + * More identifier lists use perm_strings. + * * Revision 1.30 2004/02/20 06:22:56 steve * parameter keys are per_strings. * diff --git a/parse.y b/parse.y index 4643de7f2..c2ea1e8b3 100644 --- a/parse.y +++ b/parse.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: parse.y,v 1.194 2004/05/25 03:42:44 steve Exp $" +#ident "$Id: parse.y,v 1.195 2004/05/25 19:21:06 steve Exp $" #endif # include "config.h" @@ -77,7 +77,6 @@ const static struct str_pair_t str_strength = { PGate::STRONG, PGate::STRONG }; /* text items are C strings allocated by the lexor using strdup. They can be put into lists with the texts type. */ char*text; - list*texts; list*perm_strings; hname_t*hier; @@ -169,7 +168,7 @@ const static struct str_pair_t str_strength = { PGate::STRONG, PGate::STRONG }; %type identifier %type register_variable -%type register_variable_list list_of_identifiers +%type register_variable_list list_of_identifiers %type net_decl_assign net_decl_assigns @@ -215,7 +214,7 @@ const static struct str_pair_t str_strength = { PGate::STRONG, PGate::STRONG }; %type range_delay %type spec_polarity -%type specify_path_identifiers +%type specify_path_identifiers %token K_TAND %right '?' ':' @@ -1171,14 +1170,16 @@ identifier non-hierarchical names separated by ',' characters. */ list_of_identifiers : IDENTIFIER - { list*tmp = new list; - tmp->push_back($1); + { list*tmp = new list; + tmp->push_back(lex_strings.make($1)); $$ = tmp; + delete[]$1; } | list_of_identifiers ',' IDENTIFIER - { list*tmp = $1; - tmp->push_back($3); + { list*tmp = $1; + tmp->push_back(lex_strings.make($3)); $$ = tmp; + delete[]$3; } ; @@ -2197,14 +2198,16 @@ register_variable register_variable_list : register_variable - { list*tmp = new list; - tmp->push_back($1); + { list*tmp = new list; + tmp->push_back(lex_strings.make($1)); $$ = tmp; + delete[]$1; } | register_variable_list ',' register_variable - { list*tmp = $1; - tmp->push_back($3); + { list*tmp = $1; + tmp->push_back(lex_strings.make($3)); $$ = tmp; + delete[]$3; } ; @@ -2314,24 +2317,28 @@ specify_simple_path specify_path_identifiers : IDENTIFIER - { list*tmp = new list; - tmp->push_back($1); + { list*tmp = new list; + tmp->push_back(lex_strings.make($1)); $$ = tmp; + delete[]$1; } | IDENTIFIER '[' expr_primary ']' - { list*tmp = new list; - tmp->push_back($1); + { list*tmp = new list; + tmp->push_back(lex_strings.make($1)); $$ = tmp; + delete[]$1; } | specify_path_identifiers ',' IDENTIFIER - { list*tmp = $1; - tmp->push_back($3); + { list*tmp = $1; + tmp->push_back(lex_strings.make($3)); $$ = tmp; + delete[]$3; } | specify_path_identifiers ',' IDENTIFIER '[' expr_primary ']' - { list*tmp = $1; - tmp->push_back($3); + { list*tmp = $1; + tmp->push_back(lex_strings.make($3)); $$ = tmp; + delete[]$3; } ; @@ -2344,7 +2351,7 @@ specparam delete tmp; tmp = 0; } else { - pform_set_specparam($1, tmp); + pform_set_specparam(lex_strings.make($1), tmp); } delete $1; } diff --git a/pform.cc b/pform.cc index e5b6e57a1..ae9e737c8 100644 --- a/pform.cc +++ b/pform.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: pform.cc,v 1.124 2004/03/08 00:10:30 steve Exp $" +#ident "$Id: pform.cc,v 1.125 2004/05/25 19:21:07 steve Exp $" #endif # include "config.h" @@ -668,7 +668,7 @@ void pform_make_udp(perm_string name, bool synchronous_flag, * only called by the parser within the scope of the net declaration, * and the name that I receive only has the tail component. */ -static void pform_set_net_range(const char*name, +static void pform_set_net_range(const char* name, const svector*range, bool signed_flag) { @@ -693,18 +693,17 @@ static void pform_set_net_range(const char*name, cur->set_signed(signed_flag); } -void pform_set_net_range(list*names, +void pform_set_net_range(list*names, svector*range, bool signed_flag) { assert((range == 0) || (range->count() == 2)); - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; pform_set_net_range(txt, range, signed_flag); - free(txt); } delete names; @@ -716,27 +715,26 @@ void pform_set_net_range(list*names, * This is invoked to make a named event. This is the declaration of * the event, and not necessarily the use of it. */ -static void pform_make_event(const char*name, const char*fn, unsigned ln) +static void pform_make_event(perm_string name, const char*fn, unsigned ln) { - PEvent*event = new PEvent(lex_strings.make(name)); + PEvent*event = new PEvent(name); event->set_file(fn); event->set_lineno(ln); pform_cur_module->events[name] = event; } -void pform_make_events(list*names, const char*fn, unsigned ln) +void pform_make_events(list*names, const char*fn, unsigned ln) { - list::iterator cur; + list::iterator cur; for (cur = names->begin() ; cur != names->end() ; cur++) { - char*txt = *cur; + perm_string txt = *cur; pform_make_event(txt, fn, ln); - free(txt); } delete names; } -static void pform_make_datum(const char*name, const char*fn, unsigned ln) +static void pform_make_datum(perm_string name, const char*fn, unsigned ln) { hname_t hname = hier_name(name); PData*datum = new PData(hname); @@ -745,13 +743,12 @@ static void pform_make_datum(const char*name, const char*fn, unsigned ln) pform_cur_module->datum[hname] = datum; } -void pform_make_reals(list*names, const char*fn, unsigned ln) +void pform_make_reals(list*names, const char*fn, unsigned ln) { - list::iterator cur; + list::iterator cur; for (cur = names->begin() ; cur != names->end() ; cur++) { - char*txt = *cur; + perm_string txt = *cur; pform_make_datum(txt, fn, ln); - free(txt); } delete names; @@ -1131,18 +1128,17 @@ void pform_makewire(const vlltype&li, const char*nm, void pform_makewire(const vlltype&li, svector*range, bool signed_flag, - list*names, + list*names, NetNet::Type type, NetNet::PortType pt, svector*attr) { - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; pform_makewire(li, txt, type, pt, attr); pform_set_net_range(txt, range, signed_flag); - free(txt); } delete names; @@ -1182,7 +1178,7 @@ void pform_makewire(const vlltype&li, } } -void pform_set_port_type(const char*nm, NetNet::PortType pt, +void pform_set_port_type(perm_string nm, NetNet::PortType pt, const char*file, unsigned lineno) { hname_t name = hier_name(nm); @@ -1259,16 +1255,16 @@ void pform_set_port_type(const char*nm, NetNet::PortType pt, svector*pform_make_task_ports(NetNet::PortType pt, bool signed_flag, svector*range, - list*names, + list*names, const char* file, unsigned lineno) { assert(names); svector*res = new svector(0); - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; hname_t name = hier_name(txt); /* Look for a preexisting wire. If it exists, set the @@ -1291,7 +1287,6 @@ svector*pform_make_task_ports(NetNet::PortType pt, svector*tmp = new svector(*res, curw); - free(txt); delete res; res = tmp; } @@ -1424,7 +1419,7 @@ void pform_set_localparam(perm_string name, PExpr*expr) pform_cur_module->localparams[name].signed_flag = false; } -void pform_set_specparam(const string&name, PExpr*expr) +void pform_set_specparam(perm_string name, PExpr*expr) { assert(expr); pform_cur_module->specparams[name] = expr; @@ -1439,27 +1434,26 @@ void pform_set_defparam(const hname_t&name, PExpr*expr) /* * XXXX Not implemented yet. */ -extern void pform_make_specify_path(list*src, char pol, - bool full_flag, list*dst) +extern void pform_make_specify_path(list*src, char pol, + bool full_flag, list*dst) { delete src; delete dst; } void pform_set_port_type(const struct vlltype&li, - list*names, + list*names, svector*range, bool signed_flag, NetNet::PortType pt) { - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; pform_set_port_type(txt, pt, li.text, li.first_line); if (range) pform_set_net_range(txt, range, signed_flag); - free(txt); } delete names; @@ -1487,14 +1481,13 @@ static void pform_set_reg_integer(const char*nm) cur->set_signed(true); } -void pform_set_reg_integer(list*names) +void pform_set_reg_integer(list*names) { - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; pform_set_reg_integer(txt); - free(txt); } delete names; } @@ -1516,31 +1509,31 @@ static void pform_set_reg_time(const char*nm) new PENumber(new verinum(0UL, INTEGER_WIDTH))); } -void pform_set_reg_time(list*names) +void pform_set_reg_time(list*names) { - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; + perm_string txt = *cur; pform_set_reg_time(txt); - free(txt); } delete names; } -svector* pform_make_udp_input_ports(list*names) +svector* pform_make_udp_input_ports(list*names) { svector*out = new svector(names->size()); unsigned idx = 0; - for (list::iterator cur = names->begin() + for (list::iterator cur = names->begin() ; cur != names->end() ; cur ++ ) { - char*txt = *cur; - PWire*pp = new PWire(txt, NetNet::IMPLICIT, NetNet::PINPUT); + perm_string txt = *cur; + PWire*pp = new PWire(hname_t(txt), + NetNet::IMPLICIT, + NetNet::PINPUT); (*out)[idx] = pp; idx += 1; - free(txt); } delete names; @@ -1605,6 +1598,9 @@ int pform_parse(const char*path, FILE*file) /* * $Log: pform.cc,v $ + * Revision 1.125 2004/05/25 19:21:07 steve + * More identifier lists use perm_strings. + * * Revision 1.124 2004/03/08 00:10:30 steve * Verilog2001 new style port declartions for primitives. * diff --git a/pform.h b/pform.h index 5399cd7e8..761ff09c1 100644 --- a/pform.h +++ b/pform.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: pform.h,v 1.77 2004/03/08 00:10:30 steve Exp $" +#ident "$Id: pform.h,v 1.78 2004/05/25 19:21:07 steve Exp $" #endif # include "netlist.h" @@ -172,7 +172,7 @@ extern void pform_makewire(const struct vlltype&li, const char*name, extern void pform_makewire(const struct vlltype&li, svector*range, bool signed_flag, - list*names, + list*names, NetNet::Type type, NetNet::PortType, svector*attr); @@ -190,17 +190,18 @@ extern void pform_make_reginit(const struct vlltype&li, i.e. input, output or inout. If the wire does not exist, create it. The second form takes a single name. */ extern void pform_set_port_type(const struct vlltype&li, - list*names, + list*names, svector*range, bool signed_flag, NetNet::PortType); -extern void pform_set_port_type(const char*nm, NetNet::PortType pt, +extern void pform_set_port_type(perm_string nm, NetNet::PortType pt, const char*file, unsigned lineno); -extern void pform_set_net_range(list*names, svector*, bool); +extern void pform_set_net_range(list*names, + svector*, bool); extern void pform_set_reg_idx(const char*name, PExpr*l, PExpr*r); -extern void pform_set_reg_integer(list*names); -extern void pform_set_reg_time(list*names); +extern void pform_set_reg_integer(list*names); +extern void pform_set_reg_time(list*names); extern void pform_set_task(perm_string name, PTask*); extern void pform_set_function(const char*, NetNet::Type, svector*, PFunction*); @@ -224,9 +225,9 @@ extern void pform_set_defparam(const hname_t&name, PExpr*expr); /* * Functions related to specify blocks. */ -extern void pform_set_specparam(const string&name, PExpr*expr); -extern void pform_make_specify_path(list*src, char pol, - bool full_flag, list*dst); +extern void pform_set_specparam(perm_string name, PExpr*expr); +extern void pform_make_specify_path(list*src, char pol, + bool full_flag, list*dst); /* * pform_make_behavior creates processes that are declared with always @@ -235,16 +236,16 @@ extern void pform_make_specify_path(list*src, char pol, extern PProcess* pform_make_behavior(PProcess::Type, Statement*, svector*attr); -extern svector* pform_make_udp_input_ports(list*); +extern svector* pform_make_udp_input_ports(list*); extern bool pform_expression_is_constant(const PExpr*); -extern void pform_make_events(list*names, +extern void pform_make_events(list*names, const char*file, unsigned lineno); /* * Make real datum objects. */ -extern void pform_make_reals(list*names, +extern void pform_make_reals(list*names, const char*file, unsigned lineno); /* @@ -275,7 +276,7 @@ extern void pform_make_pgassign_list(svector*alist, extern svector*pform_make_task_ports(NetNet::PortType pt, bool signed_flag, svector*range, - list*names, + list*names, const char* file, unsigned lineno); @@ -290,6 +291,9 @@ extern void pform_dump(ostream&out, Module*mod); /* * $Log: pform.h,v $ + * Revision 1.78 2004/05/25 19:21:07 steve + * More identifier lists use perm_strings. + * * Revision 1.77 2004/03/08 00:10:30 steve * Verilog2001 new style port declartions for primitives. * diff --git a/pform_dump.cc b/pform_dump.cc index 6a4b2be70..92e000001 100644 --- a/pform_dump.cc +++ b/pform_dump.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: pform_dump.cc,v 1.85 2004/02/20 18:53:35 steve Exp $" +#ident "$Id: pform_dump.cc,v 1.86 2004/05/25 19:21:07 steve Exp $" #endif # include "config.h" @@ -756,7 +756,7 @@ void Module::dump(ostream&out) const out << "/* ERROR */;" << endl; } - typedef map::const_iterator specparm_iter_t; + typedef map::const_iterator specparm_iter_t; for (specparm_iter_t cur = specparams.begin() ; cur != specparams.end() ; cur ++) { out << " specparam " << (*cur).first << " = " @@ -772,7 +772,7 @@ void Module::dump(ostream&out) const out << "/* ERROR */;" << endl; } - for (map::const_iterator cur = events.begin() + for (map::const_iterator cur = events.begin() ; cur != events.end() ; cur ++ ) { PEvent*ev = (*cur).second; out << " event " << ev->name() << "; // " @@ -881,6 +881,9 @@ void PUdp::dump(ostream&out) const /* * $Log: pform_dump.cc,v $ + * Revision 1.86 2004/05/25 19:21:07 steve + * More identifier lists use perm_strings. + * * Revision 1.85 2004/02/20 18:53:35 steve * Addtrbute keys are perm_strings. *