Automatic variables cannot use wire filters.
Make vec4 variables use stub filter functions so that the filter does not interfere with automatic values.
This commit is contained in:
parent
0a72df2025
commit
21b1f620ba
|
|
@ -357,6 +357,37 @@ vvp_vector4_t vvp_fun_signal4_aa::vec4_unfiltered_value() const
|
|||
return vec4_value();
|
||||
}
|
||||
|
||||
void vvp_fun_signal4_aa::release(vvp_net_ptr_t,bool)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void vvp_fun_signal4_aa::release_pv(vvp_net_ptr_t,unsigned,unsigned,bool)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
unsigned vvp_fun_signal4_aa::filter_size() const
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
void vvp_fun_signal4_aa::force_fil_vec4(const vvp_vector4_t&, vvp_vector2_t)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
void vvp_fun_signal4_aa::force_fil_vec8(const vvp_vector8_t&, vvp_vector2_t)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
void vvp_fun_signal4_aa::force_fil_real(double, vvp_vector2_t)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
void vvp_fun_signal4_aa::get_value(struct t_vpi_value*)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
|
||||
vvp_fun_signal8::vvp_fun_signal8(unsigned wid)
|
||||
: bits8_(wid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,16 +114,10 @@ class vvp_fun_signal_vec : public vvp_fun_signal_base {
|
|||
virtual vvp_vector4_t vec4_unfiltered_value() const =0;
|
||||
};
|
||||
|
||||
class vvp_fun_signal4 : public vvp_fun_signal_vec {
|
||||
|
||||
public:
|
||||
explicit vvp_fun_signal4() {};
|
||||
};
|
||||
|
||||
/*
|
||||
* Statically allocated vvp_fun_signal4.
|
||||
*/
|
||||
class vvp_fun_signal4_sa : public vvp_fun_signal4 {
|
||||
class vvp_fun_signal4_sa : public vvp_fun_signal_vec {
|
||||
|
||||
public:
|
||||
explicit vvp_fun_signal4_sa(unsigned wid, vvp_bit4_t init=BIT4_X);
|
||||
|
|
@ -149,7 +143,7 @@ class vvp_fun_signal4_sa : public vvp_fun_signal4 {
|
|||
/*
|
||||
* Automatically allocated vvp_fun_signal4.
|
||||
*/
|
||||
class vvp_fun_signal4_aa : public vvp_fun_signal4, public automatic_hooks_s {
|
||||
class vvp_fun_signal4_aa : public vvp_fun_signal_vec, public vvp_signal_value, public vvp_net_fil_t, public automatic_hooks_s {
|
||||
|
||||
public:
|
||||
explicit vvp_fun_signal4_aa(unsigned wid, vvp_bit4_t init=BIT4_X);
|
||||
|
|
@ -175,6 +169,17 @@ class vvp_fun_signal4_aa : public vvp_fun_signal4, public automatic_hooks_s {
|
|||
vvp_vector4_t vec4_value() const;
|
||||
vvp_vector4_t vec4_unfiltered_value() const;
|
||||
|
||||
// Automatic variables cannot be forced or released. Provide
|
||||
// stubs that assert.
|
||||
virtual void release(vvp_net_ptr_t ptr, bool net_flag);
|
||||
virtual void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag);
|
||||
|
||||
virtual unsigned filter_size() const;
|
||||
virtual void force_fil_vec4(const vvp_vector4_t&val, vvp_vector2_t mask);
|
||||
virtual void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask);
|
||||
virtual void force_fil_real(double val, vvp_vector2_t mask);
|
||||
virtual void get_value(struct t_vpi_value*value);
|
||||
|
||||
private:
|
||||
unsigned context_idx_;
|
||||
unsigned size_;
|
||||
|
|
|
|||
19
vvp/words.cc
19
vvp/words.cc
|
|
@ -88,16 +88,17 @@ static void __compile_var(char*label, char*name,
|
|||
{
|
||||
unsigned wid = ((msb > lsb)? msb-lsb : lsb-msb) + 1;
|
||||
|
||||
vvp_fun_signal_vec*vsig;
|
||||
vvp_wire_vec4*vfil = new vvp_wire_vec4(wid, BIT4_X);
|
||||
if (vpip_peek_current_scope()->is_automatic) {
|
||||
vsig = new vvp_fun_signal4_aa(wid);
|
||||
} else {
|
||||
vsig = new vvp_fun_signal4_sa(wid);
|
||||
}
|
||||
vvp_net_t*node = new vvp_net_t;
|
||||
node->fun = vsig;
|
||||
node->fil = vfil;
|
||||
|
||||
if (vpip_peek_current_scope()->is_automatic) {
|
||||
vvp_fun_signal4_aa*tmp = new vvp_fun_signal4_aa(wid);
|
||||
node->fil = tmp;
|
||||
node->fun = tmp;
|
||||
} else {
|
||||
node->fil = new vvp_wire_vec4(wid, BIT4_X);
|
||||
node->fun = new vvp_fun_signal4_sa(wid);
|
||||
}
|
||||
vvp_signal_value*vfil = dynamic_cast<vvp_signal_value*>(node->fil);
|
||||
|
||||
define_functor_symbol(label, node);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue