News for hackers. Stuff that matters.
Re:Why hardware development is hard, part 1: Verilog is weir... by mindslight on Thursday November 03, 2016 @12:51PM (#12865662)
Having done some Verilog professionally, this is my initial reaction too. It is quality advice for anyone needing to use Verilog.

Yet if I put on my software cap and think of how things should be, the whole point of a language is to create an abstraction. This allows a designer to think and express their intent at a higher level. If an abstraction is not complete then the designer can never stop thinking in the lower level terms, which nullifies the benefit.

Re:Why hardware development is hard, part 1: Verilog is weir... by akiselev on Thursday November 03, 2016 @02:14PM (#12866455)
The problem is that programming abstractions are fundamentally different from those in hardware description languages. Whereas programming abstracts away arbitrary manipulation of memory with variables, pointers, and functions, Verilog abstracts away transistor topology and the NP-hard routing problem inherent in FPGA/ASIC design. The former is an abstraction for telling a precisely defined system what to do while the latter describes the system of equations for a (possibly nondeterministic) linear constraint solver.

Hardware description languages can never be as abstract as programming languages for the same reason that we can't create a single unifying abstraction for imperative multi and single threaded code: synchronization. Since each algorithm or data structure can have unique memory access/sync patterns, especially once optimized, there is no way to abstract away parallelization so we're forced to work with a large number of low level primitives like queues, locks, etc. In silicon, not only is everything running in parallel but each abstract unit of functionality has many more "degrees of freedom" like synchronization points, clock speeds, and physical location. It's simply impossible to cleanly abstract over all of the little tweaks you have to do in the implementation phase to get your blocks of transistors to synchronize properly.

Re:Why hardware development is hard, part 1: Verilog is weir... by aninhumer on Thursday November 03, 2016 @03:12PM (#12867016)
>Hardware description languages can never be as abstract as programming languages

I'm not sure what it would even mean for HDLs to be "as abstract" as programming languages. They're different paradigms, and they have different abstractions, so you can't really compare them directly.

What I do know is that you can do a lot better than Verilog, because I've experienced it. I worked in Bluespec for a few years and as a language it's so much better than Verilog it's not even funny.

Indeed, using it made me stop thinking of Haskell as a programming language, and start thinking of it as a declarative language for constructing imperative programs in the IO monad.

Re:Why hardware development is hard, part 1: Verilog is weir... by duaneb on Thursday November 03, 2016 @04:36PM (#12867710)
> Indeed, using it made me stop thinking of Haskell as a programming language, and start thinking of it as a declarative language for constructing imperative programs in the IO monad.

Yea, the parallels between hardware design and haskell are striking. (Not just haskell, but it is perhaps the easiest to see.) In undergrad, I wrote my basic cpu project (16-bit risc) in haskell, then got it to write the verilog for me. This had the benefit of having an incredibly fast iteration cycle (including testing) paired with the ability to output an actual hardware description at any point. Very powerful. It really hammers home the difference between computation and I/O, a common theme in both CPU design and functional programs.

Also—and this is just my opinion—I much prefer declaring the computation with logical combinators rather than manually specifying how the bits are routed. This is much easier in haskell (or any functional language) than it is in verilog.

Re:Why hardware development is hard, part 1: Verilog is weir... by mungoman2 on Thursday November 03, 2016 @05:34PM (#12868190)
Hm, interesting. Have you written about this anywhere?
Re:Why hardware development is hard, part 1: Verilog is weir... by petra on Thursday November 03, 2016 @04:46PM (#12867784)
If you work smartly , there's no inherent conflict between abstraction and efficiency. For example , here's a DARPA project - which uses Chisel to implement an efficient version of the risc-V microprocessors, in an abstract, very productive manner:

http://people.eecs.berkeley.edu/~bora/Conferences/2015/ESSCI...

Re:Why hardware development is hard, part 1: Verilog is weir... by aninhumer on Thursday November 03, 2016 @01:17PM (#12865904)
Yeah, I think the problem here is that Verilog was originally created as a language for simulating hardware, not synthesising it. So its semantic model (which is essentially a bunch of imperative processes running in parallel) is not very appropriate for designing hardware.
Re:Why hardware development is hard, part 1: Verilog is weir... by nickpsecurity on Thursday November 03, 2016 @09:39PM (#12869719)
Maybe try Morrison's Flow-based Programming. It seems closer to hardware.