From 60864ff1c7634a15b945170d60b2a408e422d844 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 6 Jan 2024 11:48:45 -0800 Subject: [PATCH] vvp: repeat: Implement partial vector receive The repeat functor can receive a partial vector. Make sure this is handled. Since the expectation is that will only happen if the input wire is driven by a single partial selection the default recv_vec4_pv_() can be used which replaces the missing bits by `z`. Signed-off-by: Lars-Peter Clausen --- vvp/concat.cc | 7 +++++++ vvp/vvp_net.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/vvp/concat.cc b/vvp/concat.cc index 448a44e92..1f19dd139 100644 --- a/vvp/concat.cc +++ b/vvp/concat.cc @@ -234,6 +234,13 @@ void vvp_fun_repeat::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit, port.ptr()->send_vec4(val, 0); } +void vvp_fun_repeat::recv_vec4_pv(vvp_net_ptr_t port, const vvp_vector4_t &bit, + unsigned base, unsigned vwid, + vvp_context_t context) +{ + recv_vec4_pv_(port, bit, base, vwid, context); +} + void compile_repeat(char*label, long width, long repeat, struct symb_s arg) { vvp_fun_repeat*fun = new vvp_fun_repeat(width, repeat); diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index b7e14dd7a..a5220209e 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -1450,6 +1450,9 @@ class vvp_fun_repeat : public vvp_net_fun_t { void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit, vvp_context_t context); + void recv_vec4_pv(vvp_net_ptr_t port, const vvp_vector4_t&bit, + unsigned int base, unsigned int vwid, + vvp_context_t context) final; private: unsigned wid_;