One very good thing about this is that it makes it easy to create test cases directly in C++. You just supply inputs and clock the simulation directly in a C++ loop, then read outputs and assert them with
assert()
. And you can inspect variables by printing them or with GDB. This is infinitely more convenient than doing these IO-type tasks in Verilog itself.Some simulation examples under verilog.
First install Verilator. On Ubuntu:Tested on Verilator 4.038, Ubuntu 22.04.
sudo apt install verilator
Run all examples, which have assertions in them:
cd verilator
make run
File structure is for example:
- verilog/counter.v: Verilog file
- verilog/counter.cpp: C++ loop which clocks the design and runs tests with assertions on the outputs
- verilog/counter.params: gcc compilation flags for this example
- verilog/counter_tb.v: Verilog version of the C++ test. Not used by Verilator. Verilator can't actually run out
_tb
files, because they do in Verilog IO things that we do better from C++ in Verilator, so Verilator didn't bother implementing them. This is a good thing.
Example list:
- verilog/negator.v, verilog/negator.cpp: the simplest non-identity combinatorial circuit!
- verilog/counter.v, verilog/counter.cpp: sequential hello world. Synchronous active high reset with active high enable signal. Adapted from: www.asic-world.com/verilog/first1.html
- verilog/subleq.v, verilog/subleq.cpp: subleq one instruction set computer with separated instruction and data RAMs
Ciro Santilli's general feeling is that university should not own IP, it should belong to the researchers. Instead, university should help researchers make their startups, so they can become big, and then we can tax them and reinvest in the universities.
Of course, this goes through the nonprofit impact measurement difficulty. Maybe we could instead limit the IP to some reasonably small percentage, like 10%?
But still, as of 2020, if feels like universities are way too greedy.
- youtu.be/ji5_MqicxSo?t=1406 Achieving Your Childhood Dreams by Randy Pausch (2007). At this timestamp he tells a story about how university IP issues almost ruined a collaboration he was passionate about.
Unlisted articles are being shown, click here to show only listed articles.