Skip to content

Commit a385aad

Browse files
mkurc-anttmichalak
authored andcommitted
Add testplans for I3C core
Signed-off-by: Maciej Kurc <[email protected]>
1 parent e41c27e commit a385aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2456
-53
lines changed

.github/workflows/build-docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ jobs:
2222
- name: Setup repository
2323
uses: actions/checkout@v4
2424

25+
- name: Generate VP
26+
run: |
27+
export I3C_ROOT_DIR="`pwd`"
28+
pip3 install git+https://github.com/antmicro/testplanner.git
29+
REPO_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/tree/$GITHUB_REF_NAME/" make verification-docs
30+
2531
- name: Build Docs
2632
run: |
2733
pushd doc

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ BLOCK_VERIF_DIR := $(COCOTB_VERIF_DIR)/block
1515
TOP_VERIF_DIR := $(COCOTB_VERIF_DIR)/top
1616
TOOL_VERIF_DIR := $(VERIFICATION_DIR)/tools/
1717
UVM_VERIF_DIR := $(VERIFICATION_DIR)/uvm_i3c/
18+
TESTPLAN_DIR := $(VERIFICATION_DIR)/testplan
1819

1920
TOOL_DIR := $(I3C_ROOT_DIR)/tools/
2021
UVM_TOOL_DIR := $(TOOL_DIR)/uvm/
@@ -25,6 +26,7 @@ CALIPTRA_ROOT ?= $(THIRD_PARTY_DIR)/caliptra-rtl## Path: caliptra-rtl repo
2526
# TODO: Connect to version selection in tools/simulators/
2627
UVM_DIR ?= $(VERILATOR_UVM_DIR)/## Select UVM version
2728
SIMULATOR ?= verilator## Supported: verilator, dsim, questa, vcs
29+
REPO_URL ?= https://github.com/chipsalliance/i3c-core/tree/main/
2830

2931
NUM_PROC := $$(($$(nproc)-1))
3032
# Environment variables
@@ -132,6 +134,12 @@ tests-uvm-debug: config ## Run debugging I3C Core UVM tests with nox
132134
tests-tool: ## Run all tool tests
133135
cd $(TOOL_VERIF_DIR) && $(PYTHON) -m nox -k "verify" --no-venv
134136

137+
BLOCKS_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -name "*.hjson" ! -name "target*.hjson" -printf "%P\n")
138+
CORE_VERIFICATION_PLANS = $(shell find $(TESTPLAN_DIR) -type f -name "*target*.hjson" -printf "%P\n")
139+
verification-docs:
140+
cd $(TESTPLAN_DIR) && testplanner $(BLOCKS_VERIFICATION_PLANS) -ot $(TESTPLAN_DIR)/generated/testplans_blocks.md --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
141+
cd $(TESTPLAN_DIR) && testplanner $(CORE_VERIFICATION_PLANS) -ot $(TESTPLAN_DIR)/generated/testplans_core.md --project-root $(I3C_ROOT_DIR) --testplan-file-map $(TESTPLAN_DIR)/source-maps.yml --source-url-prefix $(REPO_URL)
142+
135143
#
136144
# Utilities
137145
#

doc/source/dv.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ Definitions:
2121
### Testplans for individual blocks
2222

2323
```{include} ../../verification/testplan/generated/testplans_blocks.md
24+
:heading-offset: 2
2425
```
2526

2627
### Testplans for the core
2728

2829
```{include} ../../verification/testplan/generated/testplans_core.md
30+
:heading-offset: 2
2931
```

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cocotb-coverage==1.2.0
1111
cocotb-test==0.2.5
1212
cocotbext-axi==0.1.24
1313
-e git+https://github.com/alexforencich/cocotbext-i2c@3b32eedc15302f1299a23bb35aa669fffad2ca22#egg=cocotbext_i2c
14+
git+https://github.com/antmicro/testplanner.git@bbf374a
1415
-e ${I3C_ROOT_DIR}/third_party/cocotbext-i3c
1516
-e ${I3C_ROOT_DIR}/tools/nox_utils
1617
-e ${I3C_ROOT_DIR}/tools/cocotb_helpers

verification/cocotb/block/i2c/test_write.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def test_write_sequence(
6161

6262

6363
@cocotb.test()
64-
async def run_test(dut):
64+
async def test_write(dut):
6565
TARGET_ADDR = 0x18
6666
CLK_SPEED = 400e3
6767

verification/cocotb/block/i2c_controller_fsm/test_mem_rw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@cocotb.test()
20-
async def run_test(dut):
20+
async def test_mem_rw(dut):
2121
"""
2222
Executes random read and writes while checking data on the I2C FSM.
2323
"""

verification/cocotb/block/i2c_standby_controller/test_read.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def ord_or_null(idx):
102102

103103

104104
@cocotb.test()
105-
async def run_test(dut):
105+
async def test_read(dut):
106106
TARGET_ADDR = 0x18
107107
CLK_SPEED = 400e3
108108

verification/cocotb/block/i2c_standby_controller/test_wr_restart_rd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def master_write_read():
159159

160160

161161
@cocotb.test()
162-
async def run_test(dut):
162+
async def test_wr_restart_rd(dut):
163163
TARGET_ADDR = 12
164164
CLK_SPEED = 400000
165165

verification/cocotb/block/i2c_target_fsm/test_mem_r.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def test_read_sequence(dut: Any, address: int, master: I2cMaster, data: by
7575

7676

7777
@cocotb.test()
78-
async def run_test(dut):
78+
async def test_mem_r(dut):
7979
TARGET_ADDR = 12
8080
CLK_SPEED = 400000
8181

verification/cocotb/block/i2c_target_fsm/test_mem_w.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def MatchWDataExact(value, dut):
4848

4949

5050
@cocotb.test()
51-
async def run_test(dut):
51+
async def test_mem_w(dut):
5252
TARGET_ADDR = 12
5353
CLK_SPEED = 400000
5454

0 commit comments

Comments
 (0)