Fix for pr3571573.
This patchs adds an implementation of recv_vec4_pv() to the vvp_fun_concat class. This was already present in devel, so just needed to be backported to v0.9.
This commit is contained in:
parent
0ab44eca13
commit
15fee99abb
|
|
@ -64,6 +64,36 @@ void vvp_fun_concat::recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
|
|||
vvp_send_vec4(port.ptr()->out, val_, 0);
|
||||
}
|
||||
|
||||
void vvp_fun_concat::recv_vec4_pv(vvp_net_ptr_t port, const vvp_vector4_t&bit,
|
||||
unsigned base, unsigned wid, unsigned vwid,
|
||||
vvp_context_t)
|
||||
{
|
||||
assert(bit.size() == wid);
|
||||
|
||||
unsigned pdx = port.port();
|
||||
|
||||
if (vwid != wid_[pdx]) {
|
||||
cerr << "internal error: port " << pdx
|
||||
<< " expects wid=" << wid_[pdx]
|
||||
<< ", got wid=" << vwid << endl;
|
||||
assert(0);
|
||||
}
|
||||
|
||||
unsigned off = 0;
|
||||
for (unsigned idx = 0 ; idx < pdx ; idx += 1)
|
||||
off += wid_[idx];
|
||||
|
||||
unsigned limit = off + wid_[pdx];
|
||||
|
||||
off += base;
|
||||
for (unsigned idx = 0 ; idx < wid ; idx += 1) {
|
||||
if (off+idx >= limit) break;
|
||||
val_.set_bit(off+idx, bit.value(idx));
|
||||
}
|
||||
|
||||
vvp_send_vec4(port.ptr()->out, val_, 0);
|
||||
}
|
||||
|
||||
void compile_concat(char*label, unsigned w0, unsigned w1,
|
||||
unsigned w2, unsigned w3,
|
||||
unsigned argc, struct symb_s*argv)
|
||||
|
|
|
|||
|
|
@ -1067,6 +1067,11 @@ class vvp_fun_concat : public vvp_net_fun_t {
|
|||
void recv_vec4(vvp_net_ptr_t port, const vvp_vector4_t&bit,
|
||||
vvp_context_t context);
|
||||
|
||||
// Part select variants of above
|
||||
void recv_vec4_pv(vvp_net_ptr_t port, const vvp_vector4_t&bit,
|
||||
unsigned base, unsigned wid, unsigned vwid,
|
||||
vvp_context_t);
|
||||
|
||||
private:
|
||||
unsigned wid_[4];
|
||||
vvp_vector4_t val_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue