Handle 64bit delay constants.
This commit is contained in:
parent
00891db0d2
commit
fc0695beb6
|
|
@ -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.188 2006/06/20 05:06:47 steve Exp $"
|
||||
#ident "$Id: elab_net.cc,v 1.189 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1619,7 +1619,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
|
|||
constant value, extend the value to fit the desired
|
||||
output. */
|
||||
if (lwidth > pvalue.len()) {
|
||||
verinum tmp (0UL, lwidth);
|
||||
verinum tmp ((uint64_t)0, lwidth);
|
||||
for (unsigned idx = 0 ; idx < pvalue.len() ; idx += 1)
|
||||
tmp.set(idx, pvalue.get(idx));
|
||||
|
||||
|
|
@ -2840,6 +2840,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
|
|||
|
||||
/*
|
||||
* $Log: elab_net.cc,v $
|
||||
* Revision 1.189 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.188 2006/06/20 05:06:47 steve
|
||||
* Sign extend operands of signed addition.
|
||||
*
|
||||
|
|
|
|||
15
elaborate.cc
15
elaborate.cc
|
|
@ -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.340 2006/06/02 04:48:50 steve Exp $"
|
||||
#ident "$Id: elaborate.cc,v 1.341 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1343,7 +1343,7 @@ static NetExpr*elaborate_delay_expr(PExpr*expr, Design*des, NetScope*scope)
|
|||
verireal fn = tmp->value();
|
||||
|
||||
int shift = scope->time_unit() - des->get_precision();
|
||||
long delay = fn.as_long(shift);
|
||||
int64_t delay = fn.as_long64(shift);
|
||||
if (delay < 0)
|
||||
delay = 0;
|
||||
|
||||
|
|
@ -1355,8 +1355,8 @@ static NetExpr*elaborate_delay_expr(PExpr*expr, Design*des, NetScope*scope)
|
|||
if (NetEConst*tmp = dynamic_cast<NetEConst*>(dex)) {
|
||||
verinum fn = tmp->value();
|
||||
|
||||
unsigned long delay =
|
||||
des->scale_to_precision(fn.as_ulong(), scope);
|
||||
uint64_t delay =
|
||||
des->scale_to_precision(fn.as_ulong64(), scope);
|
||||
|
||||
delete tmp;
|
||||
return new NetEConst(verinum(delay));
|
||||
|
|
@ -1368,7 +1368,7 @@ static NetExpr*elaborate_delay_expr(PExpr*expr, Design*des, NetScope*scope)
|
|||
return that expression. */
|
||||
int shift = scope->time_unit() - des->get_precision();
|
||||
if (shift > 0) {
|
||||
unsigned long scale = 1;
|
||||
uint64_t scale = 1;
|
||||
while (shift > 0) {
|
||||
scale *= 10;
|
||||
shift -= 1;
|
||||
|
|
@ -2063,7 +2063,7 @@ NetProc* PDelayStatement::elaborate(Design*des, NetScope*scope) const
|
|||
|
||||
if (NetEConst*tmp = dynamic_cast<NetEConst*>(dex)) {
|
||||
if (statement_)
|
||||
return new NetPDelay(tmp->value().as_ulong(),
|
||||
return new NetPDelay(tmp->value().as_ulong64(),
|
||||
statement_->elaborate(des, scope));
|
||||
else
|
||||
return new NetPDelay(tmp->value().as_ulong(), 0);
|
||||
|
|
@ -3133,6 +3133,9 @@ Design* elaborate(list<perm_string>roots)
|
|||
|
||||
/*
|
||||
* $Log: elaborate.cc,v $
|
||||
* Revision 1.341 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.340 2006/06/02 04:48:50 steve
|
||||
* Make elaborate_expr methods aware of the width that the context
|
||||
* requires of it. In the process, fix sizing of the width of unary
|
||||
|
|
|
|||
7
eval.cc
7
eval.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: eval.cc,v 1.42 2006/05/19 04:07:24 steve Exp $"
|
||||
#ident "$Id: eval.cc,v 1.43 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -259,7 +259,7 @@ verinum* PEUnary::eval_const(const Design*des, NetScope*scope) const
|
|||
/* We need to expand the value a bit if we are
|
||||
taking the 2's complement so that we are
|
||||
guaranteed to not overflow. */
|
||||
verinum tmp (0UL, val->len()+1);
|
||||
verinum tmp ((uint64_t)0, val->len()+1);
|
||||
for (unsigned idx = 0 ; idx < val->len() ; idx += 1)
|
||||
tmp.set(idx, val->get(idx));
|
||||
|
||||
|
|
@ -276,6 +276,9 @@ verinum* PEUnary::eval_const(const Design*des, NetScope*scope) const
|
|||
|
||||
/*
|
||||
* $Log: eval.cc,v $
|
||||
* Revision 1.43 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.42 2006/05/19 04:07:24 steve
|
||||
* eval_const is not strict.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: expr_synth.cc,v 1.79 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: expr_synth.cc,v 1.80 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -792,7 +792,7 @@ NetNet* NetESelect::synthesize(Design *des)
|
|||
|
||||
assert(expr_width() > sub->vector_width());
|
||||
unsigned pad_width = expr_width() - sub->vector_width();
|
||||
verinum pad(0UL, pad_width);
|
||||
verinum pad((uint64_t)0, pad_width);
|
||||
NetConst*con = new NetConst(scope, scope->local_symbol(),
|
||||
pad);
|
||||
con->set_line(*this);
|
||||
|
|
@ -890,6 +890,9 @@ NetNet* NetESignal::synthesize(Design*des)
|
|||
|
||||
/*
|
||||
* $Log: expr_synth.cc,v $
|
||||
* Revision 1.80 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.79 2006/07/31 03:50:17 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: ivl_target.h,v 1.169 2006/07/30 02:51:35 steve Exp $"
|
||||
#ident "$Id: ivl_target.h,v 1.170 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define _BEGIN_DECL extern "C" {
|
||||
#define _END_DECL }
|
||||
|
|
@ -1658,7 +1660,7 @@ extern ivl_statement_t ivl_stmt_cond_true(ivl_statement_t net);
|
|||
/* IVL_ST_ASSIGN IVL_ST_ASSIGN_NB IVL_ST_DELAYX */
|
||||
extern ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net);
|
||||
/* IVL_ST_DELAY */
|
||||
extern unsigned long ivl_stmt_delay_val(ivl_statement_t net);
|
||||
extern uint64_t ivl_stmt_delay_val(ivl_statement_t net);
|
||||
/* IVL_ST_WAIT IVL_ST_TRIGGER */
|
||||
extern unsigned ivl_stmt_nevent(ivl_statement_t net);
|
||||
extern ivl_event_t ivl_stmt_events(ivl_statement_t net, unsigned idx);
|
||||
|
|
@ -1718,6 +1720,9 @@ _END_DECL
|
|||
|
||||
/*
|
||||
* $Log: ivl_target.h,v $
|
||||
* Revision 1.170 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.169 2006/07/30 02:51:35 steve
|
||||
* Fix/implement signed right shift.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: net_design.cc,v 1.49 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: net_design.cc,v 1.50 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -67,8 +67,8 @@ int Design::get_precision() const
|
|||
return des_precision_;
|
||||
}
|
||||
|
||||
unsigned long Design::scale_to_precision(unsigned long val,
|
||||
const NetScope*scope) const
|
||||
uint64_t Design::scale_to_precision(uint64_t val,
|
||||
const NetScope*scope) const
|
||||
{
|
||||
int units = scope->time_unit();
|
||||
assert( units >= des_precision_ );
|
||||
|
|
@ -562,6 +562,9 @@ void Design::delete_process(NetProcTop*top)
|
|||
|
||||
/*
|
||||
* $Log: net_design.cc,v $
|
||||
* Revision 1.50 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.49 2006/07/31 03:50:17 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: net_proc.cc,v 1.6 2002/08/12 01:34:59 steve Exp $"
|
||||
#ident "$Id: net_proc.cc,v 1.7 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -131,7 +131,7 @@ NetForever::~NetForever()
|
|||
delete statement_;
|
||||
}
|
||||
|
||||
NetPDelay::NetPDelay(unsigned long d, NetProc*st)
|
||||
NetPDelay::NetPDelay(uint64_t d, NetProc*st)
|
||||
: delay_(d), expr_(0), statement_(st)
|
||||
{
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ NetPDelay::~NetPDelay()
|
|||
if (expr_) delete expr_;
|
||||
}
|
||||
|
||||
unsigned long NetPDelay::delay() const
|
||||
uint64_t NetPDelay::delay() const
|
||||
{
|
||||
assert(expr_ == 0);
|
||||
return delay_;
|
||||
|
|
@ -177,6 +177,9 @@ const NetExpr* NetRepeat::expr() const
|
|||
|
||||
/*
|
||||
* $Log: net_proc.cc,v $
|
||||
* Revision 1.7 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.6 2002/08/12 01:34:59 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
|
|
|
|||
14
netlist.h
14
netlist.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: netlist.h,v 1.359 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: netlist.h,v 1.360 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -31,6 +31,7 @@
|
|||
# include <string>
|
||||
# include <map>
|
||||
# include <list>
|
||||
# include <stdint.h>
|
||||
# include "ivl_target.h"
|
||||
# include "verinum.h"
|
||||
# include "verireal.h"
|
||||
|
|
@ -2288,11 +2289,11 @@ class NetFuncDef {
|
|||
class NetPDelay : public NetProc {
|
||||
|
||||
public:
|
||||
NetPDelay(unsigned long d, NetProc*st);
|
||||
NetPDelay(uint64_t d, NetProc*st);
|
||||
NetPDelay(NetExpr* d, NetProc*st);
|
||||
~NetPDelay();
|
||||
|
||||
unsigned long delay() const;
|
||||
uint64_t delay() const;
|
||||
const NetExpr*expr() const;
|
||||
|
||||
virtual NexusSet* nex_input();
|
||||
|
|
@ -2304,7 +2305,7 @@ class NetPDelay : public NetProc {
|
|||
bool emit_proc_recurse(struct target_t*) const;
|
||||
|
||||
private:
|
||||
unsigned long delay_;
|
||||
uint64_t delay_;
|
||||
NetExpr*expr_;
|
||||
NetProc*statement_;
|
||||
};
|
||||
|
|
@ -3394,7 +3395,7 @@ class Design {
|
|||
|
||||
/* This function takes a delay value and a scope, and returns
|
||||
the delay value scaled to the precision of the design. */
|
||||
unsigned long scale_to_precision(unsigned long, const NetScope*)const;
|
||||
uint64_t scale_to_precision(uint64_t, const NetScope*)const;
|
||||
|
||||
/* Look up a scope. If no starting scope is passed, then the
|
||||
path is taken as an absolute scope name. Otherwise, the
|
||||
|
|
@ -3509,6 +3510,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
|
|||
|
||||
/*
|
||||
* $Log: netlist.h,v $
|
||||
* Revision 1.360 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.359 2006/07/31 03:50:17 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
16
parse.y
16
parse.y
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: parse.y,v 1.218 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: parse.y,v 1.219 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1125,7 +1125,7 @@ function_item
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::PINPUT,
|
||||
|
|
@ -3084,7 +3084,7 @@ task_port_item
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::PINPUT,
|
||||
|
|
@ -3100,7 +3100,7 @@ task_port_item
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::POUTPUT,
|
||||
|
|
@ -3116,7 +3116,7 @@ task_port_item
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::PINOUT,
|
||||
|
|
@ -3207,7 +3207,7 @@ task_port_decl
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::PINPUT,
|
||||
|
|
@ -3224,7 +3224,7 @@ task_port_decl
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::POUTPUT,
|
||||
|
|
@ -3241,7 +3241,7 @@ task_port_decl
|
|||
re = new PENumber(new verinum(INTEGER_WIDTH-1,
|
||||
INTEGER_WIDTH));
|
||||
(*range_stub)[0] = re;
|
||||
re = new PENumber(new verinum(0UL, INTEGER_WIDTH));
|
||||
re = new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH));
|
||||
(*range_stub)[1] = re;
|
||||
svector<PWire*>*tmp
|
||||
= pform_make_task_ports(NetNet::PINOUT,
|
||||
|
|
|
|||
9
pform.cc
9
pform.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: pform.cc,v 1.135 2006/04/10 00:37:42 steve Exp $"
|
||||
#ident "$Id: pform.cc,v 1.136 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1583,7 +1583,7 @@ static void pform_set_reg_integer(const char*nm)
|
|||
assert(cur);
|
||||
|
||||
cur->set_range(new PENumber(new verinum(INTEGER_WIDTH-1, INTEGER_WIDTH)),
|
||||
new PENumber(new verinum(0UL, INTEGER_WIDTH)));
|
||||
new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH)));
|
||||
cur->set_signed(true);
|
||||
}
|
||||
|
||||
|
|
@ -1614,7 +1614,7 @@ static void pform_set_reg_time(const char*nm)
|
|||
assert(cur);
|
||||
|
||||
cur->set_range(new PENumber(new verinum(TIME_WIDTH-1, INTEGER_WIDTH)),
|
||||
new PENumber(new verinum(0UL, INTEGER_WIDTH)));
|
||||
new PENumber(new verinum((uint64_t)0, INTEGER_WIDTH)));
|
||||
}
|
||||
|
||||
void pform_set_reg_time(list<perm_string>*names)
|
||||
|
|
@ -1707,6 +1707,9 @@ int pform_parse(const char*path, FILE*file)
|
|||
|
||||
/*
|
||||
* $Log: pform.cc,v $
|
||||
* Revision 1.136 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.135 2006/04/10 00:37:42 steve
|
||||
* Add support for generate loops w/ wires and gates.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: t-dll-api.cc,v 1.134 2006/06/18 04:15:50 steve Exp $"
|
||||
#ident "$Id: t-dll-api.cc,v 1.135 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1824,7 +1824,7 @@ extern "C" ivl_expr_t ivl_stmt_delay_expr(ivl_statement_t net)
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" unsigned long ivl_stmt_delay_val(ivl_statement_t net)
|
||||
extern "C" uint64_t ivl_stmt_delay_val(ivl_statement_t net)
|
||||
{
|
||||
assert(net->type_ == IVL_ST_DELAY);
|
||||
return net->u_.delay_.delay_;
|
||||
|
|
@ -2009,6 +2009,9 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
|
|||
|
||||
/*
|
||||
* $Log: t-dll-api.cc,v $
|
||||
* Revision 1.135 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.134 2006/06/18 04:15:50 steve
|
||||
* Add support for system functions in continuous assignments.
|
||||
*
|
||||
|
|
|
|||
7
t-dll.h
7
t-dll.h
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: t-dll.h,v 1.131 2006/06/18 04:15:50 steve Exp $"
|
||||
#ident "$Id: t-dll.h,v 1.132 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "target.h"
|
||||
|
|
@ -626,7 +626,7 @@ struct ivl_statement_s {
|
|||
} condit_;
|
||||
|
||||
struct { /* IVL_ST_DELAY */
|
||||
unsigned long delay_;
|
||||
uint64_t delay_;
|
||||
ivl_statement_t stmt_;
|
||||
} delay_;
|
||||
|
||||
|
|
@ -671,6 +671,9 @@ struct ivl_statement_s {
|
|||
|
||||
/*
|
||||
* $Log: t-dll.h,v $
|
||||
* Revision 1.132 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.131 2006/06/18 04:15:50 steve
|
||||
* Add support for system functions in continuous assignments.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: statement.c,v 1.9 2006/02/02 02:43:59 steve Exp $"
|
||||
#ident "$Id: statement.c,v 1.10 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -301,7 +301,7 @@ void show_statement(ivl_statement_t net, unsigned ind)
|
|||
break;
|
||||
|
||||
case IVL_ST_DELAY:
|
||||
fprintf(out, "%*s#%lu\n", ind, "", ivl_stmt_delay_val(net));
|
||||
fprintf(out, "%*s#%llu\n", ind, "", ivl_stmt_delay_val(net));
|
||||
show_statement(ivl_stmt_sub_stmt(net), ind+2);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: vvp_process.c,v 1.123 2006/04/16 00:15:43 steve Exp $"
|
||||
#ident "$Id: vvp_process.c,v 1.124 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "vvp_priv.h"
|
||||
|
|
@ -907,10 +907,13 @@ static int show_stmt_condit(ivl_statement_t net, ivl_scope_t sscope)
|
|||
static int show_stmt_delay(ivl_statement_t net, ivl_scope_t sscope)
|
||||
{
|
||||
int rc = 0;
|
||||
unsigned long delay = ivl_stmt_delay_val(net);
|
||||
uint64_t delay = ivl_stmt_delay_val(net);
|
||||
ivl_statement_t stmt = ivl_stmt_sub_stmt(net);
|
||||
|
||||
fprintf(vvp_out, " %%delay %lu;\n", delay);
|
||||
unsigned long low = delay % UINT64_C(0x100000000);
|
||||
unsigned long hig = delay / UINT64_C(0x100000000);
|
||||
|
||||
fprintf(vvp_out, " %%delay %lu, %lu;\n", low, hig);
|
||||
/* Lots of things can happen during a delay. */
|
||||
clear_expression_lookaside();
|
||||
|
||||
|
|
@ -1484,6 +1487,9 @@ int draw_func_definition(ivl_scope_t scope)
|
|||
|
||||
/*
|
||||
* $Log: vvp_process.c,v $
|
||||
* Revision 1.124 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.123 2006/04/16 00:15:43 steve
|
||||
* Fix part selects in l-values.
|
||||
*
|
||||
|
|
|
|||
36
verinum.cc
36
verinum.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: verinum.cc,v 1.47 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: verinum.cc,v 1.48 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -87,14 +87,14 @@ verinum::verinum(verinum::V val, unsigned n, bool h)
|
|||
bits_[idx] = val;
|
||||
}
|
||||
|
||||
verinum::verinum(unsigned long val, unsigned n)
|
||||
verinum::verinum(uint64_t val, unsigned n)
|
||||
: has_len_(true), has_sign_(false), string_flag_(false)
|
||||
{
|
||||
nbits_ = n;
|
||||
bits_ = new V[nbits_];
|
||||
for (unsigned idx = 0 ; idx < nbits_ ; idx += 1) {
|
||||
bits_[idx] = (val&1) ? V1 : V0;
|
||||
val >>= 1;
|
||||
val >>= (uint64_t)1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -134,10 +134,10 @@ verinum::verinum(const verinum&that, unsigned nbits)
|
|||
}
|
||||
}
|
||||
|
||||
verinum::verinum(long that)
|
||||
verinum::verinum(int64_t that)
|
||||
: has_len_(false), has_sign_(true), string_flag_(false)
|
||||
{
|
||||
long tmp;
|
||||
int64_t tmp;
|
||||
|
||||
tmp = that/2;
|
||||
nbits_ = 1;
|
||||
|
|
@ -208,6 +208,27 @@ unsigned long verinum::as_ulong() const
|
|||
return val;
|
||||
}
|
||||
|
||||
uint64_t verinum::as_ulong64() const
|
||||
{
|
||||
if (nbits_ == 0)
|
||||
return 0;
|
||||
|
||||
if (!is_defined())
|
||||
return 0;
|
||||
|
||||
unsigned top = nbits_;
|
||||
if (top >= (8 * sizeof(uint64_t)))
|
||||
top = 8 * sizeof(uint64_t);
|
||||
|
||||
uint64_t val = 0;
|
||||
uint64_t mask = 1;
|
||||
for (unsigned idx = 0 ; idx < top ; idx += 1, mask <<= 1)
|
||||
if (bits_[idx] == V1)
|
||||
val |= mask;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the native long integer that represents the
|
||||
* value of this object. It accounts for sign extension if the value
|
||||
|
|
@ -447,7 +468,7 @@ ostream& operator<< (ostream&o, const verinum&v)
|
|||
|
||||
/* If the number is fully defined (no x or z) then print it
|
||||
out as a decimal number. */
|
||||
if (v.is_defined()) {
|
||||
if (v.is_defined() && v.len() < sizeof(long)) {
|
||||
if (v.has_sign())
|
||||
o << "'sd" << v.as_long();
|
||||
else
|
||||
|
|
@ -1018,6 +1039,9 @@ verinum::V operator ^ (verinum::V l, verinum::V r)
|
|||
|
||||
/*
|
||||
* $Log: verinum.cc,v $
|
||||
* Revision 1.48 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.47 2006/07/31 03:50:17 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
11
verinum.h
11
verinum.h
|
|
@ -19,10 +19,11 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: verinum.h,v 1.31 2006/07/31 03:50:17 steve Exp $"
|
||||
#ident "$Id: verinum.h,v 1.32 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include <string>
|
||||
# include <stdint.h>
|
||||
|
||||
# include "config.h"
|
||||
#ifdef HAVE_IOSFWD
|
||||
|
|
@ -48,11 +49,11 @@ class verinum {
|
|||
verinum(const string&str);
|
||||
verinum(const V*v, unsigned nbits, bool has_len =true);
|
||||
verinum(V, unsigned nbits =1, bool has_len =true);
|
||||
verinum(unsigned long val, unsigned bits);
|
||||
verinum(uint64_t val, unsigned bits);
|
||||
verinum(const verinum&);
|
||||
|
||||
// Create a signed number, with an unspecified number of bits.
|
||||
explicit verinum(long val);
|
||||
explicit verinum(int64_t val);
|
||||
|
||||
// Copy only the specified number of bits from the
|
||||
// source. Also mark this number as has_len.
|
||||
|
|
@ -90,6 +91,7 @@ class verinum {
|
|||
V operator[] (unsigned idx) const { return get(idx); }
|
||||
|
||||
|
||||
uint64_t as_ulong64() const;
|
||||
unsigned long as_ulong() const;
|
||||
signed long as_long() const;
|
||||
string as_string() const;
|
||||
|
|
@ -159,6 +161,9 @@ extern verinum v_not(const verinum&left);
|
|||
|
||||
/*
|
||||
* $Log: verinum.h,v $
|
||||
* Revision 1.32 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.31 2006/07/31 03:50:17 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
22
verireal.cc
22
verireal.cc
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: verireal.cc,v 1.16 2006/07/31 03:50:18 steve Exp $"
|
||||
#ident "$Id: verireal.cc,v 1.17 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -77,6 +77,23 @@ long verireal::as_long(int shift) const
|
|||
return (long) outf;
|
||||
}
|
||||
|
||||
int64_t verireal::as_long64(int shift) const
|
||||
{
|
||||
double out = value_ * pow(10.0,shift);
|
||||
double outf;
|
||||
|
||||
if (out >= 0.0) {
|
||||
outf = floor(out);
|
||||
if (out >= (outf + 0.5))
|
||||
outf += 1.0;
|
||||
} else {
|
||||
outf = ceil(out);
|
||||
if (out <= (outf - 0.5))
|
||||
outf -= 1.0;
|
||||
}
|
||||
return (int64_t) outf;
|
||||
}
|
||||
|
||||
double verireal::as_double() const
|
||||
{
|
||||
return value_;
|
||||
|
|
@ -139,6 +156,9 @@ ostream& operator<< (ostream&out, const verireal&v)
|
|||
|
||||
/*
|
||||
* $Log: verireal.cc,v $
|
||||
* Revision 1.17 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.16 2006/07/31 03:50:18 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: verireal.h,v 1.12 2006/07/31 03:50:18 steve Exp $"
|
||||
#ident "$Id: verireal.h,v 1.13 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_IOSFWD
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
class ostream;
|
||||
#endif
|
||||
|
||||
# include <stdint.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class verinum;
|
||||
|
|
@ -64,6 +66,7 @@ class verireal {
|
|||
example if the value is 2.5 and shift == 1, the result
|
||||
is 25. */
|
||||
long as_long(int shift =0) const;
|
||||
int64_t as_long64(int shift =0) const;
|
||||
|
||||
double as_double() const;
|
||||
|
||||
|
|
@ -82,6 +85,9 @@ extern verireal operator- (const verireal&);
|
|||
|
||||
/*
|
||||
* $Log: verireal.h,v $
|
||||
* Revision 1.13 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.12 2006/07/31 03:50:18 steve
|
||||
* Add support for power in constant expressions.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: compile.cc,v 1.221 2006/07/30 02:51:36 steve Exp $"
|
||||
#ident "$Id: compile.cc,v 1.222 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "arith.h"
|
||||
|
|
@ -109,7 +109,7 @@ const static struct opcode_table_s opcode_table[] = {
|
|||
{ "%cvt/ri", of_CVT_RI, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%cvt/vr", of_CVT_VR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
{ "%deassign",of_DEASSIGN,1,{OA_FUNC_PTR, OA_NONE, OA_NONE} },
|
||||
{ "%delay", of_DELAY, 1, {OA_NUMBER, OA_NONE, OA_NONE} },
|
||||
{ "%delay", of_DELAY, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
|
||||
{ "%delayx", of_DELAYX, 1, {OA_NUMBER, OA_NONE, OA_NONE} },
|
||||
{ "%div", of_DIV, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
{ "%div/s", of_DIV_S, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
|
||||
|
|
@ -1496,6 +1496,9 @@ void compile_param_string(char*label, char*name, char*value)
|
|||
|
||||
/*
|
||||
* $Log: compile.cc,v $
|
||||
* Revision 1.222 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.221 2006/07/30 02:51:36 steve
|
||||
* Fix/implement signed right shift.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: vthread.cc,v 1.154 2006/08/04 04:37:37 steve Exp $"
|
||||
#ident "$Id: vthread.cc,v 1.155 2006/08/08 05:11:37 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -1049,10 +1049,21 @@ bool of_DEASSIGN(vthread_t thr, vvp_code_t cp)
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* The delay takes two 32bit numbers to make up a 64bit time.
|
||||
*
|
||||
* %delay <low>, <hig>
|
||||
*/
|
||||
bool of_DELAY(vthread_t thr, vvp_code_t cp)
|
||||
{
|
||||
//printf("thread %p: %%delay %lu\n", thr, cp->number);
|
||||
schedule_vthread(thr, cp->number);
|
||||
vvp_time64_t low = cp->bit_idx[0];
|
||||
vvp_time64_t hig = cp->bit_idx[1];
|
||||
|
||||
vvp_time64_t res = 32;
|
||||
res = hig << res;
|
||||
res += low;
|
||||
|
||||
schedule_vthread(thr, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -3261,6 +3272,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
|
|||
|
||||
/*
|
||||
* $Log: vthread.cc,v $
|
||||
* Revision 1.155 2006/08/08 05:11:37 steve
|
||||
* Handle 64bit delay constants.
|
||||
*
|
||||
* Revision 1.154 2006/08/04 04:37:37 steve
|
||||
* Support release of a for/linked reg.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue