-
Notifications
You must be signed in to change notification settings - Fork 0
Guidelines
Leonard Pfeiffer edited this page Nov 15, 2023
·
16 revisions
/*
Project: MARVIN
Sector: RAM/COM/CPU/USB/TOP/UTILS/etc.
Summary:
Authors:
Device: (Optional)
*/
- Use squashing whenever possible
- Syntactic indentation
- 1 tab = 4 space characters
- "begin" always at end of first line of block, not at begin of second line
- Ports and parameters
- Process purpose and procedure
- Custom types
- Parameters
- Standard ports (e.g. clk, rst, etc.)
- Every single step of a procedure (only comment important steps and group similar steps' descriptions)
-
<code> // <comment>
- Only for long comments and comments that cover several lines of code
// <comment> <code>
-
/* <comment> */ <code>
- parameters
- ports
- inputs
- inouts
- outputs
- types
- parameters
- registers
- wires
- processes
- assignments
- types
- parameters
- functions
- Variable names "_" in instantiation and just "" inside module
- Short forms for reset 🠖 rst, clock 🠖 clk, reference 🠖 ref
- Everything small, constants in caps
- Lowactivity is represented in variable name by underscore "_" character at the end, do not use "_n"
- Range and width parameters may use "_" to point out it is being used for a width: <NAME>_ Using W, WIDTH, RANGE, etc. is not encouraged.
- Vectors [x:y] "from x downto y" (x >= y)
- Types only if necessary
- Small letters (b,o,d,h) for representation, not in caps
- Project
- src (saucecode)
- toplevel
- utils (utility modules, can be used anywhere)
- com
- vga
- uart
- i2c
- usb
- cpu
- cu
- alu
- ram
- qsys (Platform designer files)
- quartus (Quartus files)
- modelsim (Modelsim files)
- src (saucecode)
- File has to end with newline
- One module or package per file
- Entity name has to be equal to file name