Address dynamic array review feedback
This commit is contained in:
parent
755039d21b
commit
56b379b150
|
|
@ -3090,13 +3090,9 @@ static inline void VL_REVCOPY_Q(VlQueue<T>& q, const VlUnpacked<T, N_Depth>& fro
|
|||
template <typename T, std::size_t N_Depth>
|
||||
static inline void VL_COPY_Q(VlUnpacked<T, N_Depth>& q, const VlQueue<T>& from, int lbits,
|
||||
int srcElementBits, int dstElementBits) {
|
||||
if (srcElementBits == dstElementBits) {
|
||||
for (size_t i = 0; i < N_Depth; ++i) q[i] = from.at(static_cast<int32_t>(i));
|
||||
} else {
|
||||
VlQueue<T> tmpQ;
|
||||
VL_COPY_Q(tmpQ, from, lbits, srcElementBits, dstElementBits);
|
||||
for (size_t i = 0; i < N_Depth; ++i) q[i] = tmpQ.at(static_cast<int32_t>(i));
|
||||
}
|
||||
VlQueue<T> tmpQ;
|
||||
VL_COPY_Q(tmpQ, from, lbits, srcElementBits, dstElementBits);
|
||||
for (size_t i = 0; i < N_Depth; ++i) q[i] = tmpQ.at(static_cast<int32_t>(i));
|
||||
}
|
||||
|
||||
template <typename T, std::size_t N_Depth>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ module t (
|
|||
byte_t a[];
|
||||
byte_t b[];
|
||||
byte_t fixed[256];
|
||||
byte_t fixed_desc[255:0];
|
||||
byte_t fixed_rev[1:256];
|
||||
byte_t q[$];
|
||||
|
||||
|
|
@ -172,6 +173,12 @@ module t (
|
|||
fixed = q;
|
||||
`checkh(fixed[0], 8'h40);
|
||||
`checkh(fixed[255], 8'h3f);
|
||||
fixed_desc = a;
|
||||
`checkh(fixed_desc[255], 8'h9f);
|
||||
`checkh(fixed_desc[0], 8'ha0);
|
||||
fixed_desc = q;
|
||||
`checkh(fixed_desc[255], 8'h3f);
|
||||
`checkh(fixed_desc[0], 8'h40);
|
||||
fixed_rev = a;
|
||||
`checkh(fixed_rev[1], 8'ha0);
|
||||
`checkh(fixed_rev[256], 8'h9f);
|
||||
|
|
|
|||
Loading…
Reference in New Issue