Support time variables.
This commit is contained in:
parent
88c8547486
commit
3591e06c4e
10
compiler.h
10
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.
|
||||
|
|
|
|||
12
elab_lval.cc
12
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)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 <cassert>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
5
parse.y
5
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
|
||||
|
|
|
|||
34
pform.cc
34
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<char*>*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<char*>*names)
|
||||
{
|
||||
for (list<char*>::iterator cur = names->begin()
|
||||
; cur != names->end()
|
||||
; cur ++ ) {
|
||||
char*txt = *cur;
|
||||
pform_set_reg_time(txt);
|
||||
free(txt);
|
||||
}
|
||||
delete names;
|
||||
}
|
||||
|
||||
svector<PWire*>* pform_make_udp_input_ports(list<char*>*names)
|
||||
{
|
||||
svector<PWire*>*out = new svector<PWire*>(names->size());
|
||||
|
|
@ -973,6 +1002,9 @@ int pform_parse(const char*path, map<string,Module*>&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.
|
||||
*
|
||||
|
|
|
|||
6
pform.h
6
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<char*>*names, svector<PExpr*>*,
|
|||
extern void pform_set_net_range(list<char*>*names, svector<PExpr*>*);
|
||||
extern void pform_set_reg_idx(const string&name, PExpr*l, PExpr*r);
|
||||
extern void pform_set_reg_integer(list<char*>*names);
|
||||
extern void pform_set_reg_time(list<char*>*names);
|
||||
extern void pform_set_task(const string&, PTask*);
|
||||
extern void pform_set_function(const string&, svector<PExpr*>*, 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.
|
||||
*
|
||||
|
|
|
|||
9
t-dll.cc
9
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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue