Suppress unnecessary update of part select functor output.
Currently a part select functor will send updates to nodes connected
to its output whenever any part of its input vector changes. This
patch ensures updates are only sent when the selected part of the
input vector changes.
(cherry picked from commit 1453c5b0bb)
This commit is contained in:
parent
506c09f5f8
commit
47512e351f
16
vvp/part.cc
16
vvp/part.cc
|
|
@ -58,10 +58,15 @@ void vvp_fun_part_sa::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
|
|||
{
|
||||
assert(port.port() == 0);
|
||||
|
||||
if (val_ .eeq( bit ))
|
||||
vvp_vector4_t tmp (wid_, BIT4_X);
|
||||
for (unsigned idx = 0 ; idx < wid_ ; idx += 1) {
|
||||
if (idx + base_ < bit.size())
|
||||
tmp.set_bit(idx, bit.value(base_+idx));
|
||||
}
|
||||
if (val_ .eeq( tmp ))
|
||||
return;
|
||||
|
||||
val_ = bit;
|
||||
val_ = tmp;
|
||||
|
||||
if (net_ == 0) {
|
||||
net_ = port.ptr();
|
||||
|
|
@ -95,12 +100,7 @@ void vvp_fun_part_sa::run_run()
|
|||
vvp_net_t*ptr = net_;
|
||||
net_ = 0;
|
||||
|
||||
vvp_vector4_t res (wid_, BIT4_X);
|
||||
for (unsigned idx = 0 ; idx < wid_ ; idx += 1) {
|
||||
if (idx + base_ < val_.size())
|
||||
res.set_bit(idx, val_.value(base_+idx));
|
||||
}
|
||||
vvp_send_vec4(ptr->out, res, 0);
|
||||
vvp_send_vec4(ptr->out, val_, 0);
|
||||
}
|
||||
|
||||
vvp_fun_part_aa::vvp_fun_part_aa(unsigned base, unsigned wid)
|
||||
|
|
|
|||
Loading…
Reference in New Issue