We split Quark. The microarchitecture of the new Intel processor



    Quark is a fundamental, that is, a structureless elementary particle, introduced into the theory in 1964, which until now has not been described as composite. Intel Quark is the processor for the Internet of Things, released by Intel since the fall of 2013, but so far without a public description of its internal structure and perceived outside of Intel as a “black box”. “What do you call a yacht, will it sail?” But I do not believe in it. Rather, as you call a yacht, it will call you (if it has an on-board computer). In general, in this post I will correct the situation and tell you how Quark works.


    Modern History - Quark.

    So, in September 2013, Intel announced the new Intel Quark processor, designed for the Internet of Things, as well as for a variety of wearable equipment and household devices. Quark is really a microprocessor (from the Greek "micro" = small), with a size of about 1/5 of the Atom (that is, Intel Atom, of course), and 10 times less power consumption. At that time, these were the only known technical details about Quark - there are not many of them, as is usually the case with announcements of this level. But the interest in this processor is quite rather big. Here, for example, an independent post with the announcement and the corresponding reaction of readers to habrahabr.ru.

    A month after the announcement on sale, the first representative of the Quark family - Quark SoC X1000 - is the foundation of the first Arduino-compatible microcomputer on the Intel platform - Galileo . Then there is more information about Quark. Quark X1000 SoC is a single-core 32-bit processor with a frequency of up to 400 MHz, made using 32 nm technology and having an architecture compatible with the Pentium instruction set (Pentium Instruction Set Architecture). The full specifications of the Quark X1000 SoC on Intel ARK add a few technical details to this description: 16 Kb cache, lack of Hyperthreading, maximum speed of data exchange with memory 1.6 GB / s, ...., but the main question of the internal device Quark CPU remains open.

    And finally, in January 2014, Intel introduced a computer code-named Edison, an SD card-sized device running Linux OS with built-in WiFi and Bluetooth. It is easy to guess that Edison is also based on the processor of the Quark family, but NOT on the Quark SoC X1000, but on another, dual-core, the release of which using 22 nm technology will begin in the summer of 2014. Journalists who attended the Edison presentation mention the words “Pentium class computer” "But what exactly is meant? - classes, you understand, are different.


    Ancient History - Pentium

    Pentium appeared in 1993 and was named so because it was the fifth generation of IA32. It was the first superscalar, that is, implementing internal parallelism at the instruction level, microarchitecture.
    As you can see in the diagram below, Pentium includes 2 pipelines (Pipeline) for processing integer data - “U” and “V” and, accordingly, two ALUs (arithmetic-logic execution unit for integers), separate data caches (Data Cache) and instructions (Code Cache) and branch prediction unit (Branch Target Buffer):

    Vector instructions are not yet in this version, they will appear later in Pentim MMX.

    But, compared to 486, Pentium has added several new instructions, the most famous of which are CPUID(CPU IDentification), which allows you to get information about the features of this CPU, and RDTSC (ReaD Time Stamp Counter), which returns the number of ticks from the moment the processor was turned on and is used to measure performance. Agree that the instructions are so useful that they seem to have always existed. By the way, CPUID after the Pentium debut was added to a special model i486 (SL-Enhanced 486), released immediately after Pentium. True, an interesting twist?

    Quark What's inside?

    Now back to the present - to Intel Quark. His connection with the Pentium is underlined by the Intel astronaut included with Galileo (perhaps not in all stores), similar to his colleague who worked in Pentium advertising at the end of the last century. Moreover, to a colleague - this is clearly not the same character, the differences are visible not only in the modern Intel logo on his spacesuit, but in the whole figure.

    Also Quark. This is by no means an overclocked and reduced Pentium manufactured using the latest technology .
    What is this? For a complete answer to this question, you need to study two publicly available documents, which are a simple search for the keywords " intel quark reference manual ":
    Intel Quark SoC X1000 Core Developer's Manual, 311 pages of
    Intel Quark SoC X1000 Core Hardware Reference Manual related information, 143 pages of helpful information.

    But of all this wealth, we are interested in the main thing - the Quark core device. Here it is, in the diagram from the second manual:



    As you can see, this is noticeably different from the above diagram of the Pentium device, and not only because the picture is not colored.
    The main differences:
    • the only ALU, respectively, is the absence of two pipelines “U” and “V”, that is, NOT the superscalarity of Quark.
    • complete absence of branch prediction mechanism
    • A common first level cache for data and code.

    To help the cache, the bus interface unit has a temporary buffer that can store up to 4 32-bit records, allowing many internal operations to continue without waiting for the recording to finish on the processor bus ...

    At the same time, we note that pipelining in Quark is present . Pipeline consists of five stages - sampling, two stages of decoding, execution and recording of data in registers. Each stage takes one processor cycle. But I repeat once again - this is not a superscalar, although in the comments on the excellent post about Quark by my colleague vtsymbal you can find a heated debate on this topic.

    Now let's look at another old circuit - the Intel 80486 processor device:

    True, similar to Quark? As they say, find 10 differences. Or at least two.

    Although, in fact, their minimum is an order of magnitude larger, and they should not be sought on this scheme. Quark is not an i486 ! As mentioned above, Quark is compatible with Pentium ISA, that is, it supports all new Pentium instructions, and, moreover, a number of new instructions that appeared in processors less than five years ago and are related to ensuring system security - an archival thing in modern conditions and support for modern OS. This is Supervisor Mode Execution Protection (SMEP), as well as PAE (Physical Address Extension), which allows 32-bit processors to use more than 4 GB of physical memory and is a condition for the NX (No-Execute) functionality also supported by Quark.
    In addition, Quark supports JTAG debugging and is a synthesizable CPU, that is, it allows third-party manufacturers to add their blocks to the Quark core.

    So why isn't Quark based on the more sophisticated and advanced Pentium microarchitecture? The most reasonable assumption is for reasons of reducing power consumption and sufficient architecture for simpler CPUs for the intended applications.

    But even with a sufficient theoretical speed, as experience shows, in practice optimization is often required. By the way, you may also need it personally - Intel plans to launch a contest of application developers for Quark-based systems with a prize pool of more than a million dollars in the near future! And understanding the internal device of Quark can help improve application performance - when compiling under Quark, you should use a set of options like this -march = pentium -mtune = i486, that is, a set of Pentium instructions, and their execution is for i486.
    Verily, the new is the well-forgotten old. Or, as in this case, not even forgotten, but simply good old.

    Also popular now: