r/chipdesign • • Mar 10 '22

Why verilog?

VHDL …..exists and has MUCH more intuitive syntax. Like I can’t express just how much easier vhdl is to read. Plus it has much more documentation with it.

Why does verilog (and system verilog, is there actually a difference?) exist today?

0 Upvotes

27 comments sorted by

14

u/bitflung Mar 10 '22 edited Mar 10 '22

Jesus I recall learning some vhdl in college... but after a decade of digital design in verilog I can't recall anything more than thinking "vhdl feels wrong".

What exactly do you dislike about verilog?

8

u/TheAnalogKoala Mar 10 '22

I actually started my career with VHDL in the mid 90s before everything was verilog. Back then a lot of companies in the US used it. I didn’t actually learn Verilog until maybe 2004 or something.

The difference isn’t huge. I’m sure you could be pretty much up to speed in VHDL in a couple days and fully proficient in a few weeks.

The nicest thing about it is it forces you to have some discipline. I personally think it’s easier to read other engineers’ code in VHDL unless your company has strict style guides that are actually followed.

It’s waaaay too easy to do impossible to decipher “write-only” code in Verilog.

And who the F thought that the .* instance declaration functionality in SystemVerilog was a good idea? Jesus. I have wasted way more time trying to figure out what the hell the issue was with that than I have saved from less typing.

As soon as I was in a position of influence in my org I banned its use on pain of death.

4

u/bitflung Mar 10 '22

My biggest gripe has come from watching teams where half use verilog mode autos and the other half have no idea what they are so they manually modify sections that will later be auto'd...

Yikes.

Worse than that but not language or tool specific are poorly maintained state machines. A long long time ago I inherited a "silicon proven" design including the ugliest state machine imaginable: 20k lines of code in a single combinatorial always block, state vector defines of arbitrary-looking binary patterns with non-descript names you couldn't easily differentiate in the code... Oh god was that thing a nightmare - and that horror show was only about 10% of the module itself.

All the same, I miss those days. I refactored that beast into a series of smaller state machines and spent weeks defending the changes in design review. First silicon worked like a charm, and I probably wouldn't miss that project if it hadn't :)

2

u/TheAnalogKoala Mar 10 '22

Verilog mode is the only thing that made me think about switching to emacs. But I got 30 years of vi experience lol.

1

u/dndthrowaway1985 Mar 16 '22

You can run the verilog-mode functions in batch mode from the command line, almost as easy, and doesn't take too much setup.

3

u/[deleted] Mar 13 '22

Verilog's distinction between reg and wire provide no benefit and are misleading. (system verilog fixed this with "logic").

"reg" sounds like it is short for "register" which one might think refers to the output of a flip-flop. But, assignments in an asynchronous always block are to a reg, even though the output isn't "registered".

VHDL, in contrast, makes a meaningful distinction between "variable" and "signal". Variables use blocking assignment, but must be scoped to an always block or function, so variables can't be used to pass data between always blocks. signals are scoped to module. They use nonblocking assignment and thus can be used to pass data between always blocks. The difference in declaration between "signal" and "variable" is useful. The difference in declaration between "reg" and "wire" is not.

VHDL also has a more detailed simulation model for nonblocking assignments than verilog does (vhdl's approach is more computationally intensive in simulation, so there's a tradeoff). https://insights.sigasi.com/opinion/jan/verilogs-major-flaw/

Despite these factors, Verilog is likely the better choice for chip design.

1

u/bitflung Mar 13 '22

Interesting, thanks for sharing.

Also, it would appear that verilog was originally designed just like vhdl in this manner, but over time evolved to use reg for anything that COULD retain a value/state over time while net must be driven at all times.

https://blogs.sw.siemens.com/verificationhorizons/2013/05/03/wire-vs-reg/

so they're remains a distinction even today, but once upon a time it was a more concrete distinction aligned very well with vhdl.

1

u/[deleted] Mar 13 '22

it would appear that verilog was originally designed just like vhdl in this manner

that's not how vhdl is set up. you misunderstand.

vhdl signals exclusively use nonblocking assignments. vhdl variables exclusively use blocking assignments. vhdl makes no distinction at declaration between synchronous and unsynchronous signals.

verilog initially didn't support nonblocking assignments at all.

that's interesting that reg used to match my intuition for register.

1

u/emerald_engineer_08 Mar 10 '22

Compared to vhdl, the syntax of verilog makes no sense at all

Like just defining bus widths for example

2

u/bitflung Mar 10 '22

alright, i'll bite... as i said, i don't recall vhdl anymore aside from just knowing i didn't like it back in college - and you provided basically nothing to go on here.

so i just googled for vhdl bus definitions. looks like the biggest difference is whether you use a ":" or the word-pair "downto".

aside from the number of keystrokes, how does one make more sense than the other? what are you trying to say here?

i recognize that i'm likely biased - verilog is essentially my "native language" (though admittedly i haven't written much verilog in the last half decade or so), so the syntax looks and feels obvious to me... can you actually present some form of a concrete example of what you dislike about verilog? or will this boil down to the "emacs" versus "vi" debate so many have had in the past: nothing more than personal preference?

-1

u/emerald_engineer_08 Mar 10 '22

Verilog is all you know

Vhdl is all I know

I don’t think we are going to get very far. I’m just perplexed as to why vhdl hasn’t made verilog obsolete

3

u/bitflung Mar 10 '22

Well, I suppose you ought to give verilog an honest try and find out first hand why it is more popular in industry?

My guess is that the answer is rooted in verification rather than design.

12

u/TheAnalogKoala Mar 10 '22 edited Mar 10 '22

SystemVerilog is way more powerful than VHDL. It is object oriented and has a ton of features which are great for verification.

SystemVerilog is to Verilog as C++ is to C.

VHDL has a few nice features. The real number data type was great for modeling analog circuits. You used to have to jump through hoops in Verilog (like $realtobits() and $bitstoreal() but now SystemVerilog has reals.

One great improvement in SystemVerilog is the “logic” type. Now the whole confusion between wire and reg goes away. Just use logic.

VHDL is a good language but it’s based on Ada so it is VERBOSE. Writing in Verilog feels like writing in C so it is more comfortable for a lot of people.

0

u/emerald_engineer_08 Mar 10 '22

The verbose ness is why I like it.

It’s also why python is great

5

u/TheAnalogKoala Mar 10 '22

You know you can write really verbose Verilog if you want to. I do.

-2

u/emerald_engineer_08 Mar 10 '22

I feel like the much more vague syntax limits that

4

u/verymixedsignal Mar 10 '22

You just need to get used to Verilog syntax, it's extremely intuitive to me. Give it like a week or two with a few small projects sprinkled in there and it'll all make sense. Also, Python isn't a verbose language lol

1

u/emerald_engineer_08 Mar 10 '22

What do you call it then?

Like python can do hello world with one line, while C needs 7

What’s that called, being able to condense things?

3

u/verymixedsignal Mar 10 '22

Succinct is the correct word. Verbose is the opposite of succinct.

I find Verilog to be actually incredibly succinct too, with VHDL being verbose (not that that's necessarily a bad thing).

2

u/ebinWaitee Mar 10 '22

Verbosity means everything is written out rather than implied. Python doesn't have a lot of verbosity and that's why you can write hello world in one line.

VHDL is more verbose than Verilog as you need to write begin and end etc.

1

u/verymixedsignal Mar 10 '22

Verilog requires begin and end

1

u/ebinWaitee Mar 10 '22

Interesting. I could've sworn it doesn't. In my defense I'm an analog designer and it's been years since I've touched Verilog :D

8

u/pcbnoob77 Mar 10 '22

Are you trolling?

-3

u/emerald_engineer_08 Mar 10 '22

It’s more out of frustration

28

u/kemiyun Mar 10 '22

I mean this is probably subjective but really? I find it way easier to read and understand verilog.

But the real answer is probably because it's a lot simpler to learn. One can argue that it may promote habits that aren't really good for design but I think easier entry is probably more important.

Also, I kinda dislike vhdl signal definitions and conversions. But that's personal choice.

2

u/sahand_n9 Mar 10 '22

I use Verilog-A for analog circuits and it is great

0

u/absurdfatalism Mar 10 '22

Let's talk Verilog default nettype being wire ffs

Let's talk Verilog not having structs ✊

Totally feel ya on vhdl keeping you honest...