常见泽1 发表于 2023-8-22 18:45

【ST NUCLEO-WBA52CG】第七篇 CoreMark跑分

<div class='showpostmsg'><p align="left"><span style="font-family:宋体;"><span style="font-size:12px;">前言:</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">Coremark是一个综合性的基准测试程序,正如其名称所表示的, CoreMark测试是一个简单而又复杂的基准测试程序,是专门用来测试处理器核心性能的。通过执行常用于应用程序中的简单代码(基本的数据结构和算法)来测试cpu性能。结果是计算每秒钟主程序的迭代次数。</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">不说废话,开始移植coremark</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">一下载coremark</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"><a href="http://www.eembc.org/coremark/index.php" target="_blank">http://www.eembc.org/coremark/index.php</a></span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">这个网站不仅可以下载源码,还能查看所有型号的跑分情况和跑分的环境</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">&nbsp;COREMARK下载地址</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"><a href="https://github.com/eembc/coremark" target="_blank">https://github.com/eembc/coremark</a></span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">二创建printf工程</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">之前的笔记已经详细介绍了创建这个printf工程</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">三工程中添加coremark代码</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">创建CoreMark Group,添加所有的C文件</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">添加头文件路径</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">四修改堆栈大小</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">五配置CoreMark</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">(1)修改portable_init函数</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">修改前</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">修改后</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">添加各种初始化函数</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">(2)把SystemClock_Config, MX_USART1_UART_Init 和 MX_GPIO_Init 函数拷贝到core_portme.c, 并添将加 printf 重定向的代码。</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">这个比较简单,都是之前Printf工程里的代码复制过来就可以了</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">(3) core_portme.c文件里添加声明和变量定义</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">添加头文件</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">(4)修改计时相关代码</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">1.添加ITERATIONS定义</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">#define ITERATIONS 10000///at least 10s</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">2.添加FLAGS的定义,编译器优化等级</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">#ifndef COMPILER_FLAGS</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">#define COMPILER_FLAGS &quot;-Omax&quot; /* &quot;Please put compiler flags here (e.g. -o3)&quot; */</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">&nbsp; &nbsp;</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">3.时间计时处理修改</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">修改前</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">修改后</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">编译下载</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">&nbsp;看了STM32WBA跑分</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>

<p align="left" >&nbsp;</p>

<p align="left" >&nbsp;</p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">ICACHE等该开的都开了</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">一直在修改配置</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">始终无法达到400分</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;">不知道是不是需要IAR才能把分数提高</span></span></p>

<p align="left" ><span style="font-family:宋体;"><span style="font-size:12px;"> &nbsp;</span></span></p>
</div><script>                                        var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;"   style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
                                       
                                        if(parseInt(discuz_uid)==0){
                                                                                                (function($){
                                                        var postHeight = getTextHeight(400);
                                                        $(".showpostmsg").html($(".showpostmsg").html());
                                                        $(".showpostmsg").after(loginstr);
                                                        $(".showpostmsg").css({height:postHeight,overflow:"hidden"});
                                                })(jQuery);
                                        }                </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>

火辣西米秀 发表于 2023-8-24 07:28

<p align="left">始终无法达到400分</p>

<p align="left">不知道是不是需要IAR才能把分数提高</p>

<p align="left">哈哈,大佬有这方面的追求啊</p>
页: [1]
查看完整版本: 【ST NUCLEO-WBA52CG】第七篇 CoreMark跑分