From c3be8c550f33a1349c81fe5e0a2faf0223088004 Mon Sep 17 00:00:00 2001 From: lf <15201710458@163.com> Date: Wed, 5 Aug 2020 11:31:54 +0800 Subject: [PATCH] add perf analyze --- README.md | 30 ++++++++++++++++++++++++++++-- doc/perf/SM3性能分析.xlsx | Bin 0 -> 10219 bytes rtl/inc/sm3_cfg.v | 6 ++++-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 doc/perf/SM3性能分析.xlsx diff --git a/README.md b/README.md index d7cd6a2..5b62b44 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ SM3算法采用Merkle-Damgård结构,消息分组长度512比特,摘要结 - 输入消息长度按字节对齐;消息长度支持标准规定的最长消息长度:(2^64-1) 比特 - 输入与内部运算位宽可为 32/64 比特 + - 64 比特版本中,迭代压缩采用**二度展开**算法 - 单个消息块运算时钟周期为 65 (32 bit) / 33 (64 bit) - 最大吞吐(FPGA : //TODO ASIC: //TODO) @@ -78,12 +79,30 @@ SM3_core 目前提供了一个基于 Modelsim 与 Windows 10 的测试平台, 运行 sim/run/run_sim.bat 脚本启动测试平台,该脚本 -- 通过环境变量获取 Modelsim 路径(实际通过 License 变量:LM_LICENSE_FILE) +- 通过环境变量获取 Modelsim 路径(实际通过 License 的环境变量:LM_LICENSE_FILE 获取的 modelsim 路径) - 目前已经测试的 Modelsim 版本与环境:10.5 on Win10 +运行 trouble shooting: + +//TODO 若运行遇到问题,欢迎提出 issue + #### 实现 -- FPGA:Virtex-7 with Vivado 18.3 //TODO +- FPGA: + + Virtex-7 (xc7vx330t) with Vivado 18.3 + + 默认综合与实现策略 + + | | 32bit | 64bit | + | ---------------- | ------------ | -------------- | + | 频率 MHz | 238.1 | 126.6 | + | 吞吐 Mbps | 1875.5 | 1963.7 | + | 运行周期 ns | 273(65clk) | 260.8(33clk) | + | 资源 LUTs/Slices | 1224/418 | 1569/530 | + + + - ASIC: //TODO ### 未来演进 @@ -94,7 +113,14 @@ SM3_core 目前提供了一个基于 Modelsim 与 Windows 10 的测试平台, - 支持 AXI-stream 总线接口 - 提供更完善的文档支持 +### 更新 +| 版本 | 更新时间 | 更新内容 | +| ---- | --------- | ---------------------------- | +| v0.1 | 2020.7.29 | First release | +| v0.2 | 2020.8.5 | 1.增加对 64 比特总线的支持 | +| | | 2.在 FPGA 平台分析性能与资源 | +| | | 3.修正 BUG | ### diff --git a/doc/perf/SM3性能分析.xlsx b/doc/perf/SM3性能分析.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..b6975312d90ae507ddb97d5a319ea4d4688a7a1b GIT binary patch literal 10219 zcmeHt^yt{>J~^Rw3Yt~KTyJ*J8R0wNIb2!H|r0H^@2d^$y5Z~#Cs5&(b)K!Mkl zbg*}Y*t;64dpbf~^x0q8**?ifglEhJz{B4E@9}?l1}fCYl;F9rJ2Ee^G7T_w4~?RY z*ZsZJaS!3Fg{m=E8n-b}91d(HOfWzwdW{Q>CwDI_ip2EztF$CQq_63`AYkB{8|UW< zmLo2oJ>f`rInM&ULzM{3Tp}!chwB+dL{@=CQ#$MXOIo_0BqSk_@U<&5f|mv1elvQ{ z3kj{Ujyslo;ssy9E0bGu_2xn`cp6;QKU8>nmv7E^sYW+m=#}|jOPjHIg$0Kl8+tju5QFRn7h&f8`05_9WX}{=jeK6 zfu!D&ppFwB&g9#b=AOZIhGY$mwWm|9xAfphWK{YET!`3L}jLJ6 z4NjUj-;!q&ok~TM>l|6rySLs0>ZJ zc5*{zrgu(#?o_efi{n0fHhZ2SBk#%R-X6zX-dvKWFtkeZeC9~1277`XOoED6NES*U zk`bWOuc-aS!6z_mX=;W`HjD%ulDD_h=;BvzH&W zr+n~mC@_k$b7 zH`u%Xw~va%5$j$~4C#xI`=F@~CvG2=P$%=Lm+5wyzW$EM0xwLEb$vDuY+ecueT=uS z<&y2bponN&^7E*?q@^UWz&Dda3#@R5nA#v6^o@+sgnzVDu+64JLO`1TJ_l|CTPJK3 z8@&+?FEI&%?^$*z#8^}bqjC~i5Gc($h&SD~Stt-S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