pulp-platform / common_cells

Common SystemVerilog components
Other
508 stars 145 forks source link

Fix toolproblems in `id_queue` #138

Closed SamuelRiedel closed 2 years ago

SamuelRiedel commented 2 years ago

VCS can not handle the way the mask_t is defined for specific instances. Since the mask_t and the data_t need the same width anyway, and the tools have problems with this call, I propose we just reuse the data_t directly.

Furthermore, I would argue that we should use a width parameter instead of a type parameter for data_t in the future. This requires an interface change, but the current implementation could run into problems if the data_t is defined as a multidimensional array. On line 369, we loop over all bits in data_t, which only works for 1D vectors or packed structs, afaik. We could also just flatten the data_t inside the module to avoid changing the interface. @andreaskurth What do you think?

An example where the tool encounters problems is the axi_riscv_atomics/axi_riscv_lrsc/i_write_in_flight_queue module. The mask_t inferred by VCS is only 5 bits if the data_t is 49 bits.