Carry integerness throughout the compilation.

This commit is contained in:
steve 2002-06-21 04:59:35 +00:00
parent f4a4ee00d0
commit 5eca5d9948
16 changed files with 173 additions and 57 deletions

View File

@ -17,22 +17,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PWire.cc,v 1.8 2002/01/26 05:28:28 steve Exp $" #ident "$Id: PWire.cc,v 1.9 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
# include "PWire.h" # include "PWire.h"
# include <assert.h> # include <assert.h>
PWire::PWire(const hname_t&n, NetNet::Type t, NetNet::PortType pt) PWire::PWire(const hname_t&n, NetNet::Type t, NetNet::PortType pt)
: hname_(n), type_(t), port_type_(pt), signed_(false), lidx_(0), ridx_(0) : hname_(n), type_(t), port_type_(pt), signed_(false), isint_(false),
lidx_(0), ridx_(0)
{ {
if (t == NetNet::INTEGER) {
type_ = NetNet::REG;
signed_ = true;
isint_ = true;
}
} }
PWire::PWire(char*n, NetNet::Type t, NetNet::PortType pt) PWire::PWire(char*n, NetNet::Type t, NetNet::PortType pt)
: hname_(n), type_(t), port_type_(pt), signed_(false), lidx_(0), ridx_(0) : hname_(n), type_(t), port_type_(pt), signed_(false), isint_(false),
lidx_(0), ridx_(0)
{ {
if (t == NetNet::INTEGER) {
type_ = NetNet::REG;
signed_ = true;
isint_ = true;
}
} }
NetNet::Type PWire::get_wire_type() const NetNet::Type PWire::get_wire_type() const
@ -57,6 +68,10 @@ bool PWire::set_wire_type(NetNet::Type t)
if (t == NetNet::REG) { type_ = t; return true; } if (t == NetNet::REG) { type_ = t; return true; }
return false; return false;
case NetNet::REG: case NetNet::REG:
if (t == NetNet::INTEGER) {
isint_ = true;
return true;
}
if (t == NetNet::REG) return true; if (t == NetNet::REG) return true;
return false; return false;
default: default:
@ -103,6 +118,11 @@ bool PWire::get_signed() const
return signed_; return signed_;
} }
bool PWire::get_isint() const
{
return isint_;
}
void PWire::set_range(PExpr*m, PExpr*l) void PWire::set_range(PExpr*m, PExpr*l)
{ {
msb_ = svector<PExpr*>(msb_,m); msb_ = svector<PExpr*>(msb_,m);
@ -120,6 +140,9 @@ void PWire::set_memory_idx(PExpr*ldx, PExpr*rdx)
/* /*
* $Log: PWire.cc,v $ * $Log: PWire.cc,v $
* Revision 1.9 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.8 2002/01/26 05:28:28 steve * Revision 1.8 2002/01/26 05:28:28 steve
* Detect scalar/vector declarion mismatch. * Detect scalar/vector declarion mismatch.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PWire.h,v 1.12 2002/05/23 03:08:51 steve Exp $" #ident "$Id: PWire.h,v 1.13 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "netlist.h" # include "netlist.h"
@ -64,6 +64,7 @@ class PWire : public LineInfo {
void set_signed(bool flag); void set_signed(bool flag);
bool get_signed() const; bool get_signed() const;
bool get_isint() const;
void set_range(PExpr*msb, PExpr*lsb); void set_range(PExpr*msb, PExpr*lsb);
@ -81,6 +82,7 @@ class PWire : public LineInfo {
NetNet::Type type_; NetNet::Type type_;
NetNet::PortType port_type_; NetNet::PortType port_type_;
bool signed_; bool signed_;
bool isint_; // original type of integer
// These members hold expressions for the bit width of the // These members hold expressions for the bit width of the
// wire. If they do not exist, the wire is 1 bit wide. // wire. If they do not exist, the wire is 1 bit wide.
@ -99,6 +101,9 @@ class PWire : public LineInfo {
/* /*
* $Log: PWire.h,v $ * $Log: PWire.h,v $
* Revision 1.13 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.12 2002/05/23 03:08:51 steve * Revision 1.12 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute * Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute * syntax. Hook this support into existing $attribute

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_sig.cc,v 1.22 2002/05/23 03:08:51 steve Exp $" #ident "$Id: elab_sig.cc,v 1.23 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -517,6 +517,7 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
sig->set_line(*this); sig->set_line(*this);
sig->port_type(port_type_); sig->port_type(port_type_);
sig->set_signed(get_signed()); sig->set_signed(get_signed());
sig->set_isint(get_isint());
for (unsigned idx = 0 ; idx < nattrib ; idx += 1) for (unsigned idx = 0 ; idx < nattrib ; idx += 1)
sig->attribute(attrib_list[idx].key, attrib_list[idx].val); sig->attribute(attrib_list[idx].key, attrib_list[idx].val);
@ -525,6 +526,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/* /*
* $Log: elab_sig.cc,v $ * $Log: elab_sig.cc,v $
* Revision 1.23 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.22 2002/05/23 03:08:51 steve * Revision 1.22 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute * Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute * syntax. Hook this support into existing $attribute

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: ivl_target.h,v 1.99 2002/06/11 03:34:33 steve Exp $" #ident "$Id: ivl_target.h,v 1.100 2002/06/21 04:59:35 steve Exp $"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -913,6 +913,7 @@ extern ivl_nexus_t ivl_signal_pin(ivl_signal_t net, unsigned idx);
extern unsigned ivl_signal_pins(ivl_signal_t net); extern unsigned ivl_signal_pins(ivl_signal_t net);
extern ivl_signal_port_t ivl_signal_port(ivl_signal_t net); extern ivl_signal_port_t ivl_signal_port(ivl_signal_t net);
extern int ivl_signal_signed(ivl_signal_t net); extern int ivl_signal_signed(ivl_signal_t net);
extern int ivl_signal_integer(ivl_signal_t net);
extern ivl_signal_type_t ivl_signal_type(ivl_signal_t net); extern ivl_signal_type_t ivl_signal_type(ivl_signal_t net);
extern const char* ivl_signal_name(ivl_signal_t net); extern const char* ivl_signal_name(ivl_signal_t net);
extern const char* ivl_signal_basename(ivl_signal_t net); extern const char* ivl_signal_basename(ivl_signal_t net);
@ -1050,6 +1051,9 @@ _END_DECL
/* /*
* $Log: ivl_target.h,v $ * $Log: ivl_target.h,v $
* Revision 1.100 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.99 2002/06/11 03:34:33 steve * Revision 1.99 2002/06/11 03:34:33 steve
* Spelling patch (Larry Doolittle) * Spelling patch (Larry Doolittle)
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.cc,v 1.191 2002/06/19 04:20:03 steve Exp $" #ident "$Id: netlist.cc,v 1.192 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -383,6 +383,16 @@ void NetNet::set_signed(bool flag)
signed_ = flag; signed_ = flag;
} }
bool NetNet::get_isint() const
{
return isint_;
}
void NetNet::set_isint(bool flag)
{
isint_ = flag;
}
long NetNet::lsb() const long NetNet::lsb() const
{ {
return lsb_; return lsb_;
@ -2332,6 +2342,9 @@ const NetProc*NetTaskDef::proc() const
/* /*
* $Log: netlist.cc,v $ * $Log: netlist.cc,v $
* Revision 1.192 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.191 2002/06/19 04:20:03 steve * Revision 1.191 2002/06/19 04:20:03 steve
* Remove NetTmp and add NetSubnet class. * Remove NetTmp and add NetSubnet class.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.h,v 1.243 2002/06/19 04:20:03 steve Exp $" #ident "$Id: netlist.h,v 1.244 2002/06/21 04:59:35 steve Exp $"
#endif #endif
/* /*
@ -323,8 +323,7 @@ class NetNode : public NetObj {
* NetNet. NetNet objects also appear as side effects of synthesis or * NetNet. NetNet objects also appear as side effects of synthesis or
* other abstractions. * other abstractions.
* *
* Note that there are no INTEGER types. Express a verilog integer as * Note that INTEGER types are an alias for a ``reg signed [31:0]''.
* a ``reg signed'' instead. The parser automatically does this for us.
* *
* NetNet objects have a name and exist within a scope, so the * NetNet objects have a name and exist within a scope, so the
* constructor takes a pointer to the containing scope. The object * constructor takes a pointer to the containing scope. The object
@ -339,7 +338,7 @@ class NetNode : public NetObj {
class NetNet : public NetObj, public LineInfo { class NetNet : public NetObj, public LineInfo {
public: public:
enum Type { IMPLICIT, IMPLICIT_REG, WIRE, TRI, TRI1, SUPPLY0, enum Type { IMPLICIT, IMPLICIT_REG, INTEGER, WIRE, TRI, TRI1, SUPPLY0,
SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG }; SUPPLY1, WAND, TRIAND, TRI0, WOR, TRIOR, REG };
enum PortType { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT }; enum PortType { NOT_A_PORT, PIMPLICIT, PINPUT, POUTPUT, PINOUT };
@ -360,6 +359,11 @@ class NetNet : public NetObj, public LineInfo {
bool get_signed() const; bool get_signed() const;
void set_signed(bool); void set_signed(bool);
/* Used to maintain original type of net since integers are
implemented as 'reg signed [31;0]' in Icarus */
bool get_isint() const;
void set_isint(bool);
/* These methods return the msb and lsb indices for the most /* These methods return the msb and lsb indices for the most
significant and least significant bits. These are signed significant and least significant bits. These are signed
longs, and may be different from pin numbers. For example, longs, and may be different from pin numbers. For example,
@ -399,6 +403,7 @@ class NetNet : public NetObj, public LineInfo {
Type type_; Type type_;
PortType port_type_; PortType port_type_;
bool signed_; bool signed_;
bool isint_; // original type of integer
long msb_, lsb_; long msb_, lsb_;
@ -2924,6 +2929,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/* /*
* $Log: netlist.h,v $ * $Log: netlist.h,v $
* Revision 1.244 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.243 2002/06/19 04:20:03 steve * Revision 1.243 2002/06/19 04:20:03 steve
* Remove NetTmp and add NetSubnet class. * Remove NetTmp and add NetSubnet class.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: parse.y,v 1.156 2002/06/11 13:58:04 steve Exp $" #ident "$Id: parse.y,v 1.157 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -1960,7 +1960,7 @@ range_opt
/* This is used to express the return type of a function. */ /* This is used to express the return type of a function. */
range_or_type_opt range_or_type_opt
: range { $$.range = $1; $$.ntype = NetNet::REG; } : range { $$.range = $1; $$.ntype = NetNet::REG; }
| K_integer { $$.range = 0; $$.ntype = NetNet::IMPLICIT_REG; } | K_integer { $$.range = 0; $$.ntype = NetNet::INTEGER; }
| K_real { $$.range = 0; $$.ntype = NetNet::IMPLICIT; } | K_real { $$.range = 0; $$.ntype = NetNet::IMPLICIT; }
| K_realtime { $$.range = 0; $$.ntype = NetNet::IMPLICIT; } | K_realtime { $$.range = 0; $$.ntype = NetNet::IMPLICIT; }
| K_time { $$.range = 0; $$.ntype = NetNet::IMPLICIT; } | K_time { $$.range = 0; $$.ntype = NetNet::IMPLICIT; }

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: pform.cc,v 1.98 2002/05/26 01:39:02 steve Exp $" #ident "$Id: pform.cc,v 1.99 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -1104,13 +1104,9 @@ void pform_set_function(const char*name, NetNet::Type ntype,
delete ra; delete ra;
} }
/* If the return type of the function is INTEGER, then convert /* If the return type of the function is INTEGER, then
it to a signed reg, and generate a range for it. The generate a range for it. */
parse.y uses IMPLICIT_REG as a signal that this is an if (ntype == NetNet::INTEGER) {
integer, because there is no such thing as
NetNet::INTEGER. */
if (ntype == NetNet::IMPLICIT_REG) {
out->set_wire_type(NetNet::REG);
out->set_signed(true); out->set_signed(true);
out->set_range(new PENumber(new verinum(INTEGER_WIDTH-1, INTEGER_WIDTH)), out->set_range(new PENumber(new verinum(INTEGER_WIDTH-1, INTEGER_WIDTH)),
new PENumber(new verinum(0UL, INTEGER_WIDTH))); new PENumber(new verinum(0UL, INTEGER_WIDTH)));
@ -1214,11 +1210,11 @@ static void pform_set_reg_integer(const char*nm)
hname_t name = hier_name(nm); hname_t name = hier_name(nm);
PWire*cur = pform_cur_module->get_wire(name); PWire*cur = pform_cur_module->get_wire(name);
if (cur == 0) { if (cur == 0) {
cur = new PWire(name, NetNet::REG, NetNet::NOT_A_PORT); cur = new PWire(name, NetNet::INTEGER, NetNet::NOT_A_PORT);
cur->set_signed(true); cur->set_signed(true);
pform_cur_module->add_wire(cur); pform_cur_module->add_wire(cur);
} else { } else {
bool rc = cur->set_wire_type(NetNet::REG); bool rc = cur->set_wire_type(NetNet::INTEGER);
assert(rc); assert(rc);
cur->set_signed(true); cur->set_signed(true);
} }
@ -1347,6 +1343,9 @@ int pform_parse(const char*path, FILE*file)
/* /*
* $Log: pform.cc,v $ * $Log: pform.cc,v $
* Revision 1.99 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.98 2002/05/26 01:39:02 steve * Revision 1.98 2002/05/26 01:39:02 steve
* Carry Verilog 2001 attributes with processes, * Carry Verilog 2001 attributes with processes,
* all the way through to the ivl_target API. * all the way through to the ivl_target API.

View File

@ -17,11 +17,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll-api.cc,v 1.81 2002/05/27 00:08:45 steve Exp $" #ident "$Id: t-dll-api.cc,v 1.82 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
# include "t-dll.h" # include "t-dll.h"
/* THE FOLLOWING ARE FUNCTIONS THAT ARE CALLED FROM THE TARGET. */ /* THE FOLLOWING ARE FUNCTIONS THAT ARE CALLED FROM THE TARGET. */
@ -143,7 +142,7 @@ extern "C" unsigned ivl_const_pins(ivl_net_const_t net)
extern "C" int ivl_const_signed(ivl_net_const_t net) extern "C" int ivl_const_signed(ivl_net_const_t net)
{ {
assert(net); assert(net);
return net->signed_ == 1; return net->signed_;
} }
extern "C" const char* ivl_event_name(ivl_event_t net) extern "C" const char* ivl_event_name(ivl_event_t net)
@ -1197,7 +1196,12 @@ extern "C" ivl_signal_port_t ivl_signal_port(ivl_signal_t net)
extern "C" int ivl_signal_signed(ivl_signal_t net) extern "C" int ivl_signal_signed(ivl_signal_t net)
{ {
return net->signed_ != 0; return net->signed_;
}
extern "C" int ivl_signal_integer(ivl_signal_t net)
{
return net->isint_;
} }
extern "C" ivl_signal_type_t ivl_signal_type(ivl_signal_t net) extern "C" ivl_signal_type_t ivl_signal_type(ivl_signal_t net)
@ -1543,6 +1547,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
/* /*
* $Log: t-dll-api.cc,v $ * $Log: t-dll-api.cc,v $
* Revision 1.82 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.81 2002/05/27 00:08:45 steve * Revision 1.81 2002/05/27 00:08:45 steve
* Support carrying the scope of named begin-end * Support carrying the scope of named begin-end
* blocks down to the code generator, and have * blocks down to the code generator, and have

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.cc,v 1.85 2002/06/16 19:19:16 steve Exp $" #ident "$Id: t-dll.cc,v 1.86 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -1823,6 +1823,7 @@ void dll_target::signal(const NetNet*net)
obj->signed_= net->get_signed()? 1 : 0; obj->signed_= net->get_signed()? 1 : 0;
obj->lsb_index = net->lsb(); obj->lsb_index = net->lsb();
obj->lsb_dist = net->msb() >= net->lsb() ? 1 : -1; obj->lsb_dist = net->msb() >= net->lsb() ? 1 : -1;
obj->isint_ = false;
switch (net->port_type()) { switch (net->port_type()) {
@ -1847,6 +1848,7 @@ void dll_target::signal(const NetNet*net)
case NetNet::REG: case NetNet::REG:
obj->type_ = IVL_SIT_REG; obj->type_ = IVL_SIT_REG;
obj->isint_ = net->get_isint();
break; break;
case NetNet::SUPPLY0: case NetNet::SUPPLY0:
@ -1948,6 +1950,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/* /*
* $Log: t-dll.cc,v $ * $Log: t-dll.cc,v $
* Revision 1.86 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.85 2002/06/16 19:19:16 steve * Revision 1.85 2002/06/16 19:19:16 steve
* Generate runtime code to normalize indices. * Generate runtime code to normalize indices.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-dll.h,v 1.85 2002/06/16 20:39:12 steve Exp $" #ident "$Id: t-dll.h,v 1.86 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "target.h" # include "target.h"
@ -503,6 +503,7 @@ struct ivl_signal_s {
unsigned width_ :24; unsigned width_ :24;
unsigned signed_ : 1; unsigned signed_ : 1;
unsigned isint_ : 1;
/* These encode the run-time index for the least significant /* These encode the run-time index for the least significant
bit, and the distance to the second bit. */ bit, and the distance to the second bit. */
@ -609,6 +610,9 @@ struct ivl_statement_s {
/* /*
* $Log: t-dll.h,v $ * $Log: t-dll.h,v $
* Revision 1.86 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.85 2002/06/16 20:39:12 steve * Revision 1.85 2002/06/16 20:39:12 steve
* Normalize run-time index expressions for bit selects * Normalize run-time index expressions for bit selects
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) #if !defined(WINNT)
#ident "$Id: vvp_scope.c,v 1.70 2002/04/23 05:18:05 steve Exp $" #ident "$Id: vvp_scope.c,v 1.71 2002/06/21 04:59:35 steve Exp $"
#endif #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -527,7 +527,8 @@ static void draw_reg_in_scope(ivl_signal_t sig)
int msb = ivl_signal_pins(sig) - 1; int msb = ivl_signal_pins(sig) - 1;
int lsb = 0; int lsb = 0;
const char*signed_flag = ivl_signal_signed(sig)? "/s" : ""; const char*signed_flag = ivl_signal_integer(sig) ? "/i" :
ivl_signal_signed(sig)? "/s" : "";
fprintf(vvp_out, "V_%s .var%s \"%s\", %d, %d;\n", fprintf(vvp_out, "V_%s .var%s \"%s\", %d, %d;\n",
vvp_mangle_id(ivl_signal_name(sig)), signed_flag, vvp_mangle_id(ivl_signal_name(sig)), signed_flag,
@ -1572,6 +1573,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/* /*
* $Log: vvp_scope.c,v $ * $Log: vvp_scope.c,v $
* Revision 1.71 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.70 2002/04/23 05:18:05 steve * Revision 1.70 2002/04/23 05:18:05 steve
* Tail size was wrong. * Tail size was wrong.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: sys_display.c,v 1.38 2002/05/31 04:26:54 steve Exp $" #ident "$Id: sys_display.c,v 1.39 2002/06/21 04:59:36 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -531,6 +531,7 @@ static void do_display(unsigned int mcd, struct strobe_cb_info*info)
case vpiNet: case vpiNet:
case vpiReg: case vpiReg:
case vpiIntegerVar:
case vpiMemoryWord: case vpiMemoryWord:
value.format = info->default_format; value.format = info->default_format;
vpi_get_value(item, &value); vpi_get_value(item, &value);
@ -743,8 +744,9 @@ static int sys_monitor_calltf(char*name)
switch (vpi_get(vpiType, monitor_info.items[idx])) { switch (vpi_get(vpiType, monitor_info.items[idx])) {
case vpiNet: case vpiNet:
case vpiReg: case vpiReg:
case vpiIntegerVar:
/* Monitoring reg and net values involves setting /* Monitoring reg and net values involves setting
a collback for value changes. pass the storage a callback for value changes. pass the storage
pointer for the callback itself as user_data so pointer for the callback itself as user_data so
that the callback can refresh itself. */ that the callback can refresh itself. */
cb.user_data = (char*)(monitor_callbacks+idx); cb.user_data = (char*)(monitor_callbacks+idx);
@ -847,11 +849,16 @@ static int sys_fdisplay_calltf(char *name)
} }
type = vpi_get(vpiType, item); type = vpi_get(vpiType, item);
if (type != vpiReg && type != vpiRealVal) { switch (type) {
vpi_printf("ERROR: %s mcd parameter must be of integral, got vpiType=%d\n", case vpiReg:
name, type); case vpiRealVal:
vpi_free_object(argv); case vpiIntegerVar:
return 0; break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
} }
value.format = vpiIntVal; value.format = vpiIntVal;
@ -890,11 +897,17 @@ static int sys_fclose_calltf(char *name)
return 0; return 0;
} }
type = vpi_get(vpiType, item); type = vpi_get(vpiType, item);
if (type != vpiReg && type != vpiRealVal) { switch (type) {
vpi_printf("ERROR: %s mcd parameter must be of integral type, got vpiType=%d\n", case vpiReg:
name, type); case vpiRealVal:
vpi_free_object(argv); case vpiIntegerVar:
return 0; break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral type",
name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
} }
value.format = vpiIntVal; value.format = vpiIntVal;
@ -921,11 +934,16 @@ static int sys_fputc_calltf(char *name)
} }
type = vpi_get(vpiType, item); type = vpi_get(vpiType, item);
if (type != vpiReg && type != vpiRealVal) { switch (type) {
vpi_printf("ERROR: %s mcd parameter must be of integral, got vpiType=%d\n", case vpiReg:
name, type); case vpiRealVal:
vpi_free_object(argv); case vpiIntegerVar:
return 0; break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
} }
value.format = vpiIntVal; value.format = vpiIntVal;
@ -956,11 +974,16 @@ static int sys_fgetc_calltf(char *name)
} }
type = vpi_get(vpiType, item); type = vpi_get(vpiType, item);
if (type != vpiReg && type != vpiRealVal) { switch (type) {
vpi_printf("ERROR: %s mcd parameter must be of integral, got vpiType=%d\n", case vpiReg:
name, type); case vpiRealVal:
vpi_free_object(argv); case vpiIntegerVar:
return 0; break;
default:
vpi_printf("ERROR: %s mcd parameter must be of integral", name);
vpi_printf(", got vpiType=%d\n", type);
vpi_free_object(argv);
return 0;
} }
value.format = vpiIntVal; value.format = vpiIntVal;
@ -1273,6 +1296,9 @@ void sys_display_register()
/* /*
* $Log: sys_display.c,v $ * $Log: sys_display.c,v $
* Revision 1.39 2002/06/21 04:59:36 steve
* Carry integerness throughout the compilation.
*
* Revision 1.38 2002/05/31 04:26:54 steve * Revision 1.38 2002/05/31 04:26:54 steve
* Add support for $timeformat. * Add support for $timeformat.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: sys_lxt.c,v 1.4 2002/06/03 03:56:06 steve Exp $" #ident "$Id: sys_lxt.c,v 1.5 2002/06/21 04:59:36 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -536,6 +536,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break; break;
case vpiNet: type = "wire"; if(0){ case vpiNet: type = "wire"; if(0){
case vpiIntegerVar:
case vpiReg: type = "reg"; } case vpiReg: type = "reg"; }
if (skip) if (skip)
@ -690,6 +691,7 @@ static int sys_dumpvars_calltf(char*name)
switch (vpi_get(vpiType, item)) { switch (vpi_get(vpiType, item)) {
case vpiConstant: case vpiConstant:
case vpiNet: case vpiNet:
case vpiIntegerVar:
case vpiReg: case vpiReg:
case vpiMemoryWord: case vpiMemoryWord:
value.format = vpiIntVal; value.format = vpiIntVal;
@ -780,6 +782,9 @@ void sys_lxt_register()
/* /*
* $Log: sys_lxt.c,v $ * $Log: sys_lxt.c,v $
* Revision 1.5 2002/06/21 04:59:36 steve
* Carry integerness throughout the compilation.
*
* Revision 1.4 2002/06/03 03:56:06 steve * Revision 1.4 2002/06/03 03:56:06 steve
* Ignore memories and named events. * Ignore memories and named events.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: sys_vcd.c,v 1.29 2002/05/23 01:07:26 steve Exp $" #ident "$Id: sys_vcd.c,v 1.30 2002/06/21 04:59:36 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -542,6 +542,7 @@ static void scan_item(unsigned depth, vpiHandle item, int skip)
break; break;
case vpiNet: type = "wire"; if(0){ case vpiNet: type = "wire"; if(0){
case vpiIntegerVar:
case vpiReg: type = "reg"; } case vpiReg: type = "reg"; }
if (skip) if (skip)
@ -695,6 +696,7 @@ static int sys_dumpvars_calltf(char*name)
case vpiConstant: case vpiConstant:
case vpiNet: case vpiNet:
case vpiReg: case vpiReg:
case vpiIntegerVar:
case vpiMemoryWord: case vpiMemoryWord:
value.format = vpiIntVal; value.format = vpiIntVal;
vpi_get_value(item, &value); vpi_get_value(item, &value);
@ -784,6 +786,9 @@ void sys_vcd_register()
/* /*
* $Log: sys_vcd.c,v $ * $Log: sys_vcd.c,v $
* Revision 1.30 2002/06/21 04:59:36 steve
* Carry integerness throughout the compilation.
*
* Revision 1.29 2002/05/23 01:07:26 steve * Revision 1.29 2002/05/23 01:07:26 steve
* Ignore Named events in vcd signal scan. * Ignore Named events in vcd signal scan.
* *

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #if !defined(WINNT) && !defined(macintosh)
#ident "$Id: vpi_user.h,v 1.11 2002/05/24 19:05:30 steve Exp $" #ident "$Id: vpi_user.h,v 1.12 2002/06/21 04:59:35 steve Exp $"
#endif #endif
@ -152,6 +152,7 @@ typedef struct t_vpi_value {
/* OBJECT CODES */ /* OBJECT CODES */
#define vpiConstant 7 #define vpiConstant 7
#define vpiFunction 20 #define vpiFunction 20
#define vpiIntegerVar 25
#define vpiIterator 27 #define vpiIterator 27
#define vpiMemory 29 #define vpiMemory 29
#define vpiMemoryWord 30 #define vpiMemoryWord 30
@ -325,6 +326,9 @@ EXTERN_C_END
/* /*
* $Log: vpi_user.h,v $ * $Log: vpi_user.h,v $
* Revision 1.12 2002/06/21 04:59:35 steve
* Carry integerness throughout the compilation.
*
* Revision 1.11 2002/05/24 19:05:30 steve * Revision 1.11 2002/05/24 19:05:30 steve
* support GCC __attributes__ for printf formats. * support GCC __attributes__ for printf formats.
* *