Skip to content

Commit

Permalink
Fix tests after API changes
Browse files Browse the repository at this point in the history
Internal-tag: [#52180]
Signed-off-by: Rafal Kolucki <[email protected]>
  • Loading branch information
koluckirafal committed Apr 16, 2024
1 parent b025241 commit da58563
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/data/data_build/design.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

ips:
dma:
file: tests/data/data_build/DMATop.yaml
file: DMATop.yaml
module: DMATop
disp:
file: tests/data/data_build/axi_dispctrl_v1_0.yaml
file: axi_dispctrl_v1_0.yaml
module: axi_dispctrl_v1_0

design:
Expand Down
4 changes: 2 additions & 2 deletions tests/data/data_build/hierarchy/design.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

ips:
pwm:
file: tests/data/data_build/hierarchy/pwm.yml
file: pwm.yml
module: pwm
counter:
file: tests/data/data_build/hierarchy/counter.yml
file: counter.yml
module: cnt

# This design contains `pwm` module connected with `counter_hier`
Expand Down
11 changes: 9 additions & 2 deletions tests/tests_build/test_hier_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ def hier_design_yaml() -> Path:
return Path("tests/data/data_build/hierarchy/design.yml")


@pytest.fixture
def hier_design_path(hier_design_yaml) -> Path:
return Path(hier_design_yaml).resolve().parent


@pytest.fixture
def hier_design(hier_design_yaml) -> dict:
with open(hier_design_yaml, "r") as f:
Expand Down Expand Up @@ -53,8 +58,10 @@ def counter_hier_conns() -> list:


@pytest.fixture
def hier_design_ipconnect(hier_design) -> IPConnect:
return generate_design(hier_design["ips"], hier_design["design"], hier_design["external"])
def hier_design_ipconnect(hier_design, hier_design_path) -> IPConnect:
return generate_design(
hier_design["ips"], hier_design["design"], hier_design["external"], hier_design_path
)


class TestHierarchyDesign:
Expand Down
22 changes: 16 additions & 6 deletions tests/tests_build/test_ip_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,35 @@ def axi_dispctrl_name() -> str:

@pytest.fixture
def dmatop_yaml() -> Path:
return Path("tests/data/data_build/DMATop.yaml")
return Path("DMATop.yaml")


@pytest.fixture
def axi_dispctrl_yaml() -> Path:
return Path("tests/data/data_build/axi_dispctrl_v1_0.yaml")
return Path("axi_dispctrl_v1_0.yaml")


@pytest.fixture
def dmatop_path(dmatop_yaml) -> Path:
return Path("tests/data/data_build").resolve()


@pytest.fixture
def axi_dispctrl_path(axi_dispctrl_yaml) -> Path:
return Path("tests/data/data_build").resolve()


# -------------------------------------
# IPWrapper and hierarchy IPConnect structures
# -------------------------------------
@pytest.fixture
def dmatop_ipw(dmatop_yaml, dmatop_name) -> IPWrapper:
return IPWrapper(dmatop_yaml, dmatop_name, dmatop_name)
def dmatop_ipw(dmatop_yaml, dmatop_path, dmatop_name) -> IPWrapper:
return IPWrapper(dmatop_yaml, dmatop_path, dmatop_name, dmatop_name)


@pytest.fixture
def axi_dispctrl_ipw(axi_dispctrl_yaml, axi_dispctrl_name) -> IPWrapper:
return IPWrapper(axi_dispctrl_yaml, axi_dispctrl_name, axi_dispctrl_name)
def axi_dispctrl_ipw(axi_dispctrl_yaml, axi_dispctrl_path, axi_dispctrl_name) -> IPWrapper:
return IPWrapper(axi_dispctrl_yaml, axi_dispctrl_path, axi_dispctrl_name, axi_dispctrl_name)


# -------------------------------------
Expand Down
16 changes: 12 additions & 4 deletions tests/tests_build/test_ip_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,29 @@ def axi_dispctrl_name() -> str:

@pytest.fixture
def axi_dispctrl_yaml() -> Path:
return Path("tests/data/data_build/axi_dispctrl_v1_0.yaml")
return Path("axi_dispctrl_v1_0.yaml")


@pytest.fixture
def axi_dispctrl_path(axi_dispctrl_yaml) -> Path:
return Path("tests/data/data_build")


# -----------------
# IPWrapper objects
# -----------------
@pytest.fixture
def axi_dispctrl_ipw(axi_dispctrl_name, axi_dispctrl_yaml) -> IPWrapper:
return IPWrapper(axi_dispctrl_yaml, axi_dispctrl_name, axi_dispctrl_name, {})
def axi_dispctrl_ipw(axi_dispctrl_name, axi_dispctrl_path, axi_dispctrl_yaml) -> IPWrapper:
return IPWrapper(axi_dispctrl_yaml, axi_dispctrl_path, axi_dispctrl_name, axi_dispctrl_name, {})


@pytest.fixture
def axi_dispctrl_ipw_overriden(axi_dispctrl_name, axi_dispctrl_yaml) -> IPWrapper:
def axi_dispctrl_ipw_overriden(
axi_dispctrl_name, axi_dispctrl_path, axi_dispctrl_yaml
) -> IPWrapper:
return IPWrapper(
axi_dispctrl_yaml,
axi_dispctrl_path,
axi_dispctrl_name,
axi_dispctrl_name,
{"C_S_AXIS_TDATA_WIDTH": 64, "C_S00_AXI_DATA_WIDTH": 64},
Expand Down

0 comments on commit da58563

Please sign in to comment.