1 |
5 |
sergeykhbr |
/** @page verification_page RTL Verification
|
2 |
|
|
|
3 |
|
|
@section sim_tb_link Top-level simulation
|
4 |
|
|
|
5 |
|
|
@par Test-bench example
|
6 |
|
|
Use file work/tb/riscv_soc_tb.vhd to run simulation scenario. You can
|
7 |
|
|
get the following time diagram after simulation of 2 ms interval.
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
@latexonly {\includegraphics[scale=0.75]{../doxygen/pics/soc_sim.png}} @endlatexonly
|
11 |
|
|
|
12 |
|
|
@note Simulation behaviour depends of current firmware image. It may
|
13 |
|
|
significantly differs in a new releases either as Zephyr OS kernel
|
14 |
|
|
image is absolutely different relative GNSS FW image.
|
15 |
|
|
|
16 |
|
|
Some FW versions can detect RTL simulation target by reading 'Target'
|
17 |
|
|
Register in PnP device that allows to speed-up simulation
|
18 |
|
|
by removing some delays and changing Devices IO parameters (UART speed
|
19 |
|
|
for example).
|
20 |
|
|
|
21 |
|
|
@par Running on FPGA
|
22 |
|
|
Supported FPGA:
|
23 |
|
|
|
24 |
|
|
ML605 with Virtex6 FPGA using ISE 14.7 (default).
|
25 |
|
|
KC705 with Kintex7 FPGA using Vivado 2015.4.
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
@warning In a case of using GNSS FW without connected RF front-end
|
29 |
|
|
don't forget to switch ON DIP[0] (i_int_clkrf) to enable
|
30 |
|
|
Test Mode. Otherwise there
|
31 |
|
|
wouldn't be generated interrupts and, as result, no UART
|
32 |
|
|
output.
|
33 |
|
|
|
34 |
|
|
@section auto_compare_page VCD-files automatic comparision
|
35 |
|
|
|
36 |
|
|
@subsection gen_sysc_vcd Generating VCD-pattern form SystemC model
|
37 |
|
|
|
38 |
|
|
Edit the following attributes in SystemC target script
|
39 |
|
|
debugger/targets/sysc_river_gui.json to enable vcd-file generation.
|
40 |
|
|
|
41 |
|
|
['InVcdFile','i_river','Non empty string enables generation of stimulus VCD file'].
|
42 |
|
|
['OutVcdFile','o_river','Non empty string enables VCD file with reference signals']
|
43 |
|
|
|
44 |
|
|
Files i_river.vcd and o_river.vcd will be generated.
|
45 |
|
|
The first one will be used as a RTL simulation stimulus to generate input
|
46 |
|
|
signals. The second one as a reference.
|
47 |
|
|
|
48 |
|
|
@subsection run_vcd_compare Compare RIVER SystemC model relative RTL
|
49 |
|
|
|
50 |
|
|
Run simulation in ModelSim with the following commands using correct pathes
|
51 |
|
|
for your host:
|
52 |
|
|
|
53 |
|
|
vcd2wlf E:/Projects/GitProjects/riscv_vhdl/debugger/win32build/Debug/i_river.vcd -o e:/i_river.wlf
|
54 |
|
|
vcd2wlf E:/Projects/GitProjects/riscv_vhdl/debugger/win32build/Debug/o_river.vcd -o e:/o_river.wlf
|
55 |
|
|
wlf2vcd e:/i_river.wlf -o e:/i_river.vcd
|
56 |
|
|
vsim -t 1ps -vcdstim E:/i_river.vcd riverlib.RiverTop
|
57 |
|
|
vsim -view e:/o_river.wlf
|
58 |
|
|
add wave o_river:/SystemC/o_*
|
59 |
|
|
add wave sim:/rivertop/*
|
60 |
|
|
run 500us
|
61 |
|
|
compare start o_river sim
|
62 |
|
|
compare add -wave sim:/RiverTop/o_req_mem_valid o_river:/SystemC/o_req_mem_valid
|
63 |
|
|
compare add -wave sim:/RiverTop/o_req_mem_write o_river:/SystemC/o_req_mem_write
|
64 |
|
|
compare add -wave sim:/RiverTop/o_req_mem_addr o_river:/SystemC/o_req_mem_addr
|
65 |
|
|
compare add -wave sim:/RiverTop/o_req_mem_strob o_river:/SystemC/o_req_mem_strob
|
66 |
|
|
compare add -wave sim:/RiverTop/o_req_mem_data o_river:/SystemC/o_req_mem_data
|
67 |
|
|
compare add -wave sim:/RiverTop/o_dport_ready o_river:/SystemC/o_dport_ready
|
68 |
|
|
compare add -wave sim:/RiverTop/o_dport_rdata o_river:/SystemC/o_dport_rdata
|
69 |
|
|
compare run
|
70 |
|
|
|
71 |
|
|
@note In this script I've used \c vcd2wlf and \c wlf2vcd utilities to form
|
72 |
|
|
compatible with ModelSim VCD-file. Otherwise there're will be errors because
|
73 |
|
|
ModelSim cannot parse std_logic_vector siganls (only std_logic).
|
74 |
|
|
|
75 |
|
|
*/
|