Difference between revisions of "SystemVerilog formatter for our LowRISC-based guidelines (2-3G)"
From iis-projects
Line 1: | Line 1: | ||
+ | [[Category:Digital]] | ||
+ | [[Category:High Performance SoCs]] | ||
+ | [[Category:2020]] | ||
+ | [[Category:Group Project]] | ||
+ | [[Category:Paulsc]] | ||
+ | [[Category:Tbenz]] | ||
+ | [[Category:Available]] | ||
+ | |||
Coding conventions are an '''essential part''' of every large hardware (and software) project. They guide various '''non-functional aspects''' of the project and the source code like ''file organization'', ''indentation'', ''declarations'', ''code alignment'', ''naming conventions'', and many others. | Coding conventions are an '''essential part''' of every large hardware (and software) project. They guide various '''non-functional aspects''' of the project and the source code like ''file organization'', ''indentation'', ''declarations'', ''code alignment'', ''naming conventions'', and many others. | ||
Line 21: | Line 29: | ||
== Prerequisites == | == Prerequisites == | ||
Preferably: Experience with Python | Preferably: Experience with Python | ||
+ | ==Composition== | ||
+ | |||
+ | * 20% rule abstraction | ||
+ | * 10% parser exploration | ||
+ | * 30% formatting violation reporting | ||
+ | * 40% implementing formatter script | ||
− | == Supervisors == | + | == Project Supervisors == |
+ | * [[:User:Paulsc | Paul Scheffler]]: [mailto:paulsc@iis.ee.ethz.ch paulsc@iis.ee.ethz.ch] | ||
+ | * [[:User:Tbenz | Thomas Benz]]: [mailto:tbenz@iis.ee.ethz.ch tbenz@iis.ee.ethz.ch] |
Revision as of 18:10, 2 November 2020
Coding conventions are an essential part of every large hardware (and software) project. They guide various non-functional aspects of the project and the source code like file organization, indentation, declarations, code alignment, naming conventions, and many others.
Coding conventions serve very important purposes:
- Improving maintenance by making the code more familiar to the maintainers
- Improve readability of the code and ease the process of reviewing code
- Improving the overall code quality by giving the project a more complete and clean feel
- Ensuring better compatibility to different tools by encouraging the use of simpler and better-supported constructs
At IIS we use the LowRISC guidelines [1] for systemverilog. Although the effort of following the guidelines continuously while writing new modules is very manageable, it becomes a major hassle when including 3rd-party and ill-formatted into our projects.
Having a tool that automatically formats any systemverilog source code to apply to the coding guidelines of LowRISC would massively reduce the manual refactoring effort while integrating 3rd-party code.
Project Content
The project can be divided in the following sub tasks:
- Abstract the coding guidelines to a set of machine-understandable rules
- Explore existing parsing frameworks for systemverilog to simplify the processing of source code (or choose to create the parser from scratch)
- Use python to check a given source files against each rule and report the line or construct in violation with the rule
- Create a python tool that applies the rules to the source code and produces nicely formatted code
Prerequisites
Preferably: Experience with Python
Composition
- 20% rule abstraction
- 10% parser exploration
- 30% formatting violation reporting
- 40% implementing formatter script