News for hackers. Stuff that matters.
Re:Designing a CPU in VHDL, Part 6: Program Counter, Instruc... by nhaehnle on Thursday July 23, 2015 @08:24PM (#9939348)
So, where is a great codebase for somebody who wants to learn?
Re:Designing a CPU in VHDL, Part 6: Program Counter, Instruc... by gluggymug on Thursday July 23, 2015 @08:54PM (#9939462)
Tools vendors each have coding guidelines that their stuff likes. At the RTL level, industry guys like myself just follow them like puppies due to fear of something in the tool chain breaking.

Then we complain to them when it misbehaves anyway. A quick google will you find some guides.

https://www.doulos.com/knowhow/vhdl_designers_guide/rtl_codi...

On top of that we had company specific style guides. Having jumped from company to company, each one is different here and there.

To be honest, I think we tended to avoid looking at other people's code when we could! Its like having to wipe someone else's butt. It all looks terrible. Everyone can pick on someone else's stuff.

Having said all that, the basic principles of engineering apply:

- Nice separation between the design and the test bench.

- modularity within the design itself.

- A convention of signal naming that will assist the verification process. Eventually they get thrown a waveform when something has gone wrong. They need to look at signal names that aren't some random alphabet jumble.

- Parameterize variables so they can be reconfigured easily.

etc.

Re:Designing a CPU in VHDL, Part 6: Program Counter, Instruc... by sliverstorm on Friday July 24, 2015 @01:44AM (#9940272)
industry guys like myself just follow them like puppies due to fear of something in the tool chain breaking

There's also value to a consistently styled codebase.

Re:Designing a CPU in VHDL, Part 6: Program Counter, Instruc... by alain94040 on Friday July 24, 2015 @10:10AM (#9942081)
I keep pointing people to the page I started a while back: Verilog for Software programmers (https://en.wikibooks.org/wiki/Programmable_Logic/Verilog_for...)

Maybe it's time for me to add another one: good Verilog RTL coding style, or basic RTL rules for Verilog... Based on the kinds of mistakes I see online, it would be easy to cover initial blocks, multiple assignments, etc.

EDIT: just started https://en.wikibooks.org/wiki/Programmable_Logic/Verilog_RTL... . For now, just contains placeholders for the items I want to cover, but feel free to add to the list, that's the whole point of a wiki.