<div align="center">
# PAITest
</div>
## 📦 版本
[v1.1.0](https://github.com/PAICookers/PAITest/releases/tag/v1.1.0)
✨支持大/小端格式输出
## 🛠️ 使用生成
配置帧及对应测试输入帧,以实现硬件通路的简单测试,后续将芯片实际测试输出帧与预期结果进行对比即可。
⚠️ 由于配置帧/测试帧I型需要配合串口配置使用,因此目前仅采用**配置/测试帧II型**方案,且 `CHIP_ADDR` 与 `CORE*_ADDR` 均固定为 `(0, 0)`。
1. 实例化 `PAITest`
```python
from paitest import paitest
# Define the direction of test chip
PAITestManager = paitest("EAST")
```
2. `Get1GroupForNCoresWithNParams`,产生一组针对 `N` 个核的配置-测试帧,每个核配置**不同参数**。可以指定单个需要**屏蔽**的核坐标
```python
groups = 10 # Generate 10 groups
save_to_dir="./test" # Save frames into ./test directory
# Generate configuration frames, testin & testout frames
cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups, save_dir=save_to_dir, verbose=True)
# Mask a cord coordinate so that avoid generating the same coordinate.
cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups,
save_dir=save_to_dir, masked_core_coord=(12, 16), gen_txt=True)
```
⚠️ 指定 `verbose=True` 以开启日志显示,默认关闭
3. `Get1GroupForNCoresWith1Param`,产生1组针对 `N` 个核的配置-测试帧,每个核配置**相同参数**。可以指定单个需要**屏蔽**的核坐标
```python
# Same as Get1GroupForNCoresWithNParams
cf, ti, to = PAITestManager.Get1GroupForNCoresWith1Param(10, save_dir="./test")
```
4. `GetNGroupsFor1CoreWithNParams`,产生 `N` 组针对1个核的配置-测试帧,每个核配置**不同参数**。可以指定单个需要**屏蔽**的核坐标
```python
# Same as Get1GroupForNCoresWithNParams
cf, ti, to = PAITestManager.GetNGroupsFor1CoreWithNParams(1, save_dir="./test")
```
5. `ReplaceCoreCoord`,替换**单个**或**一组**帧中的 `CORE_ADDR` 为指定坐标
```python
# Replaced core coordinate with (9, 9)
replaced = PAITestManager.ReplaceCoreCoord(original_frames, (9, 9))
```
⚠️ 一组指一组完整的配置帧,包含3帧。对于测试输入帧,即为单帧。
6. `SaveFrames`,保存帧数据至指定文件,支持 `.bin` 或 `.txt` 格式,支持指定大/小端输出
```python
# Save into binary files with big-edian format(default)
PAITestManager.SaveFrames("./test/config.bin", replaced, byteorder="big")
# Or text files
PAITestManager.SaveFrames("./test/config.txt", replaced)
```
⚠️ 指定 `byteorder="big"/"little"` 以大/小端格式储存帧数据,默认大端
## 🗓️ TODO
- [x] 上板验证
- [ ] 参数检验
- [ ] 配置/测试帧III/IV型
Raw data
{
"_id": null,
"home_page": "https://github.com/PAICookers/PAITest",
"name": "paitest",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6,<4.0",
"maintainer_email": "",
"keywords": "PAICookers,PAITest,PAICORE",
"author": "KafCoppelia",
"author_email": "k740677208@gmail.com",
"download_url": "",
"platform": null,
"description": "<div align=\"center\">\n\n# PAITest\n\n</div>\n\n## \ud83d\udce6 \u7248\u672c\n\n[v1.1.0](https://github.com/PAICookers/PAITest/releases/tag/v1.1.0)\n\n\u2728\u652f\u6301\u5927/\u5c0f\u7aef\u683c\u5f0f\u8f93\u51fa\n\n## \ud83d\udee0\ufe0f \u4f7f\u7528\u751f\u6210\n\n\u914d\u7f6e\u5e27\u53ca\u5bf9\u5e94\u6d4b\u8bd5\u8f93\u5165\u5e27\uff0c\u4ee5\u5b9e\u73b0\u786c\u4ef6\u901a\u8def\u7684\u7b80\u5355\u6d4b\u8bd5\uff0c\u540e\u7eed\u5c06\u82af\u7247\u5b9e\u9645\u6d4b\u8bd5\u8f93\u51fa\u5e27\u4e0e\u9884\u671f\u7ed3\u679c\u8fdb\u884c\u5bf9\u6bd4\u5373\u53ef\u3002\n\n\u26a0\ufe0f \u7531\u4e8e\u914d\u7f6e\u5e27/\u6d4b\u8bd5\u5e27I\u578b\u9700\u8981\u914d\u5408\u4e32\u53e3\u914d\u7f6e\u4f7f\u7528\uff0c\u56e0\u6b64\u76ee\u524d\u4ec5\u91c7\u7528**\u914d\u7f6e/\u6d4b\u8bd5\u5e27II\u578b**\u65b9\u6848\uff0c\u4e14 `CHIP_ADDR` \u4e0e `CORE*_ADDR` \u5747\u56fa\u5b9a\u4e3a `(0, 0)`\u3002\n\n1. \u5b9e\u4f8b\u5316 `PAITest`\n\n ```python\n from paitest import paitest\n\n # Define the direction of test chip\n PAITestManager = paitest(\"EAST\")\n ```\n\n2. `Get1GroupForNCoresWithNParams`\uff0c\u4ea7\u751f\u4e00\u7ec4\u9488\u5bf9 `N` \u4e2a\u6838\u7684\u914d\u7f6e-\u6d4b\u8bd5\u5e27\uff0c\u6bcf\u4e2a\u6838\u914d\u7f6e**\u4e0d\u540c\u53c2\u6570**\u3002\u53ef\u4ee5\u6307\u5b9a\u5355\u4e2a\u9700\u8981**\u5c4f\u853d**\u7684\u6838\u5750\u6807\n\n ```python\n groups = 10 # Generate 10 groups\n save_to_dir=\"./test\" # Save frames into ./test directory\n\n # Generate configuration frames, testin & testout frames\n cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups, save_dir=save_to_dir, verbose=True)\n\n # Mask a cord coordinate so that avoid generating the same coordinate.\n cf, ti, to = PAITestManager.Get1GroupForNCoresWithNParams(groups,\n save_dir=save_to_dir, masked_core_coord=(12, 16), gen_txt=True)\n ```\n\n \u26a0\ufe0f \u6307\u5b9a `verbose=True` \u4ee5\u5f00\u542f\u65e5\u5fd7\u663e\u793a\uff0c\u9ed8\u8ba4\u5173\u95ed\n\n3. `Get1GroupForNCoresWith1Param`\uff0c\u4ea7\u751f1\u7ec4\u9488\u5bf9 `N` \u4e2a\u6838\u7684\u914d\u7f6e-\u6d4b\u8bd5\u5e27\uff0c\u6bcf\u4e2a\u6838\u914d\u7f6e**\u76f8\u540c\u53c2\u6570**\u3002\u53ef\u4ee5\u6307\u5b9a\u5355\u4e2a\u9700\u8981**\u5c4f\u853d**\u7684\u6838\u5750\u6807\n\n ```python\n # Same as Get1GroupForNCoresWithNParams\n cf, ti, to = PAITestManager.Get1GroupForNCoresWith1Param(10, save_dir=\"./test\")\n ```\n\n4. `GetNGroupsFor1CoreWithNParams`\uff0c\u4ea7\u751f `N` \u7ec4\u9488\u5bf91\u4e2a\u6838\u7684\u914d\u7f6e-\u6d4b\u8bd5\u5e27\uff0c\u6bcf\u4e2a\u6838\u914d\u7f6e**\u4e0d\u540c\u53c2\u6570**\u3002\u53ef\u4ee5\u6307\u5b9a\u5355\u4e2a\u9700\u8981**\u5c4f\u853d**\u7684\u6838\u5750\u6807\n\n ```python\n # Same as Get1GroupForNCoresWithNParams\n cf, ti, to = PAITestManager.GetNGroupsFor1CoreWithNParams(1, save_dir=\"./test\")\n ```\n\n5. `ReplaceCoreCoord`\uff0c\u66ff\u6362**\u5355\u4e2a**\u6216**\u4e00\u7ec4**\u5e27\u4e2d\u7684 `CORE_ADDR` \u4e3a\u6307\u5b9a\u5750\u6807\n\n ```python\n # Replaced core coordinate with (9, 9)\n replaced = PAITestManager.ReplaceCoreCoord(original_frames, (9, 9))\n ```\n\n \u26a0\ufe0f \u4e00\u7ec4\u6307\u4e00\u7ec4\u5b8c\u6574\u7684\u914d\u7f6e\u5e27\uff0c\u5305\u542b3\u5e27\u3002\u5bf9\u4e8e\u6d4b\u8bd5\u8f93\u5165\u5e27\uff0c\u5373\u4e3a\u5355\u5e27\u3002\n\n6. `SaveFrames`\uff0c\u4fdd\u5b58\u5e27\u6570\u636e\u81f3\u6307\u5b9a\u6587\u4ef6\uff0c\u652f\u6301 `.bin` \u6216 `.txt` \u683c\u5f0f\uff0c\u652f\u6301\u6307\u5b9a\u5927/\u5c0f\u7aef\u8f93\u51fa\n\n ```python\n # Save into binary files with big-edian format(default)\n PAITestManager.SaveFrames(\"./test/config.bin\", replaced, byteorder=\"big\")\n\n # Or text files\n PAITestManager.SaveFrames(\"./test/config.txt\", replaced)\n ```\n\n \u26a0\ufe0f \u6307\u5b9a `byteorder=\"big\"/\"little\"` \u4ee5\u5927/\u5c0f\u7aef\u683c\u5f0f\u50a8\u5b58\u5e27\u6570\u636e\uff0c\u9ed8\u8ba4\u5927\u7aef\n\n## \ud83d\uddd3\ufe0f TODO\n\n- [x] \u4e0a\u677f\u9a8c\u8bc1\n- [ ] \u53c2\u6570\u68c0\u9a8c\n- [ ] \u914d\u7f6e/\u6d4b\u8bd5\u5e27III/IV\u578b\n",
"bugtrack_url": null,
"license": "AGPL v3.0",
"summary": "Test module for PAICORE 2.0",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://github.com/PAICookers/PAITest#readme",
"Homepage": "https://github.com/PAICookers/PAITest",
"Repository": "https://github.com/PAICookers/PAITest"
},
"split_keywords": [
"paicookers",
"paitest",
"paicore"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "046bec90348821cdde72c61b34578dce289bbf39ce59a25ee85b84d2471340f3",
"md5": "84a8846b993df8ea14a91661087e6722",
"sha256": "15cbd70ebb488ded923935e9af98ea3bcbdd2cefa87ed36e8065230896d5383d"
},
"downloads": -1,
"filename": "paitest-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "84a8846b993df8ea14a91661087e6722",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6,<4.0",
"size": 25069,
"upload_time": "2023-05-18T13:08:18",
"upload_time_iso_8601": "2023-05-18T13:08:18.504233Z",
"url": "https://files.pythonhosted.org/packages/04/6b/ec90348821cdde72c61b34578dce289bbf39ce59a25ee85b84d2471340f3/paitest-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-18 13:08:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PAICookers",
"github_project": "PAITest",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "paitest"
}