Code Style Guidelines
Author: Johannes Hofmann, Niklas Sirch 2025
Naming Conventions
Category |
Convention |
Example(s) |
Notes |
|---|---|---|---|
Classes |
|
|
Use |
Variables |
|
|
Start with lowercase, use snake_case. |
Methods/Functions |
|
|
Start with lowercase, use snake_case. |
Constants (Macros) |
|
|
All caps with underscores. |
SystemC Modules |
|
|
Prefix |
SystemC Processes |
|
|
Use |
Enumerations (enum) |
Type: |
|
Enum values must have a prefix to avoid name collisions. |
Config Options |
|
|
Used in |
Formatting
The project uses clang-format to format the code. The configuration is in
.clang-format. It is highly recommended to follow these guidelines to ensure a
consistent code style.
You can use the VS-Code Extension xaver.clang-format or format with these
commands.
$ # For single files use
$ clang-format -i file.cpp
$ # For all project files use
$ git ls-files '*.[ch]' '*.[ch]pp' | xargs clang-format -i