axi icon indicating copy to clipboard operation
axi copied to clipboard

Why is `xbar_latency_e` an `enum`?

Open FrancescoConti opened this issue 1 year ago • 1 comments

https://github.com/pulp-platform/axi/blob/ac5deb3ff086aa34b168f392c051e92603d6c0e2/src/axi_pkg.sv#L468-L476

Logically speaking, it seems to me that the xbar_latency_e should be a logic vector (or a struct), not an enumeration. It makes logically sense to activate cuts for each channel separately and we have instances in which this is done (e.g., https://github.com/pulp-platform/pulp_soc/blob/f31c5a25f387432231be0bc6457a08fe47ce6f61/rtl/pulp_soc/soc_interconnect.sv#L277 ). Under some (currently not so clear) conditions, this may trigger a Synth 8-9123 elab error in Vivado (seen 2023.2):

ERROR: [Synth 8-9123] an enum variable may only be assigned the same enum typed variable or one of its values [/home/fconti/pulpissimo/working_dir/pulp_soc/rtl/pulp_soc/soc_interconnect.sv:301]

It's not clear why the error is not always raised, note that enumeration is strongly typed in the SV standard as per IEEE 1800-2017 sec. 6.19.3. I guess other tools treat this simply as a logic [9:0], but why the error is not always there in Vivado is not clear to me atm.

FrancescoConti avatar May 07 '24 12:05 FrancescoConti

@micprog was faster in proposing a solution than I am in complaining ;) https://github.com/pulp-platform/axi/pull/340

FrancescoConti avatar May 07 '24 12:05 FrancescoConti