Arm Announces Cortex-R82: First 64-Bit Real Time Processor
anandtech.com
anandtech.com
>A real-time processor doesn't intrinsically process any differently from a normal applications processor. What differentiates it is that it bounds latencies and behaves deterministically. For example, rather than an interrupt latency on applications CPU taking anywhere from 50-1,000 cycles (or more) the interrupt latency can be bounded to under 40-cycles.
>Tightly Coupled Memories allow certain routines and data to be stored within the CPU so there's never any chance that a cache eviction has taken place which forces a fetch from DDR (or flash). In a phone or laptop, you don't have routines that absolutely must be accessed in 5-cycles and can't wait 250-cycles for DDR. If you're controlling an HDD you can't have the read head crashing off the spinning disk! Or, in automotive, the spark plug firing at the wrong.
>Latency and determinism can be very important!
>Not a R8 derivative.
I cant wait to see a SSD Controller with this tech.
I doubt this will improve SSD controllers, whilst this may have more granular control over the CPU cache. For example - if there was an SSD controller that this was drop-in compatible, I doubt there would be any measurable gains due to the NAND latency and that if your a little late, the NAND isn't going anywhere.
Spinning rust, now if you miss the rotation, you have to wait a full rotation. However, given rotation speeds, the processing has been fine as and the days of interleaving sectors to time the controller performance died out decades ago, so I'm not sure that example would see gains.
Remember that in these cases the code is kinda fixed and the only dynamic is streaming the data in or out and processing upon that data (encoding/decoding) - all fixed. So if the core/cache is fixed upon one task, the whole latency aspect is controlled and known. However, if you want a CPU to do many things, then this level of cache control and interrupt handling would be more important, so then you need an RTOS.
Though I'm sure many a dB would love the ability to run code directly upon the drive controller - then with RTX30 opening up direct drive interfacing over the bus and circumnavigating the CPU[EDIT]- then again, this may well have some advantages.
[EDIT ADD] Easier access to large ram caches seems to be the real gain, so for spinning rust HD's, that becomes a mixed blessing as would ideally want some capacitors to make sure that memory buffer is written in case of a power failure - so more memory buffer, large capacitors to make sure enough power to flush that buffer to the spinning rust. So be interesting how that pans out.
Not sure I understand your angle, because as I understand things the lags and stalls experienced on (usually older) SSDs stem from the controller either having to re-read a page many times over to reconstruct it or for the controller to have to perform housekeeping RFN because some buffer is full. To that end, because of the virtually addressed nature of SSDs with the "page tables" (if you will) being stored on the SSD as well you run into similar issues as kernels do under memory pressure, causing thrashing.
Edit: Well looking into it a bit, a lot of SSDs already use realtime ARM processors in their controllers. The main benefit here seems to be being able to address larger buffer sizes going forward and access to more cores.
The real demand for a core like this in SSD controllers comes from doing more computationally expensive work on the SSD controller than just providing a block storage device abstraction. Stuff like embedding a full key-value database on the SSD or providing more general-purpose compute capability is a hot topic for enterprise storage. There's already at least one company shipping an SSD controller for computational storage with a mix of realtime cores and Cortex-A53 cores. The Cortex-R82 means such a chip could be more homogeneous with just one type of ARM core.
> With approximately 85% market share of storage processors, this is an important market for Arm.
https://www.forbes.com/sites/tiriasresearch/2020/09/03/arm-c...
Not sure what that means in practice though, this is out of my scope.
I don’t know anything about CPU design. Am I wrong to read this line and be worried about memory access vulnerabilities like have been found with Intel CPUs?
Well, there are very tight timing in the cellular communication stack of a phone, probably more so than in automotive (though consequences of messing up may be less severe). These are usually offloaded to ASICs, though, but still, plenty of tight real-time deadlines in a phone.
Sources of CPU-level trouble include 1) rarely used CPU instructions that run slow microcode, 2) cases where the pipeline needs a total flush and that's slow, 3) the board manufacturer doing something in system management mode and not telling you. Drivers locking out interrupts too long is the usual Linux problem. It's assumed that all real time code is locked in memory; you do not page real time processes.
A task would usually be considered realtime to some degree if it cannot automatically get its work done on time even when competing with a background-priority long-running job—for example, if your deadlines are operating on similar or smaller timescales to the operating system's CPU scheduler. Then you need to start taking extra measures to ensure adequate responsiveness, not just adequate throughput.
But there's also the aspect of consequences of missing a deadline. Most realtime tasks are concerned with millisecond or shorter timescales, but a job that must be performed once every 108 minutes to prevent the end of the world would also be reasonably considered a realtime task.
At least wrt soft realtime scheduling for audio, I think users/programmers tend to get severely tripped up because the latencies are simply too small for them to make a clear mental model of the underlying system. That, along with their ineluctable desire for their code to "go faster" drives them to request features or design algorithms which would have to travel "back to the future" in order to work at all.
So it would be nice to decouple "ultra-low latency" from "realtime" to make it clear that, say, you can't put the heart on ice after the helicopter already lifted off to fly it to the hospital.
i.e. A spacecraft that requires a thruster to be fired with accuracy of a few hundred milliseconds in two years time has mission/safety critical timing requirements. Therefore this is hard-real-time
Alternatively, a payroll that has to run at the end of every month will not cause people to miss payments if that deadline is missed by any relatively large amount of time (minutes/hours). The timing requirements are not mission critical at this point. They could be considered soft-realtime tho as there is still an upper bound to desired behaviour.
To me, realtime means "responds faster than the fastest it needs to in order to control a feedback loop" which is super subjective since different system dynamics are so different.
When I tried to use RTOS it appeared to be that better than 1ms resolution was not remotely possible. Just hardcoding the interrupts resulted in 1us resolution easily.
I grant that the RTOS provides a scheduler, but when this chip says that it is intended for "realtime" does it mean that it's microsecond fast even when running RTOS, that it's capable of running fast with handwritten interrupts and code (which to me seems to be most things), or just that it has a spec for an upper bound on op timing?
I guess the last is important for correctness proofs but the prior two are how I interpret it as a confused person reading marketing materials put out by conflicting sources.
Stuff like branch prediction probably isn't too useful to implement as a switchable feature. Instead, the core is designed so that mispredict latency is still reasonably short (short pipeline, in-order execution or OoO with a short reorder window). This means you won't get as much benefit from speculative work as you would on a desktop-class core, but you're probably not going to be as vulnerable to Spectre-style attacks, either.
So, there is a spectrum of realtime and how "hard" it needs to be. There are a lot of cases where simply having a real time OS on a traditional processor is fine as long as everything can be sufficiently bounded.
I've only worked with one RTOS, and a lightweight one at that.
The scheduler would run every time an interrupt handler finished running.
One such interrupt was the 'systick' - you can choose if you want it to run every 1ms, or 100us, or a different rate (depending on how fast your CPU is)
The systick was how you timed anything you didn't want to use a dedicated hardware timer for. If you want to wait 10ms and your systick happened every 1ms, you waited until the 10th systick.
If you want to time something with finer resolution than 1ms, you either made your systick faster, or used a hardware timer with the interrupt triggering the scheduler.
> Just hardcoding the interrupts resulted in 1us resolution easily.
If your CPU runs at 180MHz, 1us is enough time for 180 clock cycles. Plenty of time to run one reasonably carefully coded interrupt handler, not much time to run 10 interrupt handlers.
As you can imagine, running your systick at 1us with that clock rate would be challenging!
I would say there are two (2) sets of realtime definitions.
1) concerning amount of events
Hard realtime system always produces output to an input in predefined time (subject to clocking). This time can vary between different inputs, but is fixed for a given input.
Soft realtime systems are bound - output time is bounded to some number.
2) concerning number of inputs
Hard realtime system has bound reaction time to every possible input
Soft realtime system has bound reaction time to "critical" inputs.
---
Definitions used in practice mix the two in some ways. The most prevalent definition I happen to come across in the general internet is something like "realtime system has bounded, low-variation reaction time to critical inputs".
Specifically with the R-family ARM chips, there is support for things like tightly-coupled memory (https://developer.arm.com/documentation/ddi0338/g/level-one-...) to provide latency guarantees for real-time code, deterministic interrupts, that kind of thing.
Real-time systems show up especially in industrial control and safety systems. For example, take a logging harvester, which cuts down trees and strips their branches and bark. It has a control panel for moving incredibly violent, dangerous machinery. It is truly critical that you can guarantee that, for example, sensors which detect a problem can abort something within a very tight latency budget.
I think you are missing something here.
Real Time systems aren't designed for high performance at all and instead they are designed for predictability.
You aren't aiming to "hit your metric", you are aiming to never, even go below it.
This is useful for something like old-style spinning hard drives where you had to calculate where to move the head of the disk within the time of the rotation. You have a instructions/second budget, and you know it will execute that.
On non-realtime hardware (and software) you know how many instructions/second it can do, but things like speculative execution of caching strategies or non-RTOS mean those instructions are not guaranteed at all.
It's pretty rare in software for it to define minimum performance. There's good reasons for this - software is interacting with intrinsicly messy things (like humans) and so performance outliers are a big factor.
It's pretty common in software for the worse case to be 10x the "hit your metric" case, and this isn't viewed as bad: the worst case happens rarely enough for the trade off to be worth it.
I am coming from the hardware world, through raw assembly, to C so my path is very much the assumption that if the microcontroller is going to control a feedback loop that stabilizes at 10MHz it will be guaranteed to do so.
But I suppose that I actually do that by overspecifying things nowadays since it's much too unpredictable as you say to predict how long things will take.
To me if you say you sample at 100kHz you sample at a minimum of 100kHz. Very very good to know that if I work with a firmware engineer that they won't hear the same thing as I mean if I say that it needs to hit a 100kHz sampling rate.
It would be very disappointing if they wrote a loop designed to average a 100kHz sampling rate with random jitter... (kidding mostly, I'd assume they would at least not do that).
That value doesn't have to be anything in particular. Could be 1ms. Could be 100ms. Could be a year. It just has to exist and be documented, and never, ever be exceeded by whatever operations are covered by its guarantee.
Generally, hard realtime means missing a deadline in unacceptable, but does not necessarily imply that latency is exactly fixed—just bounded. Soft realtime means that the consequences of missing a deadline are less severe, so the system may allow for some missed deadlines: eg. dropped packets for a video conference or delayed frames for a video game are noticeable especially if they become common, but they don't crash the whole system and the system remains useful even after missing a deadline.
There's no such requirement.
All hard realtime needs is the guarantee that the value will never be exceeded.
I'm no expert on SDR, but it seems to me that SDRs are the high bandwidth and parallel workloads where GPUs excel in. (GPUs can perform fourier transforms very efficiently)
The only possible qualm would be the latency of a GPU. But I don't imagine that SDR workloads are very latency sensitive? Or am I mistaken there?
GPU kernels are just software, but the parallel nature of GPUs means that it's better if most of the GPU is sharing the same code (very small L1 code cache per thread). So it's far more flexible than a FPGA but somewhat less flexible than a CPU (where different cores and threads can be executing very different code with large and unique L1 caches)
Latency is an interesting thing, its always part of the SDR pipeline since you have filter delays and processing delays. Most digital streams are uni-directional so you get the bits out, just shifted by 'x' nS. Since the 'x' is deterministic you can plan for it.
This design pattern is a common of nearly all SDR frameworks (Gnuradio, Redhawk, Pothos, Etc.) The "interconnect" between processing elements is typically shared memory, and that is why it lends itself to GPU work as well.
That said, since my head is most comfortable thinking in C, I tend to write stuff in C rather than Python :-).
https://www.ericsson.com/en/blog/2020/4/hardware-acceleratio...
I don't know if this involves baseband processing or just protocols and tighter coupling of applications to the network to reduce overall latency.
This effort is certainly driving a reduction in jitter which is currently an issue with many realtime GPU applications.
I see that it's better than a custom FPGA, but a normal 32bit rt cpu with half the memory pressure and pointer size looks much better to me.
I do know you can make user hardware "appear" as memory to the main CPU.
https://www.microsemi.com/existing-parts/parts/152514
https://www.crowdsupply.com/microchip/polarfire-soc-icicle-k...
C’mon anandtech, you can do better than this: “real time” means deterministic, not necessarily faster, and in fact often means slower.
As another poster pointed out, ARM’s VP of Tech posted a comment and posted what real-time means. I don’t know why people jump from that to some idea it would be faster.
That's interesting, but they seem to be removing most of the differences between the A and R series.
[1] https://developer.arm.com/ip-products/processors/cortex-r/co...
I haven't used it, but depending on latency and complexity of updating the MPU config, one could dynamically program it to have an arbitrary levels of protection, think hardware range checks at language level array access.
[1] https://static.docs.arm.com/100699/0100/armv8m_architecture_...
However for this presentation I'm a bit puzzled by some of the marketing slides:
- Optional NEON accelerates ML.
- Advanced machine learning support
Is that really a use-case for those processors? Can ML be hard-realtime anyway? I feel like a promotion that one could use those SIMD instructions for e.g. erasure-coding on storage use-cases or e.g. for signal processing on Telco/Audio/Video use-cases would be much closer to typical applications for such a CPU.
Is it just me or sounds the "ML" on these slides more like "we need to join the hype" than an actual use-case?
- Optional MMU enables Linux and cloud-native software development
I agree - MMU is great, Linux support too. But what is cloud-native again? And is something that runs on a SSD controller in a datacenter now cloud native?
Sure, why not? The number of instructions needed to run inference on a given neural network is known so I don't see any real issues here.
(Training is of course a different matter)
> Is it just me or sounds the "ML" on these slides more like "we need to join the hype" than an actual use-case?
You could build query-by-example indexes (for text, sound, images or videos) in the storage hardware with this kind of capability. That'd be pretty interesting.
Imagine something like Isilon, but instead of allowing Hadoop analytics on the storage hardware it could do approximate nearest neighbour across images.
(This is actually a pretty good idea...)
I've seen demos of this kind of thing from companies like NGD Systems, who use Cortex A53s in addition to realtime cores in their SSD controller. Part of the selling point for offloading this from the CPU is that code running on the SSD controller has much faster access to the dataset and can query it more efficiently, unconstrained by the drive's host interface.
There are also more mundane use cases for ML inside a SSD as heuristics to predict data access patterns or media wearout trends, which can influence how the SSD chooses to store data and tackle error correction.
Back in mainframe days, "channel controllers", the subsystems that controlled storage devices, were very programmable. At some points in time, it made sense to off-load as much as possible from the CPU onto the channel controller. At other points in time, the reverse was true.
For a couple of decades, we've had dumb storage devices. Now with some of the NVMe stuff, we're moving back towards smart "storage".
Linux in an SSD is the same idea.
https://www.manualslib.com/manual/96635/Lsi-Symbios-Sym8953u...
This has continued on raid/fibre/nvmeof/etc boards.
I feel I must be missing something critical in my understanding. I thought RTOS in software was sufficient to get realtime processing.
If an interrupt can usually be processed in 50 cycles but very rarely will take 500, the RTOS can’t schedule for the 50 cycles. If the real time cpu guarantees 200 cycles, the RTOS can actually schedule with that. Depending on the application, that can make a huge difference.
(somebody correct me if this is wrong)
What's the hardware difference required to support real time? Is it some dedicated parts of compute to support the queueing / prioritization of jobs? And some additional ability to have the "master" must-always-work part be able to interrupt or reset "optional" processes?
Specifically, in many architectures interrupt handling code must be able to yield _very_ quickly in order to continue receiving interrupts (or use reentrant interrupts which are a whole other mess) and even a cache look up, which might fail and have to wait for DDR ram for hundreds or thousands of cycles, makes the system unable to guarantee that it will do what it needs to do in time, like respond to some safety shutoff switch.
I think one of the things ARM did here is make a way for interrupt handling code to stay in cache permanently along with some other determinism guarantees.
A realtime OS won't do much preemption, probably would rather stick to cooperative scheduling.
On the hardware side, explicit cache controls are big in realtime chips. Your programmers know exactly which data is in cache and what isn't, and therefore can accurately plan how long tasks take.
The MMU traditionally wasn't realtime. I wonder how they managed to get realtime controls with virtual memory. (They must have some kind of guarantee on TLB lookups or something)
I've seen realtime OSes that were very preemptive, at least between priorities. Tasks/processes had priorities, and a higher-priority task that became active would preempt anything lower-priority that was running. vxWorks ran this way, IIRC, and it wasn't alone.
https://www.oracle.com/technical-resources/articles/javase/J...
Asking because a minimum time could prevent some kinds of timing attacks.
I wonder what's so special about this processor that makes it better than dozens of other hardware platforms (both microprocessors and microcontrollers) on which embedded RTOSes are running and doing just fine.
Also if you have a 64-bit processor, but no 64-bit RTOS, you don't have much.
[0] https://en.wikipedia.org/wiki/Comparison_of_real-time_operat...