Changes to real nets generate callbacks.

Generate the missed callbacks when real values change. In the
process, unify the use of the filterter_mask_ method for scalar
types.
This commit is contained in:
Stephen Williams 2009-09-07 21:22:00 -07:00
parent 0d70adfc47
commit 9c516a9d53
4 changed files with 20 additions and 19 deletions

View File

@ -216,14 +216,14 @@ vvp_net_fil_t::prop_t vvp_net_fil_t::filter_vec8(const vvp_vector8_t&val, vvp_ve
return PROP;
}
bool vvp_net_fil_t::filter_real(double&)
vvp_net_fil_t::prop_t vvp_net_fil_t::filter_real(double&)
{
return true;
return PROP;
}
bool vvp_net_fil_t::filter_long(long&)
vvp_net_fil_t::prop_t vvp_net_fil_t::filter_long(long&)
{
return true;
return PROP;
}
void vvp_net_fil_t::force_mask(vvp_vector2_t mask)

View File

@ -1130,8 +1130,8 @@ class vvp_net_fil_t : public vvp_vpi_callback {
// filter, or overridden by the rep argument if present.
virtual prop_t filter_vec4(const vvp_vector4_t&bit, vvp_vector4_t&rep);
virtual prop_t filter_vec8(const vvp_vector8_t&val, vvp_vector8_t&rep);
virtual bool filter_real(double&val);
virtual bool filter_long(long&val);
virtual prop_t filter_real(double&val);
virtual prop_t filter_long(long&val);
virtual void release(vvp_net_ptr_t ptr, bool net_flag) =0;
virtual void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) =0;
@ -1165,10 +1165,9 @@ class vvp_net_fil_t : public vvp_vpi_callback {
// method will use to hold a filtered value, if needed. This
// method returns a pointer to val or buf.
template <class T> prop_t filter_mask_(const T&val, const T&force, T&rep);
// This template method is a scalar value of the above. It
// leaves the val, or it replaces it iwth a forced value.
// (Not really implemented, yet.)
template <class T> bool filter_mask_(T&val);
// This template method is similar to the above, but works for
// native types that are not so expensive to edit in place.
template <class T> prop_t filter_mask_(T&val, T force);
private:
// Mask of forced bits

View File

@ -59,10 +59,16 @@ template <class T> vvp_net_fil_t::prop_t vvp_net_fil_t::filter_mask_(const T&val
}
}
template <class T> bool vvp_net_fil_t::filter_mask_(T&val)
template <class T> vvp_net_fil_t::prop_t vvp_net_fil_t::filter_mask_(T&val, T force)
{
if (test_force_mask(0)) {
val = force;
run_vpi_callbacks();
return REPL;
}
run_vpi_callbacks();
return true;
return PROP;
}
vvp_signal_value::~vvp_signal_value()
@ -814,14 +820,10 @@ vvp_wire_real::vvp_wire_real()
{
}
bool vvp_wire_real::filter_real(double&bit)
vvp_net_fil_t::prop_t vvp_wire_real::filter_real(double&bit)
{
bit_ = bit;
if (test_force_mask(0)) {
bit = force_;
return false;
}
return true;
return filter_mask_(bit, force_);
}
unsigned vvp_wire_real::filter_size() const

View File

@ -363,7 +363,7 @@ class vvp_wire_real : public vvp_wire_base {
explicit vvp_wire_real(void);
// The main filter behavior for this class
bool filter_real(double&bit);
prop_t filter_real(double&bit);
// Abstract methods from vvp_vpi_callback
void get_value(struct t_vpi_value*value);