diff --git a/PDelays.cc b/PDelays.cc index 3fd3ce710..76a34e8b9 100644 --- a/PDelays.cc +++ b/PDelays.cc @@ -74,7 +74,7 @@ static NetExpr*calculate_val(Design*des, NetScope*scope, const PExpr*expr) 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; @@ -88,8 +88,7 @@ static NetExpr*calculate_val(Design*des, NetScope*scope, const PExpr*expr) if (NetEConst*tmp = dynamic_cast(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; NetEConst*tmp2 = new NetEConst(verinum(delay)); diff --git a/PGate.cc b/PGate.cc index 7cacffe43..76950cef3 100644 --- a/PGate.cc +++ b/PGate.cc @@ -99,59 +99,6 @@ void PGate::eval_delays(Design*des, NetScope*scope, as_net_flag); } -void PGate::eval_delays(Design*des, NetScope*scope, - unsigned long&rise_time, - unsigned long&fall_time, - unsigned long&decay_time) const -{ - NetExpr*rise_expr, *fall_expr, *decay_expr; - delay_.eval_delays(des, scope, rise_expr, fall_expr, decay_expr); - - if (rise_expr == 0) { - rise_time = 0; - fall_time = 0; - decay_time = 0; - } - - if (NetEConst*tmp = dynamic_cast (rise_expr)) { - rise_time = tmp->value().as_ulong(); - - } else { - cerr << get_fileline() << ": error: Delay expressions must be " - << "constant here." << endl; - cerr << get_fileline() << ": : Cannot calculate " - << *rise_expr << endl; - des->errors += 1; - rise_time = 0; - } - - if (NetEConst*tmp = dynamic_cast (fall_expr)) { - fall_time = tmp->value().as_ulong(); - - } else { - if (fall_expr != rise_expr) { - cerr << get_fileline() << ": error: Delay expressions must be " - << "constant here." << endl; - cerr << get_fileline() << ": : Cannot calculate " - << *rise_expr << endl; - } - des->errors += 1; - fall_time = 0; - } - - if (NetEConst*tmp = dynamic_cast (decay_expr)) { - decay_time = tmp->value().as_ulong(); - - } else { - cerr << get_fileline() << ": error: Delay expressions must be " - << "constant here." << endl; - cerr << get_fileline() << ": : Cannot calculate " - << *rise_expr << endl; - des->errors += 1; - decay_time = 0; - } -} - PGAssign::PGAssign(svector*pins) : PGate(perm_string(), pins) { diff --git a/PGate.h b/PGate.h index b52763ee5..b60100335 100644 --- a/PGate.h +++ b/PGate.h @@ -62,15 +62,6 @@ class PGate : public LineInfo { perm_string get_name() const { return name_; } - // This method evaluates the delays all the way to an - // integer. If the delay is non-constant, then set the times - // to 0, print an error message and mark an error to the - // design. - void eval_delays(Design*des, NetScope*scope, - unsigned long&rise_time, - unsigned long&fall_time, - unsigned long&decay_time) const; - // This evaluates the delays as far as possible, but returns // an expression, and do not signal errors. void eval_delays(Design*des, NetScope*scope, diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 12fb4abbd..d3477f026 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -155,7 +155,7 @@ uint64_t get_number_immediate64(ivl_expr_t ex) assert(0); } if (ivl_expr_signed(ex) && bits[nbits-1]=='1' && nbits < 64) - imm |= -UINT64_C(1) << nbits; + imm |= (-UINT64_C(1)) << nbits; break; }