Closed lorenzschmid closed 2 months ago
I am OK with the idea, but I am not sure the name of the new option is intuitive enough. I have two counter-proposition:
--gen-struct-consts
--consts-style=matlab-struct
I suppose that very few languages supports structured constants. Only python and matlab ?
Thanks for your feedback. In fact, I thought about your second proposal too. In the end, it was easier to implement it with a separate argument. But I do not mind adapting it by using --consts-style=matlab-struct
.
Right now, I added only support for Matlab. But Python should be easy to add.
So let's go for --consts-style=matlab-struct
.
Implemented in 40a5af0286b84ff152a7e7c7d87996d7835099e3.
Adds support to generate structured constants: So far, the
--gen-consts
options allows to generate constant files for different programming languages (internally called "styles"). Thereby, different properties of the register map, its registers and fields are printed in a non-hierarchical way. The constants have no logical connection but are placed one after the other.Using the new
--gen-struct
option, still generates constant files but extends the concept by generating hierarchical structures. To give an example with the Matlab "style":--gen-consts
:--gen-struct
(newly added):This MR also adds support for printing Matlab constants.