Skip to content

Commit f235838

Browse files
committed
[usbdev,dv,doc] Expand usbdev DV document to reflect current state
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
1 parent 6e12735 commit f235838

File tree

1 file changed

+28
-41
lines changed

1 file changed

+28
-41
lines changed

hw/ip/usbdev/dv/README.md

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -18,71 +18,58 @@
1818
For detailed information on USBDEV design features, please see the [USBDEV HWIP technical specification](../README.md).
1919

2020
## Testbench architecture
21-
USBDEV testbench has been constructed based on the [CIP testbench architecture](../../../dv/sv/cip_lib/README.md).
21+
The USBDEV testbench is based on the [CIP testbench architecture](../../../dv/sv/cip_lib/README.md).
2222

2323
### Top level testbench
24-
Top level testbench is located at `hw/ip/usbdev/dv/tb/tb.sv`.
24+
The top-level testbench is located at `hw/ip/usbdev/dv/tb/tb.sv`.
2525
It instantiates the USBDEV DUT module `hw/ip/usbdev/rtl/usbdev.sv`.
26-
In addition, it instantiates the following interfaces, connects them to the DUT and sets their handle into `uvm_config_db`:
27-
* [Clock and reset interface for the TL and USB domains](../../../dv/sv/common_ifs/README.md)
28-
* [TileLink host interface](../../../dv/sv/tl_agent/README.md)
29-
* USBDEV IOs
30-
* Interrupts ([`pins_if`](../../../dv/sv/common_ifs/README.md)
31-
32-
### Common DV utility components
33-
The following utilities provide generic helper tasks and functions to perform activities that are common across the project:
34-
* [dv_utils_pkg](../../../dv/sv/dv_utils/README.md)
35-
* [csr_utils_pkg](../../../dv/sv/csr_utils/README.md)
36-
37-
### Compile-time configurations
38-
None for now.
39-
40-
### Global types & methods
41-
All common types and methods defined at the package level can be found in `usbdev_env_pkg`.
42-
Some of them in use are:
43-
```systemverilog
44-
[list a few parameters, types & methods; no need to mention all]
45-
```
4626

47-
### TL_agent
48-
USBDEV testbench instantiates (already handled in CIP base env) [tl_agent](../../../dv/sv/tl_agent/README.md) which provides the ability to drive and independently monitor random traffic via TL host interface into USBDEV device.
27+
USBDEV has the following interfaces, which the testbench instantiates and connects and registers with `uvm_config_db`:
28+
- [Clock and reset interfaces](../../../dv/sv/common_ifs/README.md) for the USB and AON clock domains.
29+
- A [TileLink interface](../../../dv/sv/tl_agent/README.md).
30+
USBDEV is a TL-UL device, which expects to communicate with a TL-UL host.
31+
In the OpenTitan SoC, this will be the Ibex core.
32+
- A `usb20_block_if` representing the actual USB interface.
33+
This is using a class that has been developed in parallel with `usb20_if`.
34+
Eventually, they will hopefully be merged again.
35+
- An [alert interface](../../../dv/sv/alert_esc_agent/README.md)
36+
- Interrupts, modelled with the basic [`pins_if`](../../../dv/sv/common_ifs/README.md) interface.
4937

50-
### USB20 Agent
51-
The [usb20_agent](../../../dv/sv/usb20_agent/README.md) is currently a skeleton implementation.
52-
It does not offer any functionality yet.
38+
### Agents
39+
USBDEV has dedicated agents for two interfaces.
5340

54-
### UVM RAL Model
55-
The USBDEV RAL model is created with the [`ralgen`](../../../dv/tools/ralgen/README.md) FuseSoC generator script automatically when the simulation is at the build stage.
41+
- The dedicated [usb20_agent](../../../dv/sv/usb20_agent/README.md), which has its own documentation.
42+
This handles the USB interface itself.
5643

57-
It can be created manually by invoking [`regtool`](../../../../util/reggen/doc/setup_and_use.md):
44+
- The generic [tl_agent](../../../dv/sv/tl_agent/README.md) inherited from CIP base environment.
45+
This handles TileLink traffic (accessing both CSRs and packet buffers)
5846

5947
### Reference models
60-
There are no reference models in use currently.
48+
The only reference model for USBDEV is a RAL model for CSR reads and writes.
49+
For this, there is a dedicated RAL model, which is created by [`ralgen`](../../../dv/tools/ralgen/README.md) as part of the build flow.
6150

6251
### Stimulus strategy
6352
#### Test sequences
6453
All test sequences reside in `hw/ip/usbdev/dv/env/seq_lib`.
6554
The `usbdev_base_vseq` virtual sequence is extended from `cip_base_vseq` and serves as a starting point.
6655
All test sequences are extended from `usbdev_base_vseq`.
67-
It provides commonly used handles, variables, functions and tasks that the test sequences can simple use / call.
68-
Some of the most commonly used tasks / functions are as follows:
69-
* `usbdev_init()`: Do basic USB device initialization.
56+
It provides commonly used handles, variables, functions and tasks that the test sequences can simply use / call.
57+
58+
USBDEV virtual sequences normally also run a `usbdev_init` task at the start of the simulation.
59+
This does basic USB device initialization and is only disabled for `usbdev_common_vseq` (which tests CSR behaviour and doesn't need to enable USB itself).
7060

7161
#### Functional coverage
72-
To ensure high quality constrained random stimulus, it is necessary to develop a functional coverage model.
73-
The following covergroups have been developed to prove that the test intent has been adequately met:
74-
* TBD
62+
63+
Covergroups for functional coverage (as collected by `usbdev_env_cov`) are listed in the testplan at `hw/ip/usbdev/data/usbdev_testplan.hjson`.
7564

7665
### Self-checking strategy
7766
#### Scoreboard
78-
The `usbdev_scoreboard` is primarily used for end to end checking.
79-
It creates the following analysis ports to retrieve the data monitored by corresponding interface agents:
80-
* TBD
67+
The `usbdev_scoreboard` is currently in skeleton form and doesn't really contain any checks.
68+
TODO: Extend the scoreboard far enough that there's something to document, then document it here.
8169

8270
#### Assertions
8371
* TLUL assertions: The `tb/usbdev_bind.sv` binds the `tlul_assert` [assertions](../../tlul/doc/TlulProtocolChecker.md) to the IP to ensure TileLink interface protocol compliance.
8472
* Unknown checks on DUT outputs: The RTL has assertions to ensure all outputs are initialized to known values after coming out of reset.
85-
* TBD
8673

8774
## Building and running tests
8875
We are using our in-house developed [regression tool](../../../../util/dvsim/README.md) for building and running our tests and regressions.

0 commit comments

Comments
 (0)