# Why Verilog hardware development is difficult

DevFeed: [Why Verilog hardware development is difficult](<https://devfeed.tech/articles/verilog-is-weird-77765.md>)

Original publisher: [Read original article](<https://danluu.com/why-hardware-development-is-hard/>)

Published: 2013-09-07T00:00:00Z

Content type: article

Language: en

Sources: [Danluu](<https://devfeed.tech/sources/danluu.md>)

Topics: [Plover](<https://devfeed.tech/topics/plover.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Transpilers](<https://devfeed.tech/topics/transpilers.md>)

Tags: [hardware-design](<https://devfeed.tech/tags/hardware-design.md>), [synthesis](<https://devfeed.tech/tags/synthesis.md>), [verilog](<https://devfeed.tech/tags/verilog.md>), [vhdl](<https://devfeed.tech/tags/vhdl.md>), [warnings](<https://devfeed.tech/tags/warnings.md>)

## AI overview

The article explains why Verilog can be difficult to use for hardware development: its simulation-oriented event model does not map cleanly to synthesized hardware, so plausible code may produce unintended results. It discusses alternative hardware description approaches, including Chisel and Bluespec, and notes adoption and tooling barriers.

## Source excerpt

Verilog is the most commonly used language for hardware design in America (VHDL is more common in Europe). Too bad it's so baroque. If you ever browse the Verilog questions on Stack Overflow, you'll find a large number of questions, usually downvoted, asking "why doesn't my code work?", with code that's not just a little off, but completely wrong. Lets look at an example: "Idea is to store value of counter at the time of reset . . . I get DRC violations and the memory, bufreadaddr, bufreadval are all optimized out." always @(negedge reset or posedge clk) begin if (reset == 0) begin d_out <= 16'h0000; d_out_mem[resetcount] <= d_out; laststoredvalue <= d_out; end else begin d_out <= d_out + 1'b1; end end always @(bufreadaddr) bufreadval = d_out_mem[bufreadaddr]; We want a counter that keeps track of how many cycles it's been since reset, and we want to store that value in an array-like structure that's indexed by resetcount. If you've read a bit on semantics of Verilog, this is a perfectly natural way to solve the problem. Our poster knows enough about Verilog to use '<=' in state elements, so that all of the elements are updated at the same time. Every time there's a clock edge, we'll increment d_out. When reset is 0, we'll store that value and reset d_out. What could possibly go wrong? The problem is that Verilog was originally designed as a language to describe simulations, so it has constructs to describe arbitrary interactions between events. When X transitions from 0 to 1, do Y. Great! Sounds easy enough. But then someone had the bright idea of using Verilog to represent hardware. The vast majority of statements you could write down don't translate into any meaningful hardware. Your synthesis tool, which translates from Verilog to hardware will helpfully pattern match to the closest available thing, or produce nothing, if you write down something untranslatable. If you're lucky, you might get some warnings. Looking at the code above, the synthesis tool will see