diff --git a/compiler.h b/compiler.h index 0f58e90e3..f4193ec6f 100644 --- a/compiler.h +++ b/compiler.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: compiler.h,v 1.4 2000/08/20 04:13:56 steve Exp $" +#ident "$Id: compiler.h,v 1.5 2000/10/31 17:49:02 steve Exp $" #endif /* @@ -33,6 +33,11 @@ # define INTEGER_WIDTH 32 #endif +/* The TIME_WIDTH is the width of time variables. */ +#ifndef TIME_WIDTH +# define TIME_WIDTH 64 +#endif + /* * When doing dynamic linking, we need a uniform way to identify the * symbol. Some compilers put leading _, some trailing _. The @@ -63,6 +68,9 @@ extern bool warn_implicit; /* * $Log: compiler.h,v $ + * Revision 1.5 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.4 2000/08/20 04:13:56 steve * Add ivl_target support for logic gates, and * make the interface more accessible. diff --git a/elab_lval.cc b/elab_lval.cc index 2d16fc291..ebaa70e20 100644 --- a/elab_lval.cc +++ b/elab_lval.cc @@ -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.5 2000/10/26 17:09:46 steve Exp $" +#ident "$Id: elab_lval.cc,v 1.6 2000/10/31 17:49:02 steve Exp $" #endif # include "PExpr.h" @@ -171,9 +171,12 @@ NetAssign_* PEIdent::elaborate_lval(Design*des, NetScope*scope) const } assert(reg); - if ((reg->type() != NetNet::REG) && (reg->type() != NetNet::INTEGER)) { + if ((reg->type() != NetNet::REG) + && (reg->type() != NetNet::INTEGER) + && (reg->type() != NetNet::TIME)) { cerr << get_line() << ": error: " << name() << - " is not a reg in " << scope->name() << "." << endl; + " is not a reg/integer/time in " << scope->name() << + "." << endl; des->errors += 1; return 0; } @@ -281,6 +284,9 @@ NetAssign_* PEIdent::elaborate_lval(Design*des, NetScope*scope) const /* * $Log: elab_lval.cc,v $ + * Revision 1.6 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.5 2000/10/26 17:09:46 steve * Fix handling of errors in behavioral lvalues. (PR#28) * diff --git a/ivl_target.h b/ivl_target.h index fab645640..fb8949386 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -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.25 2000/10/28 22:32:34 steve Exp $" +#ident "$Id: ivl_target.h,v 1.26 2000/10/31 17:49:02 steve Exp $" #endif #ifdef __cplusplus @@ -185,6 +185,7 @@ 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, @@ -548,6 +549,9 @@ _END_DECL /* * $Log: ivl_target.h,v $ + * Revision 1.26 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.25 2000/10/28 22:32:34 steve * API for concatenation expressions. * diff --git a/netlist.cc b/netlist.cc index d7c650ad1..88ffb8dd6 100644 --- a/netlist.cc +++ b/netlist.cc @@ -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.143 2000/10/28 00:51:42 steve Exp $" +#ident "$Id: netlist.cc,v 1.144 2000/10/31 17:49:02 steve Exp $" #endif # include @@ -46,6 +46,9 @@ 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; @@ -2446,6 +2449,9 @@ bool NetUDP::sequ_glob_(string input, char output) /* * $Log: netlist.cc,v $ + * Revision 1.144 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.143 2000/10/28 00:51:42 steve * Add scope to threads in vvm, pass that scope * to vpi sysTaskFunc objects, and add vpi calls diff --git a/netlist.h b/netlist.h index d3414a8f6..7b92c57bb 100644 --- a/netlist.h +++ b/netlist.h @@ -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.175 2000/10/28 00:51:42 steve Exp $" +#ident "$Id: netlist.h,v 1.176 2000/10/31 17:49:02 steve Exp $" #endif /* @@ -313,7 +313,8 @@ class NetNet : public NetObj, public LineInfo { public: enum Type { IMPLICIT, IMPLICIT_REG, WIRE, TRI, TRI1, SUPPLY0, - WAND, TRIAND, TRI0, SUPPLY1, WOR, TRIOR, REG, INTEGER }; + WAND, TRIAND, TRI0, SUPPLY1, WOR, TRIOR, REG, + INTEGER, TIME }; enum PortType { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT }; @@ -2810,6 +2811,9 @@ extern ostream& operator << (ostream&, NetNet::Type); /* * $Log: netlist.h,v $ + * Revision 1.176 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.175 2000/10/28 00:51:42 steve * Add scope to threads in vvm, pass that scope * to vpi sysTaskFunc objects, and add vpi calls diff --git a/parse.y b/parse.y index 8201cf7c2..e5db6728f 100644 --- a/parse.y +++ b/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.108 2000/10/31 17:00:04 steve Exp $" +#ident "$Id: parse.y,v 1.109 2000/10/31 17:49:02 steve Exp $" #endif # include "parse_misc.h" @@ -210,6 +210,9 @@ block_item_decl | K_integer list_of_variables ';' { pform_set_reg_integer($2); } + | K_time list_of_variables ';' + { pform_set_reg_time($2); + } ; block_item_decls diff --git a/pform.cc b/pform.cc index 6d2dec1c0..7459f4e7b 100644 --- a/pform.cc +++ b/pform.cc @@ -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.65 2000/10/31 17:00:04 steve Exp $" +#ident "$Id: pform.cc,v 1.66 2000/10/31 17:49:02 steve Exp $" #endif # include "compiler.h" @@ -916,6 +916,35 @@ void pform_set_reg_integer(list*names) delete names; } +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); + pform_cur_module->add_wire(cur); + } else { + bool rc = cur->set_wire_type(NetNet::TIME); + assert(rc); + } + assert(cur); + + cur->set_range(new PENumber(new verinum(TIME_WIDTH-1, INTEGER_WIDTH)), + new PENumber(new verinum(0UL, INTEGER_WIDTH))); +} + +void pform_set_reg_time(list*names) +{ + for (list::iterator cur = names->begin() + ; cur != names->end() + ; cur ++ ) { + char*txt = *cur; + pform_set_reg_time(txt); + free(txt); + } + delete names; +} + svector* pform_make_udp_input_ports(list*names) { svector*out = new svector(names->size()); @@ -973,6 +1002,9 @@ int pform_parse(const char*path, map&modules, /* * $Log: pform.cc,v $ + * Revision 1.66 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.65 2000/10/31 17:00:04 steve * Remove C++ string from variable lists. * diff --git a/pform.h b/pform.h index fc242d6a3..b3ca5c76f 100644 --- a/pform.h +++ b/pform.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: pform.h,v 1.42 2000/10/31 17:00:05 steve Exp $" +#ident "$Id: pform.h,v 1.43 2000/10/31 17:49:02 steve Exp $" #endif # include "netlist.h" @@ -140,6 +140,7 @@ extern void pform_set_port_type(list*names, svector*, extern void pform_set_net_range(list*names, svector*); extern void pform_set_reg_idx(const string&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_task(const string&, PTask*); extern void pform_set_function(const string&, svector*, PFunction*); extern void pform_set_attrib(const string&name, const string&key, @@ -202,6 +203,9 @@ extern void pform_dump(ostream&out, Module*mod); /* * $Log: pform.h,v $ + * Revision 1.43 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.42 2000/10/31 17:00:05 steve * Remove C++ string from variable lists. * diff --git a/t-dll.cc b/t-dll.cc index ec60a169e..9e420c61d 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -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.16 2000/10/21 16:49:45 steve Exp $" +#ident "$Id: t-dll.cc,v 1.17 2000/10/31 17:49:02 steve Exp $" #endif # include "compiler.h" @@ -407,6 +407,10 @@ 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; @@ -494,6 +498,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.17 2000/10/31 17:49:02 steve + * Support time variables. + * * Revision 1.16 2000/10/21 16:49:45 steve * Reduce the target entry points to the target_design. *