diff --git a/vvp/vthread.cc b/vvp/vthread.cc index 931411715..7e8527ed8 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -4033,7 +4033,7 @@ static bool do_release_vec(vthread_t thr, vvp_code_t cp, bool net_flag) if (full_sig) { net->fil->release(ptr, net_flag); } else { - net->fil->release_pv(ptr, base, width); + net->fil->release_pv(ptr, base, width, net_flag); } return true; diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index 8cc43d931..a22b8fd07 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -1137,7 +1137,7 @@ class vvp_net_fil_t : public vvp_vpi_callback { 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; + virtual void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag) =0; // The %force/link instruction needs a place to write the // source node of the force, so that subsequent %force and diff --git a/vvp/vvp_net_sig.cc b/vvp/vvp_net_sig.cc index e24eced67..f6f2dad30 100644 --- a/vvp/vvp_net_sig.cc +++ b/vvp/vvp_net_sig.cc @@ -679,7 +679,7 @@ void vvp_wire_vec4::release(vvp_net_ptr_t ptr, bool net_flag) } } -void vvp_wire_vec4::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) +void vvp_wire_vec4::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag) { assert(bits4_.size() >= base + wid); @@ -688,8 +688,15 @@ void vvp_wire_vec4::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) mask.set_bit(base+idx, 1); release_mask(mask); - ptr.ptr()->send_vec4(bits4_,0); - run_vpi_callbacks(); + + if (net_flag) { + ptr.ptr()->send_vec4_pv(bits4_.subvalue(base,wid), + base, wid, bits4_.size(), 0); + run_vpi_callbacks(); + } else { + ptr.ptr()->fun->recv_vec4_pv(ptr, force4_.subvalue(base,wid), + base, wid, bits4_.size(), 0); + } } unsigned vvp_wire_vec4::value_size() const @@ -800,7 +807,7 @@ void vvp_wire_vec8::release(vvp_net_ptr_t ptr, bool net_flag) ptr.ptr()->fun->recv_vec8(ptr, force8_); } -void vvp_wire_vec8::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) +void vvp_wire_vec8::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag) { assert(width_ >= base + wid); @@ -809,7 +816,15 @@ void vvp_wire_vec8::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) mask.set_bit(base+idx, 1); release_mask(mask); - ptr.ptr()->send_vec8(bits8_); + + if (net_flag) { + ptr.ptr()->send_vec8_pv(bits8_.subvalue(base,wid), + base, wid, bits8_.size()); + run_vpi_callbacks(); + } else { + ptr.ptr()->fun->recv_vec8_pv(ptr, force8_.subvalue(base,wid), + base, wid, force8_.size()); + } } unsigned vvp_wire_vec8::value_size() const @@ -894,14 +909,17 @@ void vvp_wire_real::release(vvp_net_ptr_t ptr, bool net_flag) ptr.ptr()->fun->recv_real(ptr, force_, 0); } -void vvp_wire_real::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid) +void vvp_wire_real::release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag) { vvp_vector2_t mask (vvp_vector2_t::FILL0, 1); for (unsigned idx = 0 ; idx < wid ; idx += 1) mask.set_bit(base+idx, 1); release_mask(mask); - assert(0); + if (net_flag) + ptr.ptr()->send_real(bit_, 0); + else + ptr.ptr()->fun->recv_real(ptr, force_, 0); } unsigned vvp_wire_real::value_size() const diff --git a/vvp/vvp_net_sig.h b/vvp/vvp_net_sig.h index 3e0dbed07..31f89de02 100644 --- a/vvp/vvp_net_sig.h +++ b/vvp/vvp_net_sig.h @@ -306,7 +306,7 @@ class vvp_wire_vec4 : public vvp_wire_base { void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask); void force_fil_real(double val, vvp_vector2_t mask); void release(vvp_net_ptr_t ptr, bool net_flag); - void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid); + void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag); // Implementation of vvp_signal_value methods unsigned value_size() const; @@ -342,7 +342,7 @@ class vvp_wire_vec8 : public vvp_wire_base { void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask); void force_fil_real(double val, vvp_vector2_t mask); void release(vvp_net_ptr_t ptr, bool net_flag); - void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid); + void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag); // Implementation of vvp_signal_value methods unsigned value_size() const; @@ -377,7 +377,7 @@ class vvp_wire_real : public vvp_wire_base { void force_fil_vec8(const vvp_vector8_t&val, vvp_vector2_t mask); void force_fil_real(double val, vvp_vector2_t mask); void release(vvp_net_ptr_t ptr, bool net_flag); - void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid); + void release_pv(vvp_net_ptr_t ptr, unsigned base, unsigned wid, bool net_flag); // Implementation of vvp_signal_value methods unsigned value_size() const;