如何计算 ARM 处理器算法的 MIPS [英] How to calculate MIPS for an algorithm for ARM processor

查看:38
本文介绍了如何计算 ARM 处理器算法的 MIPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近被要求为我们开发的算法生成 MIPS(每秒百万条指令).该算法由一组 C 风格的函数公开.我们在戴尔 Axim 上练习了代码,以对不同输入下的性能进行基准测试.

I have been asked recently to produced the MIPS (million of instructions per second) for an algorithm we have developed. The algorithm is exposed by a set of C-style functions. We have exercise the code on a Dell Axim to benchmark the performance under different input.

这个问题来自我们的硬件供应商,但我主要是一名 HL 软件开发人员,所以我不确定如何回应请求.也许有类似硬件/软件背景的人可以提供帮助...

This question came from our hardware vendor, but I am mostly a HL software developer so I am not sure how to respond to the request. Maybe someone with similar HW/SW background can help...

  1. 由于我们的算法不是实时的,我认为我们不需要将其量化为 MIPS.是否可以简单地引用汇编指令的总数?

  1. Since our algorithm is not real time, I don't think we need to quantify it as MIPS. Is it possible to simply quote the total number of assembly instructions?

如果 1 为真,您通常如何或专门针对 ARM/XScale 执行此操作(即如何测量汇编指令的数量)?

If 1 is true, how do you do this (ie. how to measure the number of assembly instructions) either in general or specifically for ARM/XScale?

2 能否在 WM 设备上或通过 VS2005 中提供的设备模拟器执行?

Can 2 be performed on a WM device or via the Device Emulator provided in VS2005?

3 可以自动化吗?

非常感谢您的帮助.查尔斯

Thanks a lot for your help. Charles

感谢您的帮助.我认为 S.Lott 一针见血.作为跟进,我现在有更多问题.

Thanks for all your help. I think S.Lott hit the nail. And as a follow up, I now have more questions.

5 关于如何测量 MIPS 有什么建议吗?我听说有人建议运行我们的算法并将其与 Dhrystone/Whetstone 基准进行比较以计算 MIS.

5 Any suggestion on how to go about measuring MIPS? I heard some one suggest running our algorithm and comparing it against Dhrystone/Whetstone benchmark to calculate MIS.

6 既然算法不需要实时运行,那么MIPS真的是一个有用的度量吗?(例如,阶乘(N))还有哪些其他方法可以量化处理要求?(我已经测量了运行时性能,但不是一个令人满意的答案.)

6 Since the algorithm does not need to be run in real time, is MIPS really a useful measure? (eg. factorial(N)) What are other ways to quantity the processing requirements? (I have already measured the runtime performance but it was not a satisfactory answer.)

7 最后,我假设 MIPS 是一个粗略的估计,并且是 dep.关于编译器、优化设置等?

7 Finally, I assume MIPS is a crude estimate and would be dep. on compiler, optimization settings, etc?

推荐答案

我敢打赌,您的硬件供应商会问您需要多少 MIPS.

I'll bet that your hardware vendor is asking how many MIPS you need.

如您需要 1,000 MIPS 的处理器还是 2,000 MIPS 的处理器?"

As in "Do you need a 1,000 MIPS processor or a 2,000 MIPS processor?"

哪个被管理层翻译成多少 MIPS?"

Which gets translated by management into "How many MIPS?"

硬件提供 MIPS.软件消耗 MIPS.

Hardware offers MIPS. Software consumes MIPS.

你有两个自由度.

  • 处理器固有的 MIPS 产品.

  • The processor's inherent MIPS offering.

您消耗这么多 MIPS 的秒数.

The number of seconds during which you consume that many MIPS.

如果处理器没有足够的 MIPS,你的算法就会很慢".

If the processor doesn't have enough MIPS, your algorithm will be "slow".

如果处理器有足够的 MIPS,你的算法就会很快".

if the processor has enough MIPS, your algorithm will be "fast".

我将快"和慢"放在引号中是因为您需要有一个性能要求来确定足够快以满足性能要求"或太慢而无法满足性能要求".

I put "fast" and "slow" in quotes because you need to have a performance requirement to determine "fast enough to meet the performance requirement" or "too slow to meet the performance requirement."

在 2,000 MIPS 处理器上,您可能需要 2 秒的时间.但在 1,000 MIPS 处理器上,这会爆炸到令人无法接受的 4 秒.

On a 2,000 MIPS processor, you might take an acceptable 2 seconds. But on a 1,000 MIPS processor this explodes to an unacceptable 4 seconds.

您需要多少 MIPS?

How many MIPS do you need?

  1. 为您的处理器获取官方 MIPS.请参阅 http://en.wikipedia.org/wiki/Instructions_per_second

在一些数据上运行你的算法.

Run your algorithm on some data.

测量准确的运行时间.平均一堆样本以减少不确定性.

Measure the exact run time. Average a bunch of samples to reduce uncertainty.

报告.750 MIPS 处理器上的 3 秒是——嗯—— 750 MIPS 下的 3 秒.MIPS 是一个比率.时间就是时间.距离是速率 * 时间的乘积.750 MIPS 的 3 秒是 750*3 百万条指令.

Report. 3 seconds on a 750 MIPS processor is -- well -- 3 seconds at 750 MIPS. MIPS is a rate. Time is time. Distance is the product of rate * time. 3 seconds at 750 MIPS is 750*3 million instructions.

记住速率(以每秒指令数为单位)* 时间(以秒为单位)为您提供指令.

Remember Rate (in Instructions per second) * Time (in seconds) gives you Instructions.

别说是3*750 MIPS.它不是;这是 22.5 亿条指令.

Don't say that it's 3*750 MIPS. It isn't; it's 2250 Million Instructions.

这篇关于如何计算 ARM 处理器算法的 MIPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆