Closed v0lker closed 1 year ago
btw, the generation from JSON seems wrong, too, but differently so:
20 typedef struct {
21 uint32_t FIFO : 8; // Write to push value to TX FIFO, read to get data from RX FIFO
22 uint32_t :16; // reserved
23 uint32_t FERR : 1; // Frame error flag. Read to clear.
24 uint32_t PERR : 1; // Parity error flag. Read to clear.
25 } csr_data_t;
(would have expected only 8b of padding instead of 16b)
actually, the latest master i just checked out consistently delivers the same (but still wrong) struct definition, both with .yaml and .json sources.
there seems to be another issue: at least some of the generated masks seem to be wrong, too.
i haven't looked at the implementation, but i think that the padding that is generated just uses that item's lsb, forgetting to subtract how many bits have been allocated before.
e. g. in the example https://github.com/esynr3z/corsair/blob/master/examples/regmap_yaml/regs.yaml
there should be 8b of padding between
FIFO
andFERR
, and none betweenFERR
andPERR
, presumably, but: https://github.com/esynr3z/corsair/blob/master/examples/regmap_yaml/sw/regs.h(i originally noticed this in a different context, where i'd have expected no padding between two items. if the above example isn't valid, please let me know and i'll update with a different one.)