ucb-bar / chisel-tutorial

chisel tutorial exercises and answers
Other
696 stars 197 forks source link

Need a consistent naming convention on variables #146

Open iBug opened 5 years ago

iBug commented 5 years ago

IMO, a consistent coding style, including naming convention, is important for good code.

While starting my own Chisel project some time ago, I faced some port mismatch issues, and found it was caused by inconsistent port naming. I then traced my study history back to this repository.

Long story short, here are the examples:

I think we need some guideline on this, for example ScalaStyle?

edwardcwang commented 5 years ago

Thank you for your interest in Chisel!

There is a style guide for Chisel itself here: https://github.com/freechipsproject/chisel3/blob/master/doc/style.md

From my experience, usually ports are either camelCase or snake_case (inherited from Verilog). I would also note that coding/naming styles do vary across institutions depending on the nature of the group/team.

Finally, have you seen https://github.com/freechipsproject/chisel-bootcamp ? The Chisel bootcamp is our latest iteration of Chisel educational materials.