Testbench : HowTo


I am new to TinyFPGA and solved to program the BX with the sample program and also did some modifications. Very fine.
But if I use the sim in Apio I get the following error message:
Error: no testbench found for simulation
What does that mean? Is there some description what I need to do? Manual?

thanx for help in advance.


It means you do not have a top_tb.v file. You need the tb (testbench) file to run simulations.

Here is a not very good one for blinky:


Everything fine. Works. Thank you


I tried using this tb file, but the LED signal from ‘t’ is always ‘x’ (unknown) in gtkwave.

What follows is the start of the tob_tb.vcd file. How does it compare to yours? I assume I should see a 0$ or 1$ somewhere (because of the $var wire 1 $ LED $end line?) but I don’t. I haven’t actually looked into the gtkwave format yet, so I don’t know what should be in it.

Thu Oct 3 19:42:09 2019
Icarus Verilog
$scope module tb $end
$scope module t $end
$var wire 1 ! CLK $end
$var wire 1 " USBPU $end
$var wire 32 # blink_pattern [31:0] $end
$var wire 1 $ LED $end
$var reg 26 % blink_counter [25:0] $end
$upscope $end
$upscope $end
$enddefinitions $end
bx %
b101010001110111011100010101 #



This is starting to get to be an old post, but I will see if I get a response before starting a new thread.

I cloned @lawrie.griffiths Github and tried the blink example, I didn’t alter the verilog code in a any way before execution.

After 1000s of execution it hasn’t completed. Is this expected?


It is probably best to modify the blinky to blink faster if you are going to run it in simulation, so you don’t have to simulate so many clock cycles.