Skip to content

Commit

Permalink
[TVMC] Workspace Pools Parameters
Browse files Browse the repository at this point in the history
Add test for parameter overrides.

Change-Id: I67d5470dcfbfbc9ab27f34e20a9269d2070193ca
  • Loading branch information
dchauhan-arm committed Jun 22, 2022
1 parent 5b367a6 commit 31cc299
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/python/driver/tvmc/test_workspace_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,3 +328,30 @@ def test_workspace_pools_recombobulate_multi_target_multi_pool():
assert len(memory_pools.pools[0].target_burst_bytes) == 2
assert memory_pools.pools[0].target_burst_bytes[c_target] == 8
assert memory_pools.pools[0].target_burst_bytes[llvm_target] == 4


def test_workspace_pools_recombobulate_parameter_overrides():
parser = argparse.ArgumentParser()
generate_workspace_pools_args(parser)
parsed, _ = parser.parse_known_args(
[
"--workspace-pools=sram",
"--workspace-pools-target-access=sram:c:rw",
"--workspace-pools-size-hint-bytes=sram:800",
"--workspace-pools-size-hint-bytes=sram:400",
"--workspace-pools-clock-frequency-hz=sram:4000000",
"--workspace-pools-clock-frequency-hz=sram:3600000",
]
)

c_target = Target("c")

targets = [c_target]
memory_pools = workspace_pools_recombobulate(parsed, targets)

assert len(memory_pools.pools) == 1

assert len(memory_pools.pools[0].target_access) == 1
assert memory_pools.pools[0].target_access[c_target] == PoolInfo.READ_WRITE_ACCESS
assert memory_pools.pools[0].size_hint_bytes == 400
assert memory_pools.pools[0].clock_frequency_hz == 3600000

0 comments on commit 31cc299

Please sign in to comment.