In this cast I use WAL to determine the number of cycles the SERV and VexRiscv cores need to execute one instruction on average.
To compute this value I analyze the number if instructions that where executed by each core and divided it by the number of clock cycles of the complete waveform.
In the SERV core whenever the execution of a new instruction starts the signal wb_ibus_ack on the instruction bus is set to high. Similarily, in the VexRiscv core we know an instruction was executed when the isFiring signal of the last pipeline stage is set to high.
;; SERV
(load "serv-addi.vcd" serv)
; create some conveniant aliases
(alias clk TOP.servant_sim.dut.cpu.clk)
(alias start TOP.servant_sim.dut.wb_ibus_ack)
; this function returns the number of clock cycles in the waveform
; which is the number of indices / 2
(defun ticks () (/ MAX-INDEX 2))
; calculate avg. number of cycles between instructions
; and store it in the serv variable
(set [serv (/ (ticks) (length (find (&& clk start))))])
; unload waveform and remove aliases
(unload serv)
(unalias clk start)
;; VexRiscV
(load "vex-addi.vcd" vex)
(alias clk TOP.VexRiscv.clk)
(alias start TOP.VexRiscv.writeBack_arbitration_isFiring)
(set [vex (/ (ticks) (length (find (&& clk start))))])
(printf "SERV: %d\n" serv)
(printf "VEX : %d\n" vex)
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v2 format, as a .cast file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 469460.cast
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/469460.cast',
document.getElementById('player'),
{ cols: 211, rows: 57 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/469460 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.