ArticleslgStudy

computer science

Verilator

Verilator is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Verilator rather than just read about it. In short: Verilator is a software programming tool which converts the hardware description language Verilog to a cycle-accurate behavioral model in the programming languages C++ or SystemC. The generated models are cycle-accurate and 2-state; as a consequence, the models typically offer higher performance than the more widely used event-driven simulators, which can model behavior within the clock cycle.

Verilator — main illustration
Verilator — illustration

Key takeaways

  • Verilator belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Verilator to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Verilator from memory before moving on to harder problems.

Reference excerpt

Verilator is a software programming tool which converts the hardware description language Verilog to a cycle-accurate behavioral model in the programming languages C++ or SystemC. The generated models are cycle-accurate and 2-state; as a consequence, the models typically offer higher performance than the more widely used event-driven simulators, which can model behavior within the clock cycle. Verilator is now used within academic research, open source projects and for commercial semiconductor development. It is part of the growing body of free electronic design automation (EDA) software. It is free and open-source software released under a GNU Lesser General Public License (LGPL) 3.0 only, or an Artistic License 2.0.

Use Verilator has seen its widest adoption in the academic and open-source software communities. The semiconductor industry has been more cautious in its adoption of an open-source tool, and has the financial means to use commercial alternatives.

Academic Researchers have used Verilator to develop new co-simulation environments, as part of general ASIC and FPGA design flows and in performance and power analysis. Verilator is also a popular tool for student dissertations, for example.

Open-source Verilator is an open-source tool, and has in turn been adopted by a number of other projects. The Fedora Electronic Lab has adopted Verilator as part of its open source design flow for Fedora 11. The OpenRISC architecture from OpenCores includes a cycle accurate reference model, generated from Verilog using Verilator. A 2010 paper described how the regression test suite for GCC could be run against a Verilator model of the OpenRISC 1200 as a way of detecting errors in the Verilog RTL implementation. TestDrive Profiling Master tool provides the virtual FPGA environment using Verilator.

Commercial Commercially, Philips Semiconductors (now NXP Semicondutors) have led the way. Their use of Verilator is becoming more widespread, for example within application notes. More recently Art of Silicon have described their use of Verilator on a farm of Linux processors as a route to faster regression testing of their commercial designs. The current maintainer of Verilator identified 27 companies and universities who had reported use of Verilator or contributed to its development, including Intel, Arm, CSR, Broadcom, Raytheon, Infineon, Stanford University, Imperial College London and Embecosm.

History Verilator's user manual provides a short history. The tool originated in 1994 with a team led by Paul Wasson at the Core Logic Group at Digital Equipment Corporation (DEC). It was used to convert Verilog code to C for co-simulation with a C based CPU model of the Alpha processor. During the mid-1990s Duane Galbi took over responsibility for development and the technology was adopted by other groups in DEC. In 1998 DEC released the source code. Since 2001 the technology has been developed by Wilson Snyder and others as part of the Veripool open source project. A SystemC mode was added and the tool rewritten from scratch in C++, leading to an increase in performance. In 2022 Verilator Version 5 added an IEEE-compliant scheduler and delay semantics, relaxing previous restrictions that ignored all delays.

Technology and key features Verilator converts Verilog to C++ or SystemC. It can handle all versions of Verilog and also some SystemVerilog assertions. The approach is closer to synthesis than event-driven simulation. The entire design is flattened (that is, all modules are expanded to create one module). Static analysis is used to eliminate wires and schedule all processes at model generation time. A C++ class is generated with a function which takes 2-state values on input ports and advance them to values on output ports at the next clock edge. SystemC is supported by providing a wrapper class using SystemC ports and with sensitivity to the clock rate(s), which will drive the ports of the underlying C++ model. Verilator supports automatically partitioning designs into multiple threads, also potentially improving performance.

Use with MATLAB Verilator converts synthesizable Verilog to C++, while C++ library could be compiled into a MEX file using MATLAB interface to C++. This is how Verilog designs can be directly simulated from MATLAB. Using compiled C++ models with MATLAB is faster than using co-simulation interfaces with a separate hardware description language (HDL) simulator. There is an open-source project named vmodel that compiles Verilog into a MEX file using Verilator and provides a set of functions for model simulation from MATLAB.

See also

Comparison of EDA software List of free and open-source EDA software List of HDL simulators OpenCores OpenRISC Verilog

References

External links Official website vmodel on GitHub

Worked examples

Example 1 — a first encounter with Verilator

Start with the simplest possible case. Write down what Verilator claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Verilator before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Verilator ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Verilator

In research
Verilator appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Verilator in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Verilator is common in secondary-school and first-year university syllabi. It links to neighbouring topics Electronic design automation software for Linux, Free electronic design automation software, so understanding it makes those chapters shorter.
In everyday life
Look for Verilator outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Verilator” →

How to study Verilator in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Verilator means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Verilator out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Verilator in simple terms?

Verilator is a software programming tool which converts the hardware description language Verilog to a cycle-accurate behavioral model in the programming languages C++ or SystemC. The generated models are cycle-accurate and 2-state; as a consequence, the models typically offer higher performance th…

Why does Verilator matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Verilator?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Verilator.

Tags

  • Electronic design automation software for Linux
  • Free electronic design automation software

Keep exploring