测试实时操作系统的硬度

时间:2022-03-11 03:36:18

I have an embedded device (Technologic TS-7800) that advertises real-time capabilities, but says nothing about 'hard' or 'soft'. While I wait for a response from the manufacturer, I figured it wouldn't hurt to test the system myself.

我有一个嵌入式设备(Technologic TS-7800),宣传实时功能,但没有说“硬”或“软”。当我等待制造商的回复时,我认为自己测试系统不会有什么坏处。

What are some established procedures to determine the 'hardness' of a particular device with respect to real time/deterministic behavior (latency and jitter)?

在实时/确定性行为(延迟和抖动)方面,有哪些既定程序可以确定特定设备的“硬度”?

Being at college, I have access to some pretty neat hardware (good oscilloscopes and signal generators), so I don't think I'll run into any issues in terms of testing equipment, just expertise.

在大学期间,我可以使用一些非常整洁的硬件(良好的示波器和信号发生器),所以我认为我不会在测试设备,只是专业知识方面遇到任何问题。

6 个解决方案

#1


I have the same board here at work. It's a slightly-modified 2.6 Kernel, I believe... not the real-time version.

我在这里有同样的董事会。这是一个略微修改的2.6内核,我相信......不是实时版本。

I don't know that I've read anything in the docs yet that indicates that it is meant for strict RTOS work.

我不知道我已经阅读了文档中的任何内容,这表明它适用于严格的RTOS工作。

#2


With that kind of equipment, it ought to be fairly easy to sync the o-scope to a steady clock, produce a spike each time the real-time system produces an output, an see how much that spike varies from center. The less the variation, the greater the hardness.

使用这种设备,将o-scope同步到稳定的时钟应该相当容易,每次实时系统产生输出时产生尖峰,看看尖峰与中心的差异有多大。变化越小,硬度越大。

#3


To clarify Bob's answer maybe:

澄清鲍勃的答案可能是:

Use the signal generator to generate a pulse at some varying frequency. Random distribution across some range would be best.

使用信号发生器以某种变化的频率产生脉冲。在某些范围内随机分布是最好的。

use the signal generator (trigger signal) to start the scope.

使用信号发生器(触发信号)启动示波器。

the RTOS has to respond, do it thing and send an output pulse.

RTOS必须响应,做它并发送输出脉冲。

feed the RTOS output into input 2 of the scope.

将RTOS输出馈送到示波器的输入2。

get the scope to persist/collect mode. get the scope to start on A , stop on B. if you can.

获得持久/收集模式的范围。如果可以,让范围从A开始,在B.上停止。

in an ideal workd, get it to measure the distribution for you. A LeCroy would. Start with a much slower trace than you would expect. You need to be able to see slow outliers. You'll be able to see the distribution.
Assuming a normal distribution the SD of the response time variation is the SOFTNESS. (This won't really happen in practice, but if you don't get outliers it is reasonably useful. ) If there are outliers of large latency, then the RTOS is NOT very hard. Does not meet deadlines well. Unsuitable then it is for hard real time work. Many RTOS-like things have a good left edge to the curve, sloping down like a 1/f curve. Thats indicitive of combined jitters. The thing to look out for is spikes of slow response on the right end of the scope. Keep repeating the experiment with faster traces if there are no outliers to get a good image of the slope. Should be good for some speculative conclusion in your paper.

在理想的工作中,让它来衡量你的分布。力科会。从比预期慢得多的跟踪开始。你需要能够看到缓慢的异常值。你将能够看到分布。假设正态分布,响应时间变化的SD是SOFTNESS。 (这在实践中不会真正发生,但是如果你没有得到异常值,那么它是非常有用的。)如果存在大延迟的异常值,那么RTOS并不是很难。不符合截止日期。不合适的是实时工作。许多类似RTOS的东西都具有良好的曲线左边缘,像1 / f曲线一样向下倾斜。这表明联合紧张。需要注意的是范围右端​​的响应缓慢。如果没有异常值可以获得良好的斜率图像,请使用更快的迹线重复实验。应该对你的论文中的一些推测性结论有好处。

If for your application, say a delta of 1uS is okay, and you measure 0.5us, it's all cool.

如果你的应用程序,说1uS的增量是可以的,你测量0.5us,这一切都很酷。

Anyway, you can publish the results ( and probably in the publish sense, but certainly on the web.)

无论如何,你可以发布结果(可能在发布意义上,但肯定在网上。)

Link from this Question to the paper when you've written it.

当你写这篇文章时,从这个问题链接到论文。

#4


Hard real-time has more to do with how your software works than the hardware on its own. When asking if something is hard real-time it must be applied to the complete system (Hardware, RTOS and application). This means hard or soft real-time is system design issues.

硬实时与软件的工作方式有关,而不是硬件本身。当询问某些内容是否真实时,它必须应用于整个系统(硬件,RTOS和应用程序)。这意味着硬实时或软实时是系统设计问题。

Under loading exceeding the specification even a hard real-time system will fail (hopefully with proper failure indication) while a soft real-time system with low loading would give hard real-time results. How much processing must happen in time and how much pre/post processing can be performed is the real key to hard/soft real-time.

在超过规格的负载下,即使硬实时系统也会失败(希望有适当的故障指示),而低负载的软实时系统会给出硬实时结果。必须及时处理多少处理以及可以执行多少前/后处理是硬/软实时的真正关键。

In some real-time applications some data loss is not a failure it should just be below a certain level, again a system criteria.

在一些实时应用程序中,一些数据丢失并不是失败,它应该只是低于某个级别,同样是系统标准。

You can generate inputs to the board and have a small application count them and check at what level data is going to be lost. But that gives you a rating specific to that system running that application. As soon as you start doing more processing your computational load increases and you now have a different hard real-time limit.

您可以为电路板生成输入并让一个小应用程序对它们进行计数,并检查数据将丢失的级别。但是,这会为您提供特定于运行该应用程序的系统的评级。一旦开始进行更多处理,您的计算负荷就会增加,现在您有了不同的硬实时限制。

This board will running a bare bones scheduler will give great predictable hard real-time performance for most tasks. Running a full RTOS with heavy computational load you probably only get soft real-time.

该板将运行一个裸骨调度程序,为大多数任务提供可预测的硬实时性能。运行具有大量计算负载的完整RTOS,您可能只能实时获得软件。

Edit after comment
The most efficient and easiest way I have used to measure my software's performance (assuming you use a schedular) is by using a free running hardware timer on the board and to time stamp my start and end of my cycle. Or if you run a full RTOS time stamp you acquisition and transition. Save your Max time and run a average on the values over a second. If your average is around 50% and you max is within 20% of your average you are OK. If not it is time to refactor your application. As your application grows the cycle time will grow. You can monitor the effect of all your software changes on your cycle time.

评论后编辑我用来衡量软件性能的最有效和最简单的方法(假设您使用的是调度程序)是通过在电路板上使用*运行的硬件计时器并为我的周期的开始和结束添加时间戳。或者,如果您运行完整的RTOS时间戳,则可以获取并转换。保存最长时间并在一秒钟内对值进行平均运行。如果您的平均值在50%左右,并且您的最大值在平均值的20%以内,那么您就可以了。如果没有,是时候重构你的申请了。随着应用程序的增长,循环时间将会增加。您可以监控所有软件更改对周期时间的影响。

Another way is to use a hardware timer generate a cyclical interrupt. If you are in time reset the interrupt. If you miss the deadline you have interrupt handler signal a failure. This however will only give you a warning once your application is taking to long but it rely on hardware and interrupts so you can't miss.

另一种方法是使用硬件定时器生成循环中断。如果你及时重置中断。如果你错过截止日期,你就会有中断处理程序发出故障信号。但是,一旦您的应用程序耗时很长,它只会给您一个警告,但它依赖于硬件和中断,因此您不能错过。

These solutions also eliminate the requirement to hook up a scope to monitor the output since the time information can be displayed in any kind of terminal by a background task. If it is easy to monitor you will monitor it regularly avoiding solving the timing problems at the end but as soon as they are introduced.

这些解决方案还消除了连接范围以监视输出的要求,因为时间信息可以由后台任务显示在任何类型的终端中。如果它易于监控,您将定期监控它,避免在最后解决时间问题,但一旦引入它们。

Hope this helps

希望这可以帮助

#5


I think that this is not a hard real-time device, since it runs no RTOS.

我认为这不是一个硬实时设备,因为它不运行RTOS。

#6


I understand being geek, but using oscilloscope to test a computer with ethernet/usb/other digital ports and HUGE internal state (RAM) is both ineffective and unreliable.

我理解是极客,但使用示波器测试带有以太网/ usb /其他数字端口的计算机和巨大的内部状态(RAM)既无效又不可靠。

Instead of watching wave forms, you can connect any PC to the output port and run proper statistical analysis.

您可以将任何PC连接到输出端口并运行正确的统计分析,而不是观察波形。

The established procedure (if the input signal is analog by nature) is to test system against several characteristic inputs - traditionally spikes, step functions and sine waves of different frequencies - and measure phase shift and variance for each input type. Worst case is then used in specifications of the system.

已建立的程序(如果输入信号本质上是模拟的)是针对几个特征输入测试系统 - 传统的尖峰,阶跃函数和不同频率的正弦波 - 并测量每种输入类型的相移和方差。最坏的情况然后用于系统的规范。

Again, if you are using standard ports, you can easily generate those on PC. If the input is truly analog, a separate DAC or simply a good sound card would be needed.

同样,如果您使用的是标准端口,则可以在PC上轻松生成这些端口。如果输入是真正模拟的,则需要单独的DAC或简单的声卡。

Now, that won't say anything about OS being real-time - it could be running vanilla Linux or even Win CE and still produce good and stable results in those tests if hardware is fast enough.

现在,这对于实时操作系统没有任何说明 - 它可以运行vanilla Linux甚至是Win CE,如果硬件足够快,它们仍然可以在这些测试中产生良好稳定的结果。

So, you need to simulate heavy and varying loads on processor, memory and all ports, let it heat and eat memory for a few hours, and then repeat tests. If latency stays constant, it's hard real-time. If it doesn't, under any load and input signal type, increase above acceptable limit, it's soft. Otherwise, it's advertisement.

因此,您需要模拟处理器,内存和所有端口上的重载和变化负载,让它加热并占用内存几个小时,然后重复测试。如果延迟保持不变,则很难实时。如果没有,在任何负载和输入信号类型下,增加到可接受的限制以上,它就是软的。否则,这是广告。

P.S.: Implication is that even for critical systems you don't actually need hard real-time if you have hardware.

P.S。:意味着即使对于关键系统,如果你有硬件,你实际上并不需要硬实时。

#1


I have the same board here at work. It's a slightly-modified 2.6 Kernel, I believe... not the real-time version.

我在这里有同样的董事会。这是一个略微修改的2.6内核,我相信......不是实时版本。

I don't know that I've read anything in the docs yet that indicates that it is meant for strict RTOS work.

我不知道我已经阅读了文档中的任何内容,这表明它适用于严格的RTOS工作。

#2


With that kind of equipment, it ought to be fairly easy to sync the o-scope to a steady clock, produce a spike each time the real-time system produces an output, an see how much that spike varies from center. The less the variation, the greater the hardness.

使用这种设备,将o-scope同步到稳定的时钟应该相当容易,每次实时系统产生输出时产生尖峰,看看尖峰与中心的差异有多大。变化越小,硬度越大。

#3


To clarify Bob's answer maybe:

澄清鲍勃的答案可能是:

Use the signal generator to generate a pulse at some varying frequency. Random distribution across some range would be best.

使用信号发生器以某种变化的频率产生脉冲。在某些范围内随机分布是最好的。

use the signal generator (trigger signal) to start the scope.

使用信号发生器(触发信号)启动示波器。

the RTOS has to respond, do it thing and send an output pulse.

RTOS必须响应,做它并发送输出脉冲。

feed the RTOS output into input 2 of the scope.

将RTOS输出馈送到示波器的输入2。

get the scope to persist/collect mode. get the scope to start on A , stop on B. if you can.

获得持久/收集模式的范围。如果可以,让范围从A开始,在B.上停止。

in an ideal workd, get it to measure the distribution for you. A LeCroy would. Start with a much slower trace than you would expect. You need to be able to see slow outliers. You'll be able to see the distribution.
Assuming a normal distribution the SD of the response time variation is the SOFTNESS. (This won't really happen in practice, but if you don't get outliers it is reasonably useful. ) If there are outliers of large latency, then the RTOS is NOT very hard. Does not meet deadlines well. Unsuitable then it is for hard real time work. Many RTOS-like things have a good left edge to the curve, sloping down like a 1/f curve. Thats indicitive of combined jitters. The thing to look out for is spikes of slow response on the right end of the scope. Keep repeating the experiment with faster traces if there are no outliers to get a good image of the slope. Should be good for some speculative conclusion in your paper.

在理想的工作中,让它来衡量你的分布。力科会。从比预期慢得多的跟踪开始。你需要能够看到缓慢的异常值。你将能够看到分布。假设正态分布,响应时间变化的SD是SOFTNESS。 (这在实践中不会真正发生,但是如果你没有得到异常值,那么它是非常有用的。)如果存在大延迟的异常值,那么RTOS并不是很难。不符合截止日期。不合适的是实时工作。许多类似RTOS的东西都具有良好的曲线左边缘,像1 / f曲线一样向下倾斜。这表明联合紧张。需要注意的是范围右端​​的响应缓慢。如果没有异常值可以获得良好的斜率图像,请使用更快的迹线重复实验。应该对你的论文中的一些推测性结论有好处。

If for your application, say a delta of 1uS is okay, and you measure 0.5us, it's all cool.

如果你的应用程序,说1uS的增量是可以的,你测量0.5us,这一切都很酷。

Anyway, you can publish the results ( and probably in the publish sense, but certainly on the web.)

无论如何,你可以发布结果(可能在发布意义上,但肯定在网上。)

Link from this Question to the paper when you've written it.

当你写这篇文章时,从这个问题链接到论文。

#4


Hard real-time has more to do with how your software works than the hardware on its own. When asking if something is hard real-time it must be applied to the complete system (Hardware, RTOS and application). This means hard or soft real-time is system design issues.

硬实时与软件的工作方式有关,而不是硬件本身。当询问某些内容是否真实时,它必须应用于整个系统(硬件,RTOS和应用程序)。这意味着硬实时或软实时是系统设计问题。

Under loading exceeding the specification even a hard real-time system will fail (hopefully with proper failure indication) while a soft real-time system with low loading would give hard real-time results. How much processing must happen in time and how much pre/post processing can be performed is the real key to hard/soft real-time.

在超过规格的负载下,即使硬实时系统也会失败(希望有适当的故障指示),而低负载的软实时系统会给出硬实时结果。必须及时处理多少处理以及可以执行多少前/后处理是硬/软实时的真正关键。

In some real-time applications some data loss is not a failure it should just be below a certain level, again a system criteria.

在一些实时应用程序中,一些数据丢失并不是失败,它应该只是低于某个级别,同样是系统标准。

You can generate inputs to the board and have a small application count them and check at what level data is going to be lost. But that gives you a rating specific to that system running that application. As soon as you start doing more processing your computational load increases and you now have a different hard real-time limit.

您可以为电路板生成输入并让一个小应用程序对它们进行计数,并检查数据将丢失的级别。但是,这会为您提供特定于运行该应用程序的系统的评级。一旦开始进行更多处理,您的计算负荷就会增加,现在您有了不同的硬实时限制。

This board will running a bare bones scheduler will give great predictable hard real-time performance for most tasks. Running a full RTOS with heavy computational load you probably only get soft real-time.

该板将运行一个裸骨调度程序,为大多数任务提供可预测的硬实时性能。运行具有大量计算负载的完整RTOS,您可能只能实时获得软件。

Edit after comment
The most efficient and easiest way I have used to measure my software's performance (assuming you use a schedular) is by using a free running hardware timer on the board and to time stamp my start and end of my cycle. Or if you run a full RTOS time stamp you acquisition and transition. Save your Max time and run a average on the values over a second. If your average is around 50% and you max is within 20% of your average you are OK. If not it is time to refactor your application. As your application grows the cycle time will grow. You can monitor the effect of all your software changes on your cycle time.

评论后编辑我用来衡量软件性能的最有效和最简单的方法(假设您使用的是调度程序)是通过在电路板上使用*运行的硬件计时器并为我的周期的开始和结束添加时间戳。或者,如果您运行完整的RTOS时间戳,则可以获取并转换。保存最长时间并在一秒钟内对值进行平均运行。如果您的平均值在50%左右,并且您的最大值在平均值的20%以内,那么您就可以了。如果没有,是时候重构你的申请了。随着应用程序的增长,循环时间将会增加。您可以监控所有软件更改对周期时间的影响。

Another way is to use a hardware timer generate a cyclical interrupt. If you are in time reset the interrupt. If you miss the deadline you have interrupt handler signal a failure. This however will only give you a warning once your application is taking to long but it rely on hardware and interrupts so you can't miss.

另一种方法是使用硬件定时器生成循环中断。如果你及时重置中断。如果你错过截止日期,你就会有中断处理程序发出故障信号。但是,一旦您的应用程序耗时很长,它只会给您一个警告,但它依赖于硬件和中断,因此您不能错过。

These solutions also eliminate the requirement to hook up a scope to monitor the output since the time information can be displayed in any kind of terminal by a background task. If it is easy to monitor you will monitor it regularly avoiding solving the timing problems at the end but as soon as they are introduced.

这些解决方案还消除了连接范围以监视输出的要求,因为时间信息可以由后台任务显示在任何类型的终端中。如果它易于监控,您将定期监控它,避免在最后解决时间问题,但一旦引入它们。

Hope this helps

希望这可以帮助

#5


I think that this is not a hard real-time device, since it runs no RTOS.

我认为这不是一个硬实时设备,因为它不运行RTOS。

#6


I understand being geek, but using oscilloscope to test a computer with ethernet/usb/other digital ports and HUGE internal state (RAM) is both ineffective and unreliable.

我理解是极客,但使用示波器测试带有以太网/ usb /其他数字端口的计算机和巨大的内部状态(RAM)既无效又不可靠。

Instead of watching wave forms, you can connect any PC to the output port and run proper statistical analysis.

您可以将任何PC连接到输出端口并运行正确的统计分析,而不是观察波形。

The established procedure (if the input signal is analog by nature) is to test system against several characteristic inputs - traditionally spikes, step functions and sine waves of different frequencies - and measure phase shift and variance for each input type. Worst case is then used in specifications of the system.

已建立的程序(如果输入信号本质上是模拟的)是针对几个特征输入测试系统 - 传统的尖峰,阶跃函数和不同频率的正弦波 - 并测量每种输入类型的相移和方差。最坏的情况然后用于系统的规范。

Again, if you are using standard ports, you can easily generate those on PC. If the input is truly analog, a separate DAC or simply a good sound card would be needed.

同样,如果您使用的是标准端口,则可以在PC上轻松生成这些端口。如果输入是真正模拟的,则需要单独的DAC或简单的声卡。

Now, that won't say anything about OS being real-time - it could be running vanilla Linux or even Win CE and still produce good and stable results in those tests if hardware is fast enough.

现在,这对于实时操作系统没有任何说明 - 它可以运行vanilla Linux甚至是Win CE,如果硬件足够快,它们仍然可以在这些测试中产生良好稳定的结果。

So, you need to simulate heavy and varying loads on processor, memory and all ports, let it heat and eat memory for a few hours, and then repeat tests. If latency stays constant, it's hard real-time. If it doesn't, under any load and input signal type, increase above acceptable limit, it's soft. Otherwise, it's advertisement.

因此,您需要模拟处理器,内存和所有端口上的重载和变化负载,让它加热并占用内存几个小时,然后重复测试。如果延迟保持不变,则很难实时。如果没有,在任何负载和输入信号类型下,增加到可接受的限制以上,它就是软的。否则,这是广告。

P.S.: Implication is that even for critical systems you don't actually need hard real-time if you have hardware.

P.S。:意味着即使对于关键系统,如果你有硬件,你实际上并不需要硬实时。