Skip to content

Commit 18f655f

Browse files
committed
docs/cn0577: Add doc
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
1 parent 6afd648 commit 18f655f

File tree

1 file changed

+290
-0
lines changed
  • docs/testbenches/project_based/cn0577

1 file changed

+290
-0
lines changed
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
.. _cn0577:
2+
3+
CN0577
4+
================================================================================
5+
6+
Overview
7+
-------------------------------------------------------------------------------
8+
9+
The purpose of this testbench is to validate the of the
10+
:git-hdl:`projects/cn0577` reference design.
11+
12+
The entire HDL documentation can be found here
13+
:external+hdl:ref:`CN0577 HDL project <cn0577>`.
14+
15+
Block design
16+
-------------------------------------------------------------------------------
17+
18+
The testbench block design includes part of the CN0577 HDL reference design,
19+
along with VIPs used for clocking, reset, PS and DDR simulations.
20+
21+
Block diagram
22+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23+
24+
The data path and clock domains are depicted in the below diagram:
25+
26+
CN0577 parallel interface
27+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
29+
.. image:: ./cn0577_tb.svg
30+
:width: 800
31+
:align: center
32+
:alt: CN0577/Testbench block diagram
33+
34+
Configuration parameters and modes
35+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36+
37+
The following parameter of this project that can be configured:
38+
39+
- TWOLANES: defines the device's number of data lanes:
40+
Options: 0 - One lane, 1 - Two lanes
41+
- ADC_RES: defines the device's resolution in bits:
42+
Options: 16 - 16 bits, 18 - 18 bits
43+
44+
Configuration files
45+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46+
47+
The following configuration files are available:
48+
49+
+-----------------------+--------------------+
50+
| Configuration mode | Parameters |
51+
| +--------------------+
52+
| | TWOLANES | ADC_RES |
53+
+=======================+==========+=========+
54+
| cfg_1lane_16b | 0 | 16 |
55+
+-----------------------+----------+---------+
56+
| cfg_1lane_18b | 0 | 18 |
57+
+-----------------------+----------+---------+
58+
| cfg_2lanes_16b | 1 | 16 |
59+
+-----------------------+----------+---------+
60+
| cfg_2lanes_18b | 1 | 18 |
61+
+-----------------------+----------+---------+
62+
63+
Tests
64+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
66+
The following test program files are available:
67+
68+
============ =====================================
69+
Test program Usage
70+
============ =====================================
71+
test_program Tests the cn0577 design capabilities.
72+
============ =====================================
73+
74+
Available configurations & tests combinations
75+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
The above test program is compatible with all the configurations.
78+
79+
CPU/Memory interconnect addresses
80+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81+
82+
Below are the CPU/Memory interconnect addresses used in this project:
83+
84+
======================== ===========
85+
Instance Address
86+
======================== ===========
87+
axi_intc 0x4120_0000
88+
axi_ltc2387 0x44A0_0000
89+
axi_ltc2387_dma 0x44A3_0000
90+
axi_pwm_gen 0x44A6_0000
91+
ddr_axi_vip 0x8000_0000
92+
======================== ===========
93+
94+
Interrupts
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
Below are the Programmable Logic interrupts used in this project:
98+
99+
=============== ===
100+
Instance name HDL
101+
=============== ===
102+
axi_ltc2387_dma 13
103+
=============== ===
104+
105+
Test stimulus
106+
-------------------------------------------------------------------------------
107+
108+
Parallel test program
109+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110+
111+
The test program is structured into several tests as follows:
112+
113+
Environment bringup
114+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115+
116+
The steps of the environment bringup are:
117+
118+
* Create the environment
119+
* Start the environment
120+
* Start the clocks
121+
* Assert the resets
122+
123+
Sanity tests
124+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125+
126+
This set of sanity tests for the common ADC API, axi_dmac and axi_pwm_gen
127+
IPs verifies the *version* and *scratch* registers.
128+
129+
Data acquisition test
130+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
131+
132+
* Enable all ADC channels
133+
* Configure the PWM generator (axi_pwmgen)
134+
* Configure the DMA
135+
* Configure the axi_ltc2387 IP
136+
* Submit a DMA transfer
137+
* Stop the PWM generator
138+
* Configure axi_ltc2387 IP
139+
* ADC common core out of reset
140+
* Set static data setup in device's reg 0x21
141+
* Read last config result
142+
* Send WR request
143+
* Read last config result
144+
* Set default control value (no RD/WR request)
145+
* Read last config result
146+
* Set exit from register mode sequence
147+
* Send WR request
148+
* Set default control value (no RD/WR request)
149+
* Set HDL config mode - default
150+
* Capture and compare the data
151+
152+
Stop the environment
153+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154+
155+
* Stop the clocks
156+
157+
Building the testbench
158+
-------------------------------------------------------------------------------
159+
160+
The testbench is built upon ADI's generic HDL reference design framework.
161+
ADI does not distribute compiled files of these projects so they must be built
162+
from the sources available :git-hdl:`here </>` and :git-testbenches:`here </>`,
163+
with the specified hierarchy described :ref:`build_tb set_up_tb_repo`.
164+
To get the source you must
165+
`clone <https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository>`__
166+
the HDL repository, and then build the project as follows:.
167+
168+
**Linux/Cygwin/WSL**
169+
170+
*Example 1*
171+
172+
Build all the possible combinations of tests and configurations, using only the
173+
command line.
174+
175+
.. shell::
176+
:showuser:
177+
178+
$cd testbenches/project/cn0577
179+
$make
180+
181+
*Example 2*
182+
183+
Build all the possible combinations of tests and configurations, using the
184+
Vivado GUI. This command will launch Vivado, will run the simulation and display
185+
the waveforms.
186+
187+
.. shell::
188+
:showuser:
189+
190+
$cd testbenches/project/cn0577
191+
$make MODE=gui
192+
193+
*Example 3*
194+
195+
Build a particular combination of test and configuration, using the Vivado GUI.
196+
This command will launch Vivado, will run the simulation and display the
197+
waveforms.
198+
199+
.. shell::
200+
:showuser:
201+
202+
$cd testbenches/project/cn0577
203+
$make MODE=gui CFG=cfg_2lanes_18b TST=test_program
204+
205+
The built projects can be found in the ``runs`` folder, where each configuration
206+
specific build has it's own folder named after the configuration file's name.
207+
Example: if the following command was run for a single configuration in the
208+
clean folder (no runs folder available):
209+
210+
``make CFG=cfg_2lanes_18b``
211+
212+
Then the subfolder under ``runs`` name will be:
213+
214+
``cfg_2lanes_18b``
215+
216+
Resources
217+
-------------------------------------------------------------------------------
218+
219+
HDL related dependencies forming the DUT
220+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221+
222+
.. list-table::
223+
:widths: 30 45 25
224+
:header-rows: 1
225+
226+
* - IP name
227+
- Source code link
228+
- Documentation link
229+
* - AXI_LTC2387
230+
- :git-hdl:`library/axi_ltc2387`
231+
- :external+hdl:ref:`axi_ltc2387`
232+
* - AXI_DMAC
233+
- :git-hdl:`library/axi_dmac`
234+
- :external+hdl:ref:`axi_dmac`
235+
* - AXI_PWM_GEN
236+
- :git-hdl:`library/axi_pwm_gen`
237+
- :external+hdl:ref:`axi_pwm_gen`
238+
239+
240+
Testbenches related dependencies
241+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
242+
243+
.. include:: ../../common/dependency_common.rst
244+
245+
Testbench specific dependencies:
246+
247+
.. list-table::
248+
:widths: 30 45 25
249+
:header-rows: 1
250+
251+
* - SV dependency name
252+
- Source code link
253+
- Documentation link
254+
* - ADC_API_PKG
255+
- :git-testbenches:`library/drivers/adc_api_pkg.sv`
256+
- ---
257+
* - AXI_VIP_PKG
258+
- ---
259+
- :ref:`xilinx_axi_vip`
260+
* - AXI4STREAM_VIP_PKG
261+
- ---
262+
- :xilinx:`AXI Stream Verification IP (VIP) <products/intellectual-property/axi-stream-vip.html>`
263+
* - COMMON_API_PKG
264+
- :git-testbenches:`library/drivers/common_api_pkg.sv`
265+
- ---
266+
* - DMA_TRANS
267+
- :git-testbenches:`library/drivers/dmac/dma_trans.sv`
268+
- ---
269+
* - DMAC_API
270+
- :git-testbenches:`library/drivers/dmac/dmac_api.sv`
271+
- :ref:`dmac`
272+
* - LOGGER_PKG
273+
- :git-testbenches:`library/utilities/logger_pkg.sv`
274+
- ---
275+
* - M_AXIS_SEQUENCER
276+
- :git-testbenches:`library/vip/amd/m_axis_sequencer.sv`
277+
- ---
278+
* - PWM_GEN_API_PKG
279+
- :git-testbenches:`library/drivers/pwm_gen_api_pkg.sv`
280+
- ---
281+
* - S_AXIS_SEQUENCER
282+
- :git-testbenches:`library/vip/amd/s_axis_sequencer.sv`
283+
- ---
284+
* - TEST_HARNESS_ENV_PKG
285+
- :git-testbenches:`library/utilities/test_harness_eng_pkg.sv`
286+
- :ref:`test_harness`
287+
288+
.. include:: ../../../common/more_information.rst
289+
290+
.. include:: ../../../common/support.rst

0 commit comments

Comments
 (0)