News for hackers. Stuff that matters.
Re:Why hardware development is hard, part 1: Verilog is weir... by raverbashing on Thursday November 03, 2016 @12:30PM (#12865431)
That's like trying to say a certain "high level language" is weird because you need to first write your program in ASM them translate it to this language

It makes no sense

I don't want to design from the bottom up and then if I'm "lucky" the compiler will give me what I wanted.

Re:Why hardware development is hard, part 1: Verilog is weir... by jwise0 on Thursday November 03, 2016 @12:42PM (#12865559)
Well, what you want and the physical realities of synthesis are different :-)

In the early days of compilers, of course, you were mostly writing C as a macro language for your system's assembly language. If you wanted your program to perform well, you'd have to write C that was, more or less, a translation of assembly that you'd constructed in your head first. If you wrote bizarre C, you'd either get incorrect results, or if you were lucky, you'd get correct but inefficient results.

But that's also Dan's point: Verilog isn't a "high level language". You don't write programs with it, you describe hardware with it. (In fact, that is why it is called a 'hardware description language'!) So if you try to write a program, instead of describing hardware, you'll get something that isn't really either.

Re:Why hardware development is hard, part 1: Verilog is weir... by marcosdumay on Thursday November 03, 2016 @01:53PM (#12866266)
> Well, what you want and the physical realities of synthesis are different :-)

Then why doesn't the language let me describe what I want, and if reality disagrees, throws some compiling errors back?

Our current HDLs are lower level than block diagrams. And anything higher level they may claim to provide is iffy and won't work on practice. That's not a problem with the languages, but it is a problem for hardware development.

Re:Why hardware development is hard, part 1: Verilog is weir... by raverbashing on Thursday November 03, 2016 @12:47PM (#12865618)
> If you wanted your program to perform well, you'd have to write C that was, more or less, a translation of assembly that you'd constructed in your head first.

Maybe in really old compilers

> You don't write programs with it, you describe hardware with it

Which is fair enough, but it seems the "hardware description" pretends to be of a higher-level than it really is.

If you need the user to describe gates and flip-flops and how they connect then make them describe this.

Re:Why hardware development is hard, part 1: Verilog is weir... by vvanders on Thursday November 03, 2016 @12:52PM (#12865666)
> If you need the user to describe gates and flip-flops and how they connect then make them describe this.

You're talking about RTL, which is exactly what these languages output.

Fundamentally they're not programming languages, unfortunately the initial instinct is to treat them as such and it leads to a ton of confusion.

Re:Why hardware development is hard, part 1: Verilog is weir... by raverbashing on Thursday November 03, 2016 @02:27PM (#12866575)
> You're talking about RTL, which is exactly what these languages output.

So why am I wasting time with verilog then if I have to "design" in low-level then translate it to verilog?

Re:Why hardware development is hard, part 1: Verilog is weir... by wolfgke on Thursday November 03, 2016 @12:54PM (#12865696)
> You're talking about RTL, which is exactly what these languages output.

If VHDL/Verilog would output RTL, you could easily analyze it just as you analyze assembly output of your favorite compiler. Unluckily the output is some proprietary bitstream for the FPGA.

Re:Why hardware development is hard, part 1: Verilog is weir... by k0ngo on Thursday November 03, 2016 @01:09PM (#12865839)
Just as a software compilation flow is devided into preprocessing, compilation, assembly, and linking, a HDL flow is divided into synthesis, mapping, place and route, timing analysis and bitstream generation. RTL is the output of the synthesis stage and is readily available to the designer, typically both as code and as a graphical schematic.
Re:Why hardware development is hard, part 1: Verilog is weir... by vvanders on Thursday November 03, 2016 @01:02PM (#12865767)
It's been a while since I poked around in RTL but last time I was working with FPGAs it was possible to inspect RTL and view the synthesis results.
Re:Why hardware development is hard, part 1: Verilog is weir... by pklausler on Thursday November 03, 2016 @01:33PM (#12866068)
> In the early days of compilers, of course, you were mostly writing C as a macro language

In the early days of compilers, we were mostly writing FORTRAN.

Re:Why hardware development is hard, part 1: Verilog is weir... by vvanders on Thursday November 03, 2016 @12:41PM (#12865546)
That's more like saying I expect to write highly performant software without knowing about CPU caches or the O(n) of my algorithms.

These are tools meant to scale out designs that you already have a good understanding of. Hardware is implicitly bottom up because you're dealing with physics at the bottom. Very few pieces of hardware are lenient to a single cycle of latency much less 10's of milliseconds.

Re:Why hardware development is hard, part 1: Verilog is weir... by moftz on Thursday November 03, 2016 @05:04PM (#12867943)
A lot of times, you can get access to IP blocks. You can view a reference design of what the module does but the actual code is a binary blob owned by the chip manufacturer. You can treat these as functions and build larger designs from them. It's great because you don't have to write really low-level stuff like RTL except for hooking up the different modules. You can then do some more complex combinational logic using always blocks that kind of look like C. It's not super high level like C++ or python but you can get some higher levels of abstraction. Some IDEs have a visual way to write the code using schematics. You connect the logic modules together using wires. It makes HDL a bit easier to understand what's happening but you need to compartmentalize your code as much as possible, essentially making everything a function.