I’m making this up as a go, and I don’t know what I’m doing.
This is inspired (very very very loosely) by Unreal Engine’s Coding Standard document, because that is what happens to currently look good, neutral, and clean to me at the moment.
So, the very general guidelines are:
- Indent with tabs, not spaces.
- Braces or equivalent on own line is good, actually (but only when it makes sense).
- When in doubt TitleCase is a reasonable default for naming things, but also be consistent with what you are modifying or working with.
Use lowercase for keywords, eg entity
.
Use lowercase. Eg use ieee.numeric_std.all;
.
Lowercase, use underscores as spaces to be consistent with the ieee type names.
Lowercase with underscores.
Lowercase. Underscores.
SCREAM_THE_UNYIELDING_TRUTHS_MIGHTILY
Use title case. Eg signal MyGloriousSignal
.
Use title case, but also prefix with an “i” an “o”, or a “g” accordingly. Eg:
entity hail_eris is
generic (
gFnord : integer := 10
);
port (
iFhqwhgads : in std_logic;
oXyzzy : out std_logic
);
end hail_eris;
Use tabs instead of spaces. “4” is a good tab width.