Hacker News new | past | comments | ask | show | jobs | submit login
Verilator: Open-Source SystemVerilog simulator and lint system (github.com/verilator)
73 points by cl3misch 15 days ago | hide | past | favorite | 7 comments



So here's the scenario: you're using SystemVerilog, so Icarus does not work since it doesn't fully support it. You could use xsim (part of Xilinx Vivado)- it does work, but yuck, it's part of Vivado. So you end up using ModelSim- only now it's QuestaSim, and Siemens has eliminated the low cost tier (also, I'm not a huge fan the ModelSim GUI). I'm mean you might as well use ncsim or vcs..

So Verilator is the answer! Except..

- It's a two-state simulator, so some reset bugs are not found.

- Your Verilog-style testbench will not work.

- No encrypted IP support.

On the other hand:

- Verilator is fast. This is a big deal for fuzzing tests.

- The linting is awesome- it's good enough that you don't have to run the synthesis tool.

- gtkwave works well with it (you must use the FST format "--trace-fst", not VCD), then you get enums and structures. Counterintuitively, structures show up as modules not signals, but you get used to it.

You can also get free ModelSim as part of Lattice (or Questa as part of Altera) if you don't need the Xilinx IP.


I have been bitten so many times by bugs in third-party IP that I almost never use it unless the company literally cannot build the thing that the IP provider is selling.

Many companies instead buy the IP and then spend almost as much time as they would have needed to recreate it having back-and-forth conversations with their vendor sending bug reports and reproduction test cases.

Verilator is amazing for building huge systems when you make that tradeoff. Yes, you will do a lot more RTL development for logic, but you have none of these vendor headaches and you get to write your testbenches in C++ and also run tests that are extremely long. A single computer can simulate an SoC design at reasonable speed.


The Antmicro team are doing good work with making Verilator support SystemVerilog / UVM tests but from what I understand it's not complete yet.

I've also heard from various people that although Verilator is generally fast, it tends to choke on compiling sufficiently large designs, whereas the Cadence and Synopsys offerings eventually get it done.

Still, Verilator is an awesome piece of software. Maybe the biggest thing recommending it: it's totally free, so the number of simulations you run in parallel is bounded by compute availability rather than licenses.

Shameless plug: I'm a cofounder of silogy.io, which offers hosted Verilator and other Verilog sims, plus debugging and collab tools.


I'm interested in learning more about computer architecture. Would people recommend using verilator/verilog or something else lile vhdl?


Colleges and universities normally teach students the basics of digital logic and electronics before diving into Verilog or VHDL. At least that's how it was when I was a student many years ago.

You can learn computer architecture without knowing an HDL but it helps.

In my experience, commercial ASIC design in the US, VHDL is more popular in colleges and Verilog is more popular in industry.


Whichever one you like - they are basically equivalent in terms of what they can do. Verilog is more like C while VHDL is more like Ada.

We're in a golden age of youtube videos teaching you the basics of Verilog/VHDL, digital design, computer architecture, FPGAs, CPU implementation, etc. Starting in simulation (like verilator and gtkwave) is a great idea because 1) it's free 2) you get easy visibility into the low-level behavior of your design and 3) simulation is an important part of hardware design, testing, and debugging.

Besides HDLs (which are great) you can also use block design tools; for example, hneemann's Digital (which was influenced/inspired by Logisim) looks like it could be a nice learning, development, and simulation tool - and it also exports to Verilog and VHDL. There are several web-based environments as well.

I've also recently run into some other HDLs which look interesting, such as Migen, which is used in the LiteX SoC framework and implements an HDL as a Python library. (It also has successors which I have not used.)


And on a semi-related note, Patterson and Hennessy's "Computer Organization and Design (RISC-V Edition)" is an updated classic introduction to computer architecture (and its sequel is legendary.) I also recently discovered Harris and Harris' Digital Design and Computer Architecture (RISC-V Edition), and its follow-on lab courses, RVfpga and RVSoC, which cover implementation on an FPGA board and/or simulator.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: