Permalink
Browse files

declaration initialization for time variables.

  • Loading branch information...
steve
steve committed Jan 6, 2001
1 parent 14c67a5 commit cc18d065aa187fef6cc59a77136f68106c2284b1
Showing with 69 additions and 23 deletions.
  1. +5 −2 elab_lval.cc
  2. +4 −2 ivl_target.h
  3. +4 −4 netlist.cc
  4. +5 −2 netlist.h
  5. +41 −5 parse.y
  6. +6 −3 pform.cc
  7. +4 −5 t-dll.cc
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: elab_lval.cc,v 1.9 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: elab_lval.cc,v 1.10 2001/01/06 06:31:58 steve Exp $"
#endif
# include "PExpr.h"
@@ -178,7 +178,7 @@ NetAssign_* PEIdent::elaborate_lval(Design*des, NetScope*scope) const
}
assert(reg);
- if ((reg->type() != NetNet::REG) && (reg->type() != NetNet::TIME)) {
+ if (reg->type() != NetNet::REG) {
cerr << get_line() << ": error: " << name() <<
" is not a reg/integer/time in " << scope->name() <<
"." << endl;
@@ -306,6 +306,9 @@ NetAssign_* PEIdent::elaborate_lval(Design*des, NetScope*scope) const
/*
* $Log: elab_lval.cc,v $
+ * Revision 1.10 2001/01/06 06:31:58 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.9 2001/01/06 02:29:36 steve
* Support arrays of integers.
*
View
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: ivl_target.h,v 1.30 2000/12/05 06:29:33 steve Exp $"
+#ident "$Id: ivl_target.h,v 1.31 2001/01/06 06:31:58 steve Exp $"
#endif
#ifdef __cplusplus
@@ -207,7 +207,6 @@ typedef enum ivl_signal_type_e {
IVL_SIT_REG,
IVL_SIT_SUPPLY0,
IVL_SIT_SUPPLY1,
- IVL_SIT_TIME,
IVL_SIT_TRI,
IVL_SIT_TRI0,
IVL_SIT_TRI1,
@@ -645,6 +644,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
+ * Revision 1.31 2001/01/06 06:31:58 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.30 2000/12/05 06:29:33 steve
* Make signal attributes available to ivl_target API.
*
View
@@ -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.152 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: netlist.cc,v 1.153 2001/01/06 06:31:58 steve Exp $"
#endif
# include <cassert>
@@ -43,9 +43,6 @@ ostream& operator<< (ostream&o, NetNet::Type t)
case NetNet::SUPPLY1:
o << "supply1";
break;
- case NetNet::TIME:
- o << "time";
- break;
case NetNet::TRI:
o << "tri";
break;
@@ -2475,6 +2472,9 @@ bool NetUDP::sequ_glob_(string input, char output)
/*
* $Log: netlist.cc,v $
+ * Revision 1.153 2001/01/06 06:31:58 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.152 2001/01/06 02:29:36 steve
* Support arrays of integers.
*
View
@@ -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.192 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: netlist.h,v 1.193 2001/01/06 06:31:58 steve Exp $"
#endif
/*
@@ -321,7 +321,7 @@ class NetNet : public NetObj, public LineInfo {
public:
enum Type { IMPLICIT, IMPLICIT_REG, WIRE, TRI, TRI1, SUPPLY0,
- SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG, TIME };
+ SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG };
enum PortType { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT };
@@ -2846,6 +2846,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
+ * Revision 1.193 2001/01/06 06:31:58 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.192 2001/01/06 02:29:36 steve
* Support arrays of integers.
*
View
46 parse.y
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: parse.y,v 1.115 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: parse.y,v 1.116 2001/01/06 06:31:59 steve Exp $"
#endif
# include "parse_misc.h"
@@ -209,7 +209,7 @@ block_item_decl
| K_integer register_variable_list ';'
{ pform_set_reg_integer($2);
}
- | K_time list_of_variables ';'
+ | K_time register_variable_list ';'
{ pform_set_reg_time($2);
}
| K_real list_of_variables ';'
@@ -220,6 +220,30 @@ block_item_decl
{ delete $2;
yyerror(@1, "sorry: reatime variables not supported.");
}
+
+ /* Recover from errors that happen within variable lists. Use the
+ trailing semi-colon to resync the parser. */
+
+ | K_reg error ';'
+ { yyerror(@1, "error: syntax error in reg variable list.");
+ yyerrok;
+ }
+ | K_integer error ';'
+ { yyerror(@1, "error: syntax error in integer variable list.");
+ yyerrok;
+ }
+ | K_time error ';'
+ { yyerror(@1, "error: syntax error in time variable list.");
+ yyerrok;
+ }
+ | K_real error ';'
+ { yyerror(@1, "error: syntax error in real variable list.");
+ yyerrok;
+ }
+ | K_realtime error ';'
+ { yyerror(@1, "error: syntax error in realtime variable list.");
+ yyerrok;
+ }
;
block_item_decls
@@ -1225,8 +1249,6 @@ module_item
| K_assign drive_strength_opt delay3_opt assign_list ';'
{ pform_make_pgassign_list($4, $3, $2, @1.text, @1.first_line); }
- | K_assign error '=' expression ';'
-
| K_always statement
{ PProcess*tmp = pform_make_behavior(PProcess::PR_ALWAYS, $2);
tmp->set_file(@1.text);
@@ -1278,13 +1300,27 @@ module_item
{
}
- /* These rules match various errors that the user can type. */
+ /* These rules match various errors that the user can type into
+ module items. These rules try to catch them at a point where a
+ reasonable error message can be produced. */
| error
{ yyerror(@1, "error: invalid module item. "
"Did you forget an initial or always?");
}
+ | K_assign error '=' expression ';'
+ { yyerror(@1, "error: syntax error in left side "
+ "of continuous assignment.");
+ yyerrok;
+ }
+
+ | K_assign error ';'
+ { yyerror(@1, "error: syntax error in "
+ "continuous assignment");
+ yyerrok;
+ }
+
/* These rules are for the Icarus VErilog specific $attribute
extensions. Then catch the parameters of the $attribute keyword. */
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: pform.cc,v 1.69 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: pform.cc,v 1.70 2001/01/06 06:31:59 steve Exp $"
#endif
# include "compiler.h"
@@ -929,10 +929,10 @@ static void pform_set_reg_time(const char*nm)
string name = scoped_name(nm);
PWire*cur = pform_cur_module->get_wire(name);
if (cur == 0) {
- cur = new PWire(name, NetNet::TIME, NetNet::NOT_A_PORT);
+ cur = new PWire(name, NetNet::REG, NetNet::NOT_A_PORT);
pform_cur_module->add_wire(cur);
} else {
- bool rc = cur->set_wire_type(NetNet::TIME);
+ bool rc = cur->set_wire_type(NetNet::REG);
assert(rc);
}
assert(cur);
@@ -1010,6 +1010,9 @@ int pform_parse(const char*path, map<string,Module*>&modules,
/*
* $Log: pform.cc,v $
+ * Revision 1.70 2001/01/06 06:31:59 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.69 2001/01/06 02:29:36 steve
* Support arrays of integers.
*
View
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
-#ident "$Id: t-dll.cc,v 1.24 2001/01/06 02:29:36 steve Exp $"
+#ident "$Id: t-dll.cc,v 1.25 2001/01/06 06:31:59 steve Exp $"
#endif
# include "compiler.h"
@@ -544,10 +544,6 @@ void dll_target::signal(const NetNet*net)
obj->type_ = IVL_SIT_SUPPLY1;
break;
- case NetNet::TIME:
- obj->type_ = IVL_SIT_TIME;
- break;
-
case NetNet::TRI:
obj->type_ = IVL_SIT_TRI;
break;
@@ -643,6 +639,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
+ * Revision 1.25 2001/01/06 06:31:59 steve
+ * declaration initialization for time variables.
+ *
* Revision 1.24 2001/01/06 02:29:36 steve
* Support arrays of integers.
*

0 comments on commit cc18d06

Please sign in to comment.