Permalink
Browse files

Addtrbute keys are perm_strings.

  • Loading branch information...
1 parent 1295058 commit 177b6ffb6a2152ecad053c0f3dd50e0cade33dce steve committed Feb 20, 2004
Showing with 166 additions and 113 deletions.
  1. +8 −22 Attrib.cc
  2. +9 −6 Attrib.h
  3. +5 −2 Module.h
  4. +5 −2 PGate.h
  5. +5 −2 PWire.h
  6. +6 −2 Statement.h
  7. +5 −2 cprop.cc
  8. +7 −4 elab_net.cc
  9. +6 −2 elaborate.cc
  10. +7 −4 eval_attrib.cc
  11. +6 −3 expr_synth.cc
  12. +6 −3 netmisc.cc
  13. +5 −2 nodangle.cc
  14. +3 −2 parse.y
  15. +10 −7 pform.cc
  16. +5 −2 pform.h
  17. +8 −5 pform_dump.cc
  18. +4 −4 syn-rules.y
  19. +10 −7 synth2.cc
  20. +6 −3 t-dll.cc
  21. +11 −8 t-xnf.cc
  22. +8 −5 util.h
  23. +21 −14 xnfio.cc
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: Attrib.cc,v 1.5 2002/08/12 01:34:58 steve Exp $"
+#ident "$Id: Attrib.cc,v 1.6 2004/02/20 18:53:33 steve Exp $"
#endif
# include "config.h"
@@ -36,25 +36,8 @@ Attrib::~Attrib()
delete[] list_;
}
-#if 0
-void Attrib::copy_attributes(const map<string,verinum>&attr)
-{
- assert(list_ == 0);
-
- nlist_ = attr.size();
- list_ = new cell_[nlist_];
- map<string,verinum>::const_iterator idx;
- unsigned jdx;
- for (idx = attr.begin(), jdx = 0 ; idx != attr.end() ; idx ++, jdx++) {
- struct cell_*tmp = list_ + jdx;
- tmp->key = (*idx).first;
- tmp->val = (*idx).second;
- }
-}
-#endif
-
-const verinum& Attrib::attribute(const string&key) const
+const verinum& Attrib::attribute(perm_string key) const
{
for (unsigned idx = 0 ; idx < nlist_ ; idx += 1) {
@@ -66,7 +49,7 @@ const verinum& Attrib::attribute(const string&key) const
return null;
}
-void Attrib::attribute(const string&key, const verinum&value)
+void Attrib::attribute(perm_string key, const verinum&value)
{
unsigned idx;
@@ -108,10 +91,10 @@ unsigned Attrib::attr_cnt() const
return nlist_;
}
-const char* Attrib::attr_key(unsigned idx) const
+perm_string Attrib::attr_key(unsigned idx) const
{
assert(idx < nlist_);
- return list_[idx].key.c_str();
+ return list_[idx].key;
}
const verinum& Attrib::attr_value(unsigned idx) const
@@ -123,6 +106,9 @@ const verinum& Attrib::attr_value(unsigned idx) const
/*
* $Log: Attrib.cc,v $
+ * Revision 1.6 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.5 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
View
@@ -19,10 +19,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: Attrib.h,v 1.4 2002/08/12 01:34:58 steve Exp $"
+#ident "$Id: Attrib.h,v 1.5 2004/02/20 18:53:33 steve Exp $"
#endif
-# include <string>
+# include "StringHeap.h"
# include "verinum.h"
/*
@@ -35,20 +35,20 @@ class Attrib {
Attrib();
~Attrib();
- const verinum&attribute(const string&key) const;
- void attribute(const string&key, const verinum&value);
+ const verinum&attribute(perm_string key) const;
+ void attribute(perm_string key, const verinum&value);
bool has_compat_attributes(const Attrib&that) const;
/* Provide a means of iterating over the entries in the map. */
unsigned attr_cnt() const;
- const char* attr_key(unsigned idx) const;
+ perm_string attr_key(unsigned idx) const;
const verinum& attr_value(unsigned idx) const;
private:
struct cell_ {
- string key;
+ perm_string key;
verinum val;
};
@@ -62,6 +62,9 @@ class Attrib {
/*
* $Log: Attrib.h,v $
+ * Revision 1.5 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.4 2002/08/12 01:34:58 steve
* conditional ident string using autoconfig.
*
View
@@ -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.34 2004/02/20 06:22:56 steve Exp $"
+#ident "$Id: Module.h,v 1.35 2004/02/20 18:53:33 steve Exp $"
#endif
# include <list>
@@ -110,7 +110,7 @@ class Module : public LineInfo {
/* Keep a table of datum variables declared in the module. */
map<hname_t,PData*>datum;
- map<string,PExpr*> attributes;
+ map<perm_string,PExpr*> attributes;
/* These are the timescale for this module. The default is
set by the `timescale directive. */
@@ -166,6 +166,9 @@ class Module : public LineInfo {
/*
* $Log: Module.h,v $
+ * Revision 1.35 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.34 2004/02/20 06:22:56 steve
* parameter keys are per_strings.
*
View
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: PGate.h,v 1.26 2004/02/18 17:11:54 steve Exp $"
+#ident "$Id: PGate.h,v 1.27 2004/02/20 18:53:33 steve Exp $"
#endif
# include "svector.h"
@@ -80,7 +80,7 @@ class PGate : public LineInfo {
void strength0(strength_t);
void strength1(strength_t);
- map<string,PExpr*> attributes;
+ map<perm_string,PExpr*> attributes;
virtual void dump(ostream&out) const;
virtual void elaborate(Design*des, NetScope*scope) const;
@@ -227,6 +227,9 @@ class PGModule : public PGate {
/*
* $Log: PGate.h,v $
+ * Revision 1.27 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.26 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
View
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: PWire.h,v 1.16 2003/01/30 16:23:07 steve Exp $"
+#ident "$Id: PWire.h,v 1.17 2004/02/20 18:53:33 steve Exp $"
#endif
# include "netlist.h"
@@ -69,7 +69,7 @@ class PWire : public LineInfo {
void set_memory_idx(PExpr*ldx, PExpr*rdx);
- map<string,PExpr*> attributes;
+ map<perm_string,PExpr*> attributes;
// Write myself to the specified stream.
void dump(ostream&out) const;
@@ -100,6 +100,9 @@ class PWire : public LineInfo {
/*
* $Log: PWire.h,v $
+ * Revision 1.17 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.16 2003/01/30 16:23:07 steve
* Spelling fixes.
*
View
@@ -19,11 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: Statement.h,v 1.39 2004/02/18 17:11:54 steve Exp $"
+#ident "$Id: Statement.h,v 1.40 2004/02/20 18:53:33 steve Exp $"
#endif
# include <string>
# include "svector.h"
+# include "StringHeap.h"
# include "PDelays.h"
# include "PExpr.h"
# include "HName.h"
@@ -56,7 +57,7 @@ class PProcess : public LineInfo {
Type type() const { return type_; }
Statement*statement() { return statement_; }
- map<string,PExpr*> attributes;
+ map<perm_string,PExpr*> attributes;
virtual void dump(ostream&out, unsigned ind) const;
@@ -455,6 +456,9 @@ class PWhile : public Statement {
/*
* $Log: Statement.h,v $
+ * Revision 1.40 2004/02/20 18:53:33 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.39 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: cprop.cc,v 1.46 2003/11/08 17:53:34 steve Exp $"
+#ident "$Id: cprop.cc,v 1.47 2004/02/20 18:53:34 steve Exp $"
#endif
# include "config.h"
@@ -56,7 +56,7 @@ void cprop_functor::signal(Design*des, NetNet*obj)
void cprop_functor::lpm_add_sub(Design*des, NetAddSub*obj)
{
// For now, only additions are handled.
- if (obj->attribute("LPM_Direction") != verinum("ADD"))
+ if (obj->attribute(perm_string::literal("LPM_Direction")) != verinum("ADD"))
return;
// If the low bit on the A side is 0, then eliminate it from
@@ -1038,6 +1038,9 @@ void cprop(Design*des)
/*
* $Log: cprop.cc,v $
+ * Revision 1.47 2004/02/20 18:53:34 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.46 2003/11/08 17:53:34 steve
* Do not remove constants accessible to VPI.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: elab_net.cc,v 1.124 2004/02/18 17:11:54 steve Exp $"
+#ident "$Id: elab_net.cc,v 1.125 2004/02/20 18:53:34 steve Exp $"
#endif
# include "config.h"
@@ -246,10 +246,10 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
switch (op_) {
case '+':
- gate->attribute("LPM_Direction", verinum("ADD"));
+ gate->attribute(perm_string::literal("LPM_Direction"), verinum("ADD"));
break;
case '-':
- gate->attribute("LPM_Direction", verinum("SUB"));
+ gate->attribute(perm_string::literal("LPM_Direction"), verinum("SUB"));
break;
}
@@ -2386,7 +2386,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
default:
NetAddSub*sub = new NetAddSub(scope, scope->local_symbol(),
sig->pin_count());
- sub->attribute("LPM_Direction", verinum("SUB"));
+ sub->attribute(perm_string::literal("LPM_Direction"), verinum("SUB"));
des->add_node(sub);
@@ -2426,6 +2426,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/*
* $Log: elab_net.cc,v $
+ * Revision 1.125 2004/02/20 18:53:34 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.124 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: elaborate.cc,v 1.296 2004/02/18 17:11:55 steve Exp $"
+#ident "$Id: elaborate.cc,v 1.297 2004/02/20 18:53:34 steve Exp $"
#endif
# include "config.h"
@@ -2516,7 +2516,8 @@ bool Module::elaborate(Design*des, NetScope*scope) const
if (! anyedge_test)
break;
- top->attribute("_ivl_schedule_push", verinum(1));
+ top->attribute(perm_string::literal("_ivl_schedule_push"),
+ verinum(1));
} while (0);
}
@@ -2626,6 +2627,9 @@ Design* elaborate(list<perm_string>roots)
/*
* $Log: elaborate.cc,v $
+ * Revision 1.297 2004/02/20 18:53:34 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.296 2004/02/18 17:11:55 steve
* Use perm_strings for named langiage items.
*
View
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002 Stephen Williams (steve@icarus.com)
+ * Copyright (c) 2002-2004 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: eval_attrib.cc,v 1.6 2003/01/27 05:09:17 steve Exp $"
+#ident "$Id: eval_attrib.cc,v 1.7 2004/02/20 18:53:35 steve Exp $"
#endif
# include "config.h"
@@ -33,7 +33,7 @@
* for passing to netlist devices.
*/
-attrib_list_t* evaluate_attributes(const map<string,PExpr*>&att,
+attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
unsigned&natt,
const Design*des,
const NetScope*scope)
@@ -46,7 +46,7 @@ attrib_list_t* evaluate_attributes(const map<string,PExpr*>&att,
unsigned idx = 0;
- typedef map<string,PExpr*>::const_iterator iter_t;
+ typedef map<perm_string,PExpr*>::const_iterator iter_t;
for (iter_t cur = att.begin() ; cur != att.end() ; cur ++, idx++) {
table[idx].key = (*cur).first;
PExpr*exp = (*cur).second;
@@ -74,6 +74,9 @@ attrib_list_t* evaluate_attributes(const map<string,PExpr*>&att,
/*
* $Log: eval_attrib.cc,v $
+ * Revision 1.7 2004/02/20 18:53:35 steve
+ * Addtrbute keys are perm_strings.
+ *
* Revision 1.6 2003/01/27 05:09:17 steve
* Spelling fixes.
*
Oops, something went wrong.

0 comments on commit 177b6ff

Please sign in to comment.