Permalink
Browse files

Handle 64bit delay constants.

  • Loading branch information...
steve
steve committed Aug 8, 2006
1 parent 00891db commit fc0695beb6df02f60abd7ac9ddb3589fbba4487a
Showing with 175 additions and 61 deletions.
  1. +5 −2 elab_net.cc
  2. +9 −6 elaborate.cc
  3. +5 −2 eval.cc
  4. +5 −2 expr_synth.cc
  5. +7 −2 ivl_target.h
  6. +6 −3 net_design.cc
  7. +6 −3 net_proc.cc
  8. +9 −5 netlist.h
  9. +8 −8 parse.y
  10. +6 −3 pform.cc
  11. +5 −2 t-dll-api.cc
  12. +5 −2 t-dll.h
  13. +2 −2 tgt-stub/statement.c
  14. +9 −3 tgt-vvp/vvp_process.c
  15. +30 −6 verinum.cc
  16. +8 −3 verinum.h
  17. +21 −1 verireal.cc
  18. +7 −1 verireal.h
  19. +5 −2 vvp/compile.cc
  20. +17 −3 vvp/vthread.cc
View
@@ -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.
*
View
@@ -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
View
@@ -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.
*
View
@@ -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.
*
View
@@ -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.
*
View
@@ -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.
*
View
@@ -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.
*
View
@@ -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.
*
View
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,
Oops, something went wrong.

0 comments on commit fc0695b

Please sign in to comment.