cannlog 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cannlog-0.1.7/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CANN Log Parser Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include LICENSE
2
+ include README.md
3
+ recursive-include cann_log_parser/static *.html *.css *.js
4
+ global-exclude __pycache__ *.py[cod]
cannlog-0.1.7/PKG-INFO ADDED
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: cannlog
3
+ Version: 0.1.7
4
+ Summary: cannlog: CANN simulation log parser and web viewer
5
+ Author: CANN Log Parser Contributors
6
+ License-Expression: MIT
7
+ Keywords: cann,simulator,log,viewer,visualization
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Environment :: Console
10
+ Classifier: Environment :: Web Environment
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Debuggers
17
+ Classifier: Topic :: System :: Logging
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
22
+
23
+ # cannlog
24
+
25
+ 用于浏览和解析 `cannsim` 仿真日志的本地 Web 可视化工具。后端给定日志目录启动,前端在浏览器中动态查看日志、访存数据和指令关联关系。
26
+
27
+ ## 安装
28
+
29
+ 从 PyPI 安装:
30
+
31
+ ```bash
32
+ pip install cannlog
33
+ ```
34
+
35
+ 从源码安装:
36
+
37
+ ```bash
38
+ pip install .
39
+ ```
40
+
41
+ 开发模式安装:
42
+
43
+ ```bash
44
+ pip install -e .
45
+ ```
46
+
47
+ 安装后主命令是 `cannlog`:
48
+
49
+ ```bash
50
+ cannlog /path/to/log_dir --host localhost --port 18000
51
+ ```
52
+
53
+ 也保留了兼容别名:`cann-log-parser`、`cann-log-viewer`。
54
+
55
+ 也可以继续使用模块入口:
56
+
57
+ ```bash
58
+ python -m cannlog.server /path/to/log_dir --host localhost --port 18000
59
+ python -m app.server /path/to/log_dir --host localhost --port 18000
60
+ ```
61
+
62
+ 打开:`http://localhost:18000`
63
+
64
+ 默认 host 是 `localhost`,默认端口是 `18000`。如果不传 `--port` 且 `18000` 被占用,会自动尝试后续端口;如果显式传了 `--port`,端口被占用时会直接提示并退出。
65
+
66
+ 远程机器上运行时:
67
+
68
+ - 如果使用 VS Code Remote,可以在 `Ports/端口` 面板中转发服务提示的端口,然后点浏览器图标打开。
69
+ - 如果没有 VS Code 端口转发功能,在本地终端建立 SSH 隧道:
70
+
71
+ ```bash
72
+ ssh -N -L 18000:127.0.0.1:18000 <user>@<ip>
73
+ ```
74
+
75
+ 然后在本地浏览器打开:`http://localhost:18000`。如果服务自动切换到了其它端口,把命令里的 `18000` 换成实际提示的端口。
76
+
77
+ ## 已支持的日志类型
78
+
79
+ - 指令日志:`*.instr_log.dump`、`*.instr_popped_log.dump`
80
+ - 访存日志:`*.rd_log.dump`、`*.wr_log.dump`
81
+ - PV 访存日志:`*rvec_pv.dump`,按指令 ID 合并 `Rd/Wr` 数据块并支持解码
82
+ - CCU/队列事件:`*.ccu_log.dump`、`*issque.dump`、`*.OOO.dump`
83
+ - PMU/summary:`*.perf_pmu.log`、`*.perf_pmu_per_vf.log`、`*summary_log`
84
+
85
+ ## 功能
86
+
87
+ - 给定日志目录启动本地 Web 服务
88
+ - 前端动态加载文件树和事件页,大日志分页读取
89
+ - 访存日志按指令 ID 合并展示;PV 日志中同一指令下相同读写和寄存器会合并,不同读写或寄存器会分块展示
90
+ - 支持 `hex32`、`uint8/int8`、`uint16/int16/float16/bfloat16`、`uint32/int32/float32`、`uint64/int64/float64` 解码
91
+ - 按 `instructionId` 跨文件查询关联访存事件,并可跳转定位到具体事件
92
+ - 支持分类、Core、Unit、文件名过滤
93
+ - 支持多日志页签、右键菜单、新窗口打开、重载日志
94
+ - 日志文件树和详情面板支持收起/展开
95
+
96
+ ## 使用示例
97
+
98
+ ```bash
99
+ cannlog /mnt/workspace/log/cann-sim/log_ca --host 0.0.0.0 --port 18000
100
+ ```
101
+
102
+ 打开:`http://localhost:18000`
103
+
104
+ ## API
105
+
106
+ - `GET /api/overview`
107
+ - `GET /api/files`
108
+ - `GET /api/file?path=...&page=1&pageSize=50`
109
+ - `GET /api/stats?path=...`
110
+ - `GET /api/instruction-memory?instructionId=4309`
111
+ - `GET /api/decode-memory?path=core0.veccore0.ub.wr_log.dump&eventIndex=0&dtype=float32`
112
+ - `POST /api/reload`
113
+
114
+ ## 打包发布到 PyPI
115
+
116
+ 安装构建和上传工具:
117
+
118
+ ```bash
119
+ python -m pip install build twine
120
+ ```
121
+
122
+ 构建源码包和 wheel:
123
+
124
+ ```bash
125
+ python -m build
126
+ ```
127
+
128
+ 检查包元数据:
129
+
130
+ ```bash
131
+ python -m twine check dist/*
132
+ ```
133
+
134
+ 上传到 TestPyPI:
135
+
136
+ ```bash
137
+ python -m twine upload --repository testpypi dist/*
138
+ ```
139
+
140
+ 上传到正式 PyPI:
141
+
142
+ ```bash
143
+ python -m twine upload dist/*
144
+ ```
145
+
146
+ 发布前建议:
147
+
148
+ - 确认 `pyproject.toml` 中的 `name = "cannlog"` 没有被 PyPI 占用
149
+ - 为每次发布递增 `version`
150
+ - 许可证已在 `LICENSE` 和 `pyproject.toml` 中声明为 MIT
151
+
152
+ ## 实现说明
153
+
154
+ - 后端仅使用 Python 标准库,无运行时依赖
155
+ - 前端为原生 HTML/CSS/JS,无需构建
156
+ - 静态资源已作为 package data 打进 wheel,pip 安装后可直接运行
157
+
158
+ ## 许可证
159
+
160
+ 本项目使用 MIT License,详见 `LICENSE`。
@@ -0,0 +1,138 @@
1
+ # cannlog
2
+
3
+ 用于浏览和解析 `cannsim` 仿真日志的本地 Web 可视化工具。后端给定日志目录启动,前端在浏览器中动态查看日志、访存数据和指令关联关系。
4
+
5
+ ## 安装
6
+
7
+ 从 PyPI 安装:
8
+
9
+ ```bash
10
+ pip install cannlog
11
+ ```
12
+
13
+ 从源码安装:
14
+
15
+ ```bash
16
+ pip install .
17
+ ```
18
+
19
+ 开发模式安装:
20
+
21
+ ```bash
22
+ pip install -e .
23
+ ```
24
+
25
+ 安装后主命令是 `cannlog`:
26
+
27
+ ```bash
28
+ cannlog /path/to/log_dir --host localhost --port 18000
29
+ ```
30
+
31
+ 也保留了兼容别名:`cann-log-parser`、`cann-log-viewer`。
32
+
33
+ 也可以继续使用模块入口:
34
+
35
+ ```bash
36
+ python -m cannlog.server /path/to/log_dir --host localhost --port 18000
37
+ python -m app.server /path/to/log_dir --host localhost --port 18000
38
+ ```
39
+
40
+ 打开:`http://localhost:18000`
41
+
42
+ 默认 host 是 `localhost`,默认端口是 `18000`。如果不传 `--port` 且 `18000` 被占用,会自动尝试后续端口;如果显式传了 `--port`,端口被占用时会直接提示并退出。
43
+
44
+ 远程机器上运行时:
45
+
46
+ - 如果使用 VS Code Remote,可以在 `Ports/端口` 面板中转发服务提示的端口,然后点浏览器图标打开。
47
+ - 如果没有 VS Code 端口转发功能,在本地终端建立 SSH 隧道:
48
+
49
+ ```bash
50
+ ssh -N -L 18000:127.0.0.1:18000 <user>@<ip>
51
+ ```
52
+
53
+ 然后在本地浏览器打开:`http://localhost:18000`。如果服务自动切换到了其它端口,把命令里的 `18000` 换成实际提示的端口。
54
+
55
+ ## 已支持的日志类型
56
+
57
+ - 指令日志:`*.instr_log.dump`、`*.instr_popped_log.dump`
58
+ - 访存日志:`*.rd_log.dump`、`*.wr_log.dump`
59
+ - PV 访存日志:`*rvec_pv.dump`,按指令 ID 合并 `Rd/Wr` 数据块并支持解码
60
+ - CCU/队列事件:`*.ccu_log.dump`、`*issque.dump`、`*.OOO.dump`
61
+ - PMU/summary:`*.perf_pmu.log`、`*.perf_pmu_per_vf.log`、`*summary_log`
62
+
63
+ ## 功能
64
+
65
+ - 给定日志目录启动本地 Web 服务
66
+ - 前端动态加载文件树和事件页,大日志分页读取
67
+ - 访存日志按指令 ID 合并展示;PV 日志中同一指令下相同读写和寄存器会合并,不同读写或寄存器会分块展示
68
+ - 支持 `hex32`、`uint8/int8`、`uint16/int16/float16/bfloat16`、`uint32/int32/float32`、`uint64/int64/float64` 解码
69
+ - 按 `instructionId` 跨文件查询关联访存事件,并可跳转定位到具体事件
70
+ - 支持分类、Core、Unit、文件名过滤
71
+ - 支持多日志页签、右键菜单、新窗口打开、重载日志
72
+ - 日志文件树和详情面板支持收起/展开
73
+
74
+ ## 使用示例
75
+
76
+ ```bash
77
+ cannlog /mnt/workspace/log/cann-sim/log_ca --host 0.0.0.0 --port 18000
78
+ ```
79
+
80
+ 打开:`http://localhost:18000`
81
+
82
+ ## API
83
+
84
+ - `GET /api/overview`
85
+ - `GET /api/files`
86
+ - `GET /api/file?path=...&page=1&pageSize=50`
87
+ - `GET /api/stats?path=...`
88
+ - `GET /api/instruction-memory?instructionId=4309`
89
+ - `GET /api/decode-memory?path=core0.veccore0.ub.wr_log.dump&eventIndex=0&dtype=float32`
90
+ - `POST /api/reload`
91
+
92
+ ## 打包发布到 PyPI
93
+
94
+ 安装构建和上传工具:
95
+
96
+ ```bash
97
+ python -m pip install build twine
98
+ ```
99
+
100
+ 构建源码包和 wheel:
101
+
102
+ ```bash
103
+ python -m build
104
+ ```
105
+
106
+ 检查包元数据:
107
+
108
+ ```bash
109
+ python -m twine check dist/*
110
+ ```
111
+
112
+ 上传到 TestPyPI:
113
+
114
+ ```bash
115
+ python -m twine upload --repository testpypi dist/*
116
+ ```
117
+
118
+ 上传到正式 PyPI:
119
+
120
+ ```bash
121
+ python -m twine upload dist/*
122
+ ```
123
+
124
+ 发布前建议:
125
+
126
+ - 确认 `pyproject.toml` 中的 `name = "cannlog"` 没有被 PyPI 占用
127
+ - 为每次发布递增 `version`
128
+ - 许可证已在 `LICENSE` 和 `pyproject.toml` 中声明为 MIT
129
+
130
+ ## 实现说明
131
+
132
+ - 后端仅使用 Python 标准库,无运行时依赖
133
+ - 前端为原生 HTML/CSS/JS,无需构建
134
+ - 静态资源已作为 package data 打进 wheel,pip 安装后可直接运行
135
+
136
+ ## 许可证
137
+
138
+ 本项目使用 MIT License,详见 `LICENSE`。
@@ -0,0 +1,3 @@
1
+ """CANN simulation log parser and viewer."""
2
+
3
+ __version__ = "0.1.7"