Basically code generation consists of transforming a model description into compilable and afterwards of course executable code. The model can be of graphical nature or a textual data model, e.g. based on the standards JSON or XML .
Our code generator is a .NET/ C# application, which generates C or C++ code for the embedded system. We use textual models in JSON, which contain the data structures, ranges, content descriptions etc.
First the generator reads the model, then checks it for syntax and consistency and transforms the model for code generation. With the help of the .NET Template Engine and the specific code templates for C and C++ or also C# etc. it generates the target code. Target code for the embedded system or also a PC/ Tablet based configuration tool.
We use code generation pragmatically, i.e. only where we can produce a real benefit. The two most important applications are communication and management of data and user interfaces.
For communication we model transferred data ("protocols") and configuration data. From this we can produce the code for storage, data management (non-volatile storage...) and transmission (as well as between embedded controllers as towards superordinate (PC-) systems). In addition an up-to-date documentation of the data emerges without further actions.
The modeling of GUI (Graphical User Interface) menus is the other application. The menu tree and the according authorizations are modeled, from this model the complete menu including the connection to the data model and the access/ authorization management code is generated .
A simpler application is the the is version information. There the code for the version information of the components of the embedded system is generated automatically and can e.g. be used for the management of updates.
When we apply cod generation in projects, then we can decrease the effort for development and at the same time optimize the quality, especially also for changes short before or after the start of production.
If you would also like to profit from our code generators, contact me:
Alois Cavelti
Do you have additional questions? Do you have a different opinion? If so, email me or comment your thoughts below!
Projects? Ideas? Questions? Let's do a free initial workshop!
No Comments