oddball / ipxact2systemverilog

Translates IPXACT XML to synthesizable VHDL or SystemVerilog
GNU General Public License v2.0
56 stars 19 forks source link

Similar enums are not generated #50

Closed brucebenedictus closed 10 months ago

brucebenedictus commented 10 months ago

I found that if a register has multiple enums that look similar, the tool would not generate these.

The compare() function in enumTypeClass() did not take in to account that the 2 enums can have the same keys but with different values or the same values but with different key names. The compareList() only checked if 2 enums have one key incommon. But should look at the complete list, to see if the list is the same.

To show this problem I added 2 new fields (monkey3 and monkey4) in the example .xml file. These enums are similar to the monkey2 enum. But are not exactly the same. The compare function in enumTypeClass() would consider these as identical. But this is not true.

vermaete commented 10 months ago

@brucebenedictus could you fix the tab & white space mix-up in test.xml? otherwise: nice catch, thanks