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 <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2024-01-06 11:48:45 -08:00
parent 7c25e8506c
commit 60864ff1c7
2 changed files with 10 additions and 0 deletions

View File

@ -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);

View File

@ -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_;