Dev/downsize apb paddr (#27)
* Downsize paddr bits * Updated Test suite to use offset aligned address * fix for apb3 and axi4lite * modified structure to pass hierarchy information --------- Co-authored-by: Byron Lathi <bslathi19@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from typing import Any, Iterable
|
||||
|
||||
@@ -71,6 +72,8 @@ def _build_master_table(dut, masters_cfg: list[dict[str, Any]]) -> dict[str, dic
|
||||
"PREADY": SignalHandle(dut, f"{port_prefix}_PREADY"),
|
||||
"PSLVERR": SignalHandle(dut, f"{port_prefix}_PSLVERR"),
|
||||
},
|
||||
"inst_size": master["inst_size"],
|
||||
"inst_address": master["inst_address"],
|
||||
}
|
||||
table[master["inst_name"]] = entry
|
||||
return table
|
||||
@@ -138,11 +141,16 @@ async def test_apb4_address_decoding(dut) -> None:
|
||||
slave.PSEL.value = 1
|
||||
slave.PENABLE.value = 1
|
||||
|
||||
dut._log.info(
|
||||
f"Starting transaction {txn['label']} to {master_name}{index} at address 0x{address:08X}"
|
||||
)
|
||||
master_address = (address - entry["inst_address"]) % entry["inst_size"]
|
||||
|
||||
await Timer(1, units="ns")
|
||||
|
||||
assert _get_int(entry["outputs"]["PSEL"], index) == 1, f"{master_name} should assert PSEL for write"
|
||||
assert _get_int(entry["outputs"]["PWRITE"], index) == 1, f"{master_name} should see write intent"
|
||||
assert _get_int(entry["outputs"]["PADDR"], index) == address, (
|
||||
assert _get_int(entry["outputs"]["PADDR"], index) == master_address, (
|
||||
f"{master_name} must receive write address"
|
||||
)
|
||||
assert _get_int(entry["outputs"]["PWDATA"], index) == write_data, (
|
||||
@@ -189,7 +197,7 @@ async def test_apb4_address_decoding(dut) -> None:
|
||||
assert _get_int(entry["outputs"]["PWRITE"], index) == 0, (
|
||||
f"{master_name} should deassert write for reads"
|
||||
)
|
||||
assert _get_int(entry["outputs"]["PADDR"], index) == address, (
|
||||
assert _get_int(entry["outputs"]["PADDR"], index) == master_address, (
|
||||
f"{master_name} must receive read address"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import logging
|
||||
|
||||
@@ -28,6 +29,9 @@ def test_apb4_smoke(tmp_path: Path, rdl_file: str, top_name: str) -> None:
|
||||
rdl_path = repo_root / "tests" / "cocotb_lib" / "rdl" / rdl_file
|
||||
build_root = tmp_path / top_name
|
||||
|
||||
logging.info(f"Running APB4 smoke test for {rdl_path} with top {top_name}")
|
||||
logging.info(f"Build root: {build_root}")
|
||||
|
||||
module_path, package_path, config = prepare_cpuif_case(
|
||||
str(rdl_path),
|
||||
top_name,
|
||||
@@ -83,4 +87,4 @@ def test_apb4_smoke(tmp_path: Path, rdl_file: str, top_name: str) -> None:
|
||||
=== End Simulation Log ===
|
||||
""")
|
||||
if e.code != 0:
|
||||
raise
|
||||
raise e
|
||||
|
||||
Reference in New Issue
Block a user