Make force_fil_* methods virtual and part of vvp_net_fil_t.
These methods are type specific, but the code that invokes them get at them from pointers to filter objects, so it makes sense to make them abstract methods of the vvp_net_fil_t class.
This commit is contained in:
parent
7df9d60761
commit
ac78ae347b
|
|
@ -1129,6 +1129,13 @@ class vvp_net_fil_t : public vvp_vpi_callback {
|
|||
void force_link(vvp_net_t*dst, vvp_net_t*src);
|
||||
void force_unlink(void);
|
||||
|
||||
|
||||
public:
|
||||
// Suport for force methods
|
||||
virtual void force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask) =0;
|
||||
virtual void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask) =0;
|
||||
virtual void force_fil_real(double val, vvp_vector2_t mask) =0;
|
||||
|
||||
protected:
|
||||
// Set bits of the filter force mask
|
||||
void force_mask(vvp_vector2_t mask);
|
||||
|
|
|
|||
|
|
@ -96,15 +96,28 @@ void vvp_fun_signal4::force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask
|
|||
}
|
||||
}
|
||||
|
||||
void vvp_fun_signal4::force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_fun_signal4::force_fil_real(double val, vvp_vector2_t mask)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_net_t::force_vec4(const vvp_vector4_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
vvp_fun_signal4*sig = dynamic_cast<vvp_fun_signal4*> (fil);
|
||||
assert(sig);
|
||||
|
||||
sig->force_fil_vec4(val, mask);
|
||||
assert(fil);
|
||||
fil->force_fil_vec4(val, mask);
|
||||
send_vec4(val, 0);
|
||||
}
|
||||
|
||||
void vvp_fun_signal8::force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
force_fil_vec8(vvp_vector8_t(val,6,6), mask);
|
||||
}
|
||||
|
||||
void vvp_fun_signal8::force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
force_mask(mask);
|
||||
|
|
@ -120,6 +133,11 @@ void vvp_fun_signal8::force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask
|
|||
}
|
||||
}
|
||||
|
||||
void vvp_fun_signal8::force_fil_real(double val, vvp_vector2_t mask)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_net_t::force_vec8(const vvp_vector8_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
vvp_fun_signal8*sig = dynamic_cast<vvp_fun_signal8*> (fil);
|
||||
|
|
@ -129,6 +147,16 @@ void vvp_net_t::force_vec8(const vvp_vector8_t&val, vvp_vector2_t mask)
|
|||
send_vec8(val);
|
||||
}
|
||||
|
||||
void vvp_fun_signal_real::force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_fun_signal_real::force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_fun_signal_real::force_fil_real(double val, vvp_vector2_t mask)
|
||||
{
|
||||
force_mask(mask);
|
||||
|
|
|
|||
|
|
@ -140,6 +140,8 @@ class vvp_fun_signal4 : public vvp_fun_signal_vec {
|
|||
public:
|
||||
// Enable filter force.
|
||||
void force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask);
|
||||
void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask);
|
||||
void force_fil_real(double val, vvp_vector2_t mask);
|
||||
const vvp_vector4_t* filter_vec4(const vvp_vector4_t&val);
|
||||
// Test the value against the filter.
|
||||
vvp_bit4_t filtered_value(const vvp_vector4_t&val, unsigned idx) const;
|
||||
|
|
@ -254,7 +256,9 @@ class vvp_fun_signal8 : public vvp_fun_signal_vec {
|
|||
|
||||
public:
|
||||
// Enable filter force.
|
||||
void force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask);
|
||||
void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask);
|
||||
void force_fil_real(double val, vvp_vector2_t mask);
|
||||
const vvp_vector8_t* filter_vec8(const vvp_vector8_t&val);
|
||||
// Test the value against the filter.
|
||||
vvp_scalar_t filtered_value(const vvp_vector8_t&val, unsigned idx) const;
|
||||
|
|
@ -278,7 +282,10 @@ class vvp_fun_signal_real : public vvp_fun_signal_base {
|
|||
|
||||
public:
|
||||
// Enable filter force.
|
||||
void force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask);
|
||||
void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask);
|
||||
void force_fil_real(double val, vvp_vector2_t mask);
|
||||
|
||||
bool filter_real(double&val);
|
||||
// Test the value against the filter.
|
||||
double filtered_real(double val) const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue