Differences between software simulator(spike),C++_based cycle-accurate simulator and Verilog_based simulator

980 views
Skip to first unread message

Yuanrong Wang

unread,
Mar 20, 2016, 11:35:01 PM3/20/16
to sw-...@lists.riscv.org
Hi, I am so confused with those three conceptions, can anybody help to explain the differences in detail ?

Many thanks !

Lennart Benschop

unread,
Mar 21, 2016, 2:53:57 AM3/21/16
to Yuanrong Wang, sw-...@lists.riscv.org
The Spike simulator is a functional simulator for the RISCV instruction
set. The RISCV specification specifies what each instruction does
functionally (add register r1 and register r2, store the result in r3),
but does not specify how many cycles each instruction takes (or how many
cycles you lose when you have a branch). So Spike does not count those
cycles.

The C++ based cycle accurate simulator is for a specific RISCV
implementation (not the RISCV ISA in general). It does model how many
cycles the processor takes for each instruction in each situation. As it
simulates the hardware in more detail, it is expected to be slower than
Spike. Like Spike (but unlike the Verilog model), you can just compile
the C++ model with a normal compiler and run it as ordinary software, no
expensive simulation tools are required.

Verilog is a hardware description language (not a programming language),
this is: you can use it as an input for synthesis tools,which produce a
netlist (a network of logic gates and their interconnections). This
netlist can be converted to an FPGA (a programmable chip with lots and
lots of logic gates that you can program so they are interconnected in a
specific way) or you can process the netlist further with other tools
into the layout of a real chip. A Verilog design can also be simulated,
but capable Verilog simulators cost a fortune (but some FPGA vendors
provide usable simulators at reduced cost or that come for free if you
buy one of their FPGA boards).

--
Lennart
> --
> You received this message because you are subscribed to the Google
> Groups "RISC-V SW Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sw-dev+un...@groups.riscv.org.
> To post to this group, send email to sw-...@groups.riscv.org.
> Visit this group at
> https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
> To view this discussion on the web visit
> https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/CAJiOYZGHPd%3DK%2BuS%2BBqTj3daPiedG9WK3fm%2BVJLP%2BxPiSKcW4gQ%40mail.gmail.com.


Rene Snajder

unread,
Mar 21, 2016, 5:42:55 PM3/21/16
to Lennart Benschop, sw-...@lists.riscv.org
Hi!

I have another question on that topic: 
You mention "the C++ based cycle accurate simulator". Am I correct to assume you
mean "Rocket-Chip"? After reading your message i went out to look if I can get this
running, since performance measures are relevant for my project.

So I checked out this [0] and tried to get it to work. Unfortunately I wasn't successful. 
It builds fine, but whenever I try running anything on it (with proxy kernel) it just 
hangs and does nothing - even the simplest Hello World programs that run fine in 
Spike. The symptoms are pretty much the same as this old stack-exchange post [1]
but the suggested solution (using the riscv-tools version that is linked by the repo)
didn't make any difference for me.

Anyways, is this even the right project if I want to do cycle accurate performance 
measurements?

Thanks,
Rene


Reply all
Reply to author
Forward
0 new messages