Skip to content

Commit abb5a38

Browse files
docs: IRQ handler testbench
Signed-off-by: Istvan-Zsolt Szekely <istvan.szekely@analog.com>
1 parent b62acfe commit abb5a38

File tree

3 files changed

+864
-0
lines changed

3 files changed

+864
-0
lines changed

docs/testbenches/common/dependency_common.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Common with most testbenches:
77
* - SV dependency name
88
- Source code link
99
- Documentation link
10+
* - IRQ_HANDLER
11+
- :git-testbenches:`library/utilities/irq_handler_pkg.sv`
12+
- ---
1013
* - LOGGER_PKG
1114
- :git-testbenches:`library/utilities/logger_pkg.sv`
1215
- ---
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
.. _irq_handler_tb:
2+
3+
IRQ handler
4+
================================================================================
5+
6+
Overview
7+
-------------------------------------------------------------------------------
8+
9+
The purpose of this testbench is to give engineers a sandbox testbench, where
10+
they can test the interrupt request handler class.
11+
12+
Block design
13+
-------------------------------------------------------------------------------
14+
15+
The block design is based on the test harness with the addition of an IO VIP.
16+
The VIP is configure to be in master mode and connected to the interrupt
17+
controller's bit 0 position.
18+
19+
Block diagram
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
22+
.. image:: ./irq_handler_tb.svg
23+
:width: 800
24+
:align: center
25+
:alt: IRQ_Handler/Testbench block diagram
26+
27+
Configuration parameters and modes
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29+
30+
There are no parameters that can be configured in the testbench configuration
31+
files.
32+
33+
Build parameters
34+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35+
36+
There are no build parameters for this testbench.
37+
38+
Configuration files
39+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
41+
As this is a sandbox testbench, engineers are encouraged to change parameters
42+
and see what happens in the simulation. Since there are no parameters available
43+
for edit, the coniguration file's purpose is to give the testbench instance a
44+
name.
45+
46+
Tests
47+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48+
49+
The following test program file is available:
50+
51+
============ ==============================
52+
Test program Usage
53+
============ ==============================
54+
test_program Creates a basic test stimulus.
55+
============ ==============================
56+
57+
Available configurations & tests combinations
58+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
59+
60+
The test program is compatible with the configuration.
61+
62+
CPU/Memory interconnects addresses
63+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64+
65+
Below are the CPU/Memory interconnect addresses used in this project:
66+
67+
======== ===========
68+
Instance Address
69+
======== ===========
70+
axi_intc 0x4120_0000
71+
======== ===========
72+
73+
Interrupts
74+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+
Below are the Programmable Logic interrupts used in this project:
77+
78+
============= ===
79+
Instance name HDL
80+
============= ===
81+
irq_test_vip 0
82+
============= ===
83+
84+
Test stimulus
85+
-------------------------------------------------------------------------------
86+
87+
The test program is responsible for configuring and running the sequencers.
88+
89+
Environment Bringup
90+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91+
92+
The steps of the environment bringup are:
93+
94+
* Create the environment
95+
* Link the agents
96+
* Instantiate the IRQ handler class
97+
* Start the environment
98+
* Start the clocks
99+
* Assert the resets
100+
101+
IRQ handler testing
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
104+
* Register the IO VIP device event to the IRQ handler
105+
* Start the IRQ handler class
106+
* Create a subthread to catch the triggered event from IRQ handler
107+
* Generate an IRQ and see if the subthread is triggered
108+
109+
Priority packet generation testing
110+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111+
112+
* Create 10 priority and 10 non-priority packets at the same time and check if
113+
the priority packets are processed first.
114+
115+
.. note::
116+
117+
Priority packet processing order is checked manually.
118+
119+
Building the test bench
120+
-------------------------------------------------------------------------------
121+
122+
The testbench is built upon ADI's generic HDL reference design framework.
123+
ADI does not distribute compiled files of these projects so they must be built
124+
from the sources available :git-hdl:`here </>` and :git-testbenches:`here </>`,
125+
with the specified hierarchy described :ref:`build_tb set_up_tb_repo`.
126+
To get the source you must
127+
`clone <https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository>`__
128+
the HDL repository, and then build the project as follows:
129+
130+
**Linux/Cygwin/WSL**
131+
132+
*Example 1*
133+
134+
Building and simulating the testbench using only the command line.
135+
136+
.. shell::
137+
:showuser:
138+
139+
$cd testbenches/ip/irq_handler
140+
$make
141+
142+
*Example 2*
143+
144+
Building and simulating the testbench using the Vivado GUI. This command will
145+
launch Vivado, will run the simulation and display the waveforms.
146+
147+
.. shell::
148+
:showuser:
149+
150+
$cd testbenches/ip/irq_handler
151+
$make MODE=gui
152+
153+
*Example 3*
154+
155+
Build a particular combination of test and configuration, using the Vivado GUI.
156+
This command will launch Vivado, will run the simulation and display the
157+
waveforms.
158+
159+
.. shell::
160+
:showuser:
161+
162+
$cd testbenches/ip/irq_handler
163+
$make MODE=gui CFG=cfg1 TST=test_program
164+
165+
The built project can be found in the ``runs`` folder, where each configuration
166+
specific build has its own folder named after the configuration file's name.
167+
Example: if the following command was run for a single configuration in the
168+
clean folder (no runs folder available):
169+
170+
``make CFG=cfg1``
171+
172+
Then the subfolder under ``runs`` name will be:
173+
174+
``cfg1``
175+
176+
Resources
177+
-------------------------------------------------------------------------------
178+
179+
Testbenches related dependencies
180+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181+
182+
.. include:: ../../common/dependency_common.rst
183+
184+
Testbench specific dependencies: None
185+
186+
.. include:: ../../../common/more_information.rst
187+
188+
.. include:: ../../../common/support.rst

0 commit comments

Comments
 (0)