完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,
我用PSoc Creator开发了C代码,我想知道如何测试开发代码的性能。 以上来自于百度翻译 以下为原文 Hello, I have developed c code by using PSoc Creator and i want to know about how to test performance of developed code. |
|
相关推荐
3个回答
|
|
|
你想做一个单元测试(如在“测试正确性”)或一个性能测试(如“它有多快”)?对于前者,我可以推荐Ceedling、CMOKK和Unity的组合。请注意,尤其是嘲讽可能是有趣的,因为您需要从硬件中抽象出来。
以上来自于百度翻译 以下为原文 Do you want to do a unit-test (as in 'testing for correctness') or a performance test (as in 'how fast is it')? For the former, I can recommend the combination of Ceedling, CMock and Unity. Note that especially mocking can be interesting since you need to abstract from your hardware. |
|
|
|
|
|
对于第二种情况(如何快速…)使用逻辑分析仪,并切换一个引脚,看看事情进展得多么快……
鲍勃 以上来自于百度翻译 以下为原文 And for the second case (how fast...) use a logic analyzer and toggle a pin to see how fast things go on... Bob |
|
|
|
|
|
您可以使用自定义秒表组件(附加)来测量某些代码消耗的CPU时钟周期。它使用系统SyBIT定时器来计算CPU周期。该组件未完成,但适用于PSoC4、4M和5LP。要测量CPU时钟,请在代码中放置StaseWistBoad Stor()和StaseWistFixStor(),并在终端上打印结果:
StaseWistBoad启动();/重置定时器 /你的代码在这里(函数,ISR等) … 停止计时() UTIT32总线锁=停止表周期;//读取结果 要将秒表组件添加到项目中,请将其从附件演示项目导入。 停止手表P4MY001.PNG 70.4 K 停止手表P4MY01A.PNG 49.1 K TopWistApP4MY01-1000.CyWrk.SaveV01.Zip 1.4兆字节 以上来自于百度翻译 以下为原文 You can measure amount of CPU clock cycles consumed by some piece of code using custom StopWatch component (attached). It uses system SysTick timer to count CPU cycles. The component is rather unfinished, but works for PSoC4, 4M and 5LP. To measure CPU clocks put StopWatch_Start() and StopWatch_Stop() in your code, and print result on terminal: StopWatch_Start() ; // reset timer // your code is here (function, ISR, etc.) ..... StopWatch_Stop() ; // stop timer uint32 BusClockTicks = StopWatch_Cycles; // read result To add StopWatch component to you project, Import it from the demo project attached.
|
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7241 浏览 0 评论
2482 浏览 1 评论
2175 浏览 1 评论
4037 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2082 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7724浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6283浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
751浏览 2评论
725浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
8119浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-8 16:16 , Processed in 2.790034 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3801