From bccc0f48c346e5b77b133a84b805d59385bb9f13 Mon Sep 17 00:00:00 2001 From: KafCoppelia Date: Fri, 7 Apr 2023 12:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E6=A0=B8=E8=8C=83=E5=9B=B4=E9=99=90=E5=88=B6?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- paitest/cores/cores_utils.py | 3 ++- paitest/paitest.py | 3 +++ pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4a34c20..f1277af 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## 📦 版本 -[v0.0.8 Prerelease](https://github.com/PAICookers/PAITest/releases/tag/v0.0.8) +[v0.0.9 Prerelease](https://github.com/PAICookers/PAITest/releases/tag/v0.0.9) ## 🛠️ 使用 diff --git a/paitest/cores/cores_utils.py b/paitest/cores/cores_utils.py index 32eea91..13aa45c 100644 --- a/paitest/cores/cores_utils.py +++ b/paitest/cores/cores_utils.py @@ -10,7 +10,7 @@ def CoordGenerator(): while True: x = random.randint(0, 31) y = random.randint(0, 31) - if (x, y) not in coordinates and (x <= 0b11100 or y <= 0b11100): + if (x, y) not in coordinates and (x < 0b11100 or y < 0b11100): coordinates.add((x, y)) yield (x, y) @@ -30,6 +30,7 @@ def GenCoreAddr( core_addr_list: List[Tuple[int, int]] = [] if isinstance(fixed_core_addr, Tuple): + assert fixed_core_addr[0] < 32 and fixed_core_addr[1] < 32 assert not (fixed_core_addr[0] >= 0b11100 and fixed_core_addr[1] >= 0b11100) diff --git a/paitest/paitest.py b/paitest/paitest.py index d83d4f0..bdce600 100644 --- a/paitest/paitest.py +++ b/paitest/paitest.py @@ -43,6 +43,9 @@ def GenTestCases( test_chip_dirc: TestChipDirection = TestChipDirection[direction.upper()] '''Generate 'groups' random core address first''' + if groups > 1008: + raise ValueError(f"Value of groups is no more than 1008") + core_addr_list = GenCoreAddr(groups, fixed_core_addr) with open(frames_dir / "config.bin", "wb") as fc, \ diff --git a/pyproject.toml b/pyproject.toml index 273e992..ff335b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "PAITest" -version = "0.0.8" +version = "0.0.9" description = "Test module for PAICORE 2.0" authors = ["KafCoppelia "] license = "AGPL v3.0"