Use 4 spaces for indentation. Do not use tabs.
Use camelCase for variables and functions. Use PascalCase for classes.
Always add a space between operators and operands. For example:
int a = 1 + 2;
Do not add a space between a function name and the opening parenthesis. For example:
int a = Add(1, 2);
This is an example of a bad spacing:
int a=1+2;
int a=Add (1, 2);
Use //
for single line comments. Use /* */
for multi line comments.
Use PascalCase for classes. Use camelCase for variables and functions.
Use Unix line endings. Do not use Windows line endings.
Use a maximum line length of 80 characters.
Always use braces for if statements, for loops, while loops, etc.
Always add a newline at the end of the file.
Use UTF-8 for file encoding.
Use .v
for Versace files. Use .vh
for Versace header files. Use .md
for Markdown files.
Use the following structure for Versace files:
root directory
├── documentation.md
├── main.v
├── main.vh
└── README.md
Do not use the following structure:
root directory
├── documentation.md
├── README.md
code directory
├── main.v
└── main.vh
This is because, the user that downloads the code will not know where to put the header file or where the code is. The only time you should use the second structure is if you are making a library. In that case, you should use the following structure:
root directory
├── documentation.md
├── README.md
├── main.v
headder files
├── main.vh
├── second.vh
├── third.vh
some method folder
├── some_method_one.v
└── some_method_two.v
Use main.v
for the main file. Use main.vh
for the main header file. Use README.md
for the README file. Use documentation.md
for the documentation file.