diff --git a/vvp/ufunc.cc b/vvp/ufunc.cc index c174b54c5..c74ef7b65 100644 --- a/vvp/ufunc.cc +++ b/vvp/ufunc.cc @@ -84,8 +84,7 @@ void ufunc_core::finish_thread(vthread_t thr) { thread_ = 0; if (vvp_fun_signal_real*sig = dynamic_cast(result_->fun)) - - propagate_real(sig->real_value()); + propagate_real(sig->real_unfiltered_value()); if (vvp_fun_signal_vec*sig = dynamic_cast(result_->fun)) propagate_vec4(sig->vec4_unfiltered_value()); diff --git a/vvp/vpi_callback.cc b/vvp/vpi_callback.cc index 153bc54e8..7f9b98585 100644 --- a/vvp/vpi_callback.cc +++ b/vvp/vpi_callback.cc @@ -694,66 +694,6 @@ void vvp_fun_signal8::get_value(struct t_vpi_value*vp) } } -void vvp_fun_signal_real::get_value(struct t_vpi_value*vp) -{ - char*rbuf = need_result_buf(64 + 1, RBUF_VAL); - - switch (vp->format) { - case vpiObjTypeVal: - vp->format = vpiRealVal; - - case vpiRealVal: - vp->value.real = real_value(); - break; - - case vpiIntVal: - vp->value.integer = (int)(real_value() + 0.5); - break; - - case vpiDecStrVal: - sprintf(rbuf, "%0.0f", real_value()); - vp->value.str = rbuf; - break; - - case vpiHexStrVal: - sprintf(rbuf, "%lx", (long)real_value()); - vp->value.str = rbuf; - break; - - case vpiBinStrVal: { - unsigned long val = (unsigned long)real_value(); - unsigned len = 0; - - while (val > 0) { - len += 1; - val /= 2; - } - - val = (unsigned long)real_value(); - for (unsigned idx = 0 ; idx < len ; idx += 1) { - rbuf[len-idx-1] = (val & 1)? '1' : '0'; - val /= 2; - } - - rbuf[len] = 0; - if (len == 0) { - rbuf[0] = '0'; - rbuf[1] = 0; - } - vp->value.str = rbuf; - break; - } - - case vpiSuppressVal: - break; - - default: - fprintf(stderr, "vpi_callback: value " - "format %d not supported (fun_signal_real)\n", - vp->format); - } -} - void vvp_wire_vec4::get_value(struct t_vpi_value*value) { get_signal_value(value); diff --git a/vvp/vvp_net_sig.cc b/vvp/vvp_net_sig.cc index f6f2dad30..8b2e32099 100644 --- a/vvp/vvp_net_sig.cc +++ b/vvp/vvp_net_sig.cc @@ -486,9 +486,9 @@ vvp_fun_signal_real_sa::vvp_fun_signal_real_sa() bits_ = 0.0; } -double vvp_fun_signal_real_sa::real_value() const +double vvp_fun_signal_real_sa::real_unfiltered_value() const { - assert(0); + return bits_; } void vvp_fun_signal_real_sa::recv_real(vvp_net_ptr_t ptr, double bit, @@ -548,7 +548,7 @@ void vvp_fun_signal_real_aa::free_instance(vvp_context_t context) } #endif -double vvp_fun_signal_real_aa::real_value() const +double vvp_fun_signal_real_aa::real_unfiltered_value() const { double*bits = static_cast (vthread_get_rd_context_item(context_idx_)); @@ -719,7 +719,7 @@ vvp_bit4_t vvp_wire_vec4::value(unsigned idx) const vvp_scalar_t vvp_wire_vec4::scalar_value(unsigned idx) const { - assert(0); + return vvp_scalar_t(value(idx),6,6); } vvp_vector4_t vvp_wire_vec4::vec4_value() const diff --git a/vvp/vvp_net_sig.h b/vvp/vvp_net_sig.h index 31f89de02..25e2bd1c7 100644 --- a/vvp/vvp_net_sig.h +++ b/vvp/vvp_net_sig.h @@ -222,9 +222,8 @@ class vvp_fun_signal_real : public vvp_fun_signal_base { explicit vvp_fun_signal_real() {}; // Get information about the vector value. - virtual double real_value() const = 0; + virtual double real_unfiltered_value() const = 0; - void get_value(struct t_vpi_value*value); unsigned size() const { return 1; } }; @@ -240,7 +239,7 @@ class vvp_fun_signal_real_sa : public vvp_fun_signal_real { vvp_context_t); // Get information about the vector value. - double real_value() const; + double real_unfiltered_value() const; private: double bits_; @@ -264,7 +263,7 @@ class vvp_fun_signal_real_aa : public vvp_fun_signal_real, public automatic_hook vvp_context_t context); // Get information about the vector value. - double real_value() const; + double real_unfiltered_value() const; private: unsigned context_idx_;