1 Star 0 Fork 0

wolver/example_student_code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
computeResourceUtilization.py 608 Bytes
一键复制 编辑 原始数据 按行查看 历史
Nathan Zhang 提交于 2023-01-20 07:43 +08:00 . Update for Win 2023
import sys
import json
import operator
import functools
def comp_size(bitWidth, dims, padding, nBuf):
size = functools.reduce(operator.mul, [d + p for d, p in zip(dims, padding)])
return size * bitWidth * nBuf
if __name__ == "__main__":
with open(sys.argv[1]) as report_file:
report = json.load(report_file)
sizes = {
"bram": 0,
"reg": 0,
"ops": report["fixed_ops"]
}
del report["fixed_ops"]
for memory_type, data in report.items():
for name, sizing in data.items():
sizes[memory_type] += comp_size(*sizing)
print(sizes)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wolver/example_student_code.git
git@gitee.com:wolver/example_student_code.git
wolver
example_student_code
example_student_code
master

搜索帮助