English / 日本語
← Back to the Fundamentals home
Chapter 8: Part 3 · Assemble only what you need
Chapter 8 The extension catalog — what’s there, and what for
The aim of this chapter. In Chapter 7 we saw that “add vocabulary, and you need the matching part.” This chapter is the catalog of those extensions. We line up
I·M·A·F·D·C one by one, by what each is for / what parts you need when you load it / when to choose it. At the end we read RV32IMAC and get the feel of choosing a “menu” from the use.
8.1 The extension catalog — one by one
- I (basic integer · base). A minimal set: add/subtract, load/store, branch, and so on. This alone makes a proper CPU. The parts needed = the ALU and registers.
RV32I(32-bit) /RV64I(64-bit). The base for everything. - M (multiply · divide). Integer multiplication and division. With only
I, multiplication is substituted by repeated addition = slow. AddM, and it’s fast with dedicated instructions. The parts needed = a multiplier and divider (area and power increase). When: compute-heavy uses, signal processing, etc. - A (atomic). Instructions for multiple processes to read and write the same value safely, without being interrupted. Where needed = multicore, or when sharing values across the OS and interrupts. The mechanism needed = a refinement of memory access. When: loading an OS / multiple cores.
- F·D (floating point). Computation with fractions.
F= single precision (32-bit),D= double precision (64-bit). The part needed = an FPU (largish, eating a fair amount of area and power). When: scientific computing, graphics, audio, and so on, where fractions are needed. If you don’t need them, don’t load them (many embedded uses have no F/D). - C (compressed). Lets frequently-used instructions be expressed in a short form (16-bit) too. Code gets smaller = memory saved. The number of instruction fetches also drops, which helps low power too. The mechanism needed = a refinement of the decoder. When: small devices where code size matters.
8.2 Reading RV32IMAC
Once you know the extensions, the name of an instruction set reads, as is, as an “equipment list.” For example, RV32IMAC is —
RV32 = the 32-bit base, I = basic integer, M = multiply/divide, A = atomic, C = compressed. F/D not in the lineup = it holds no dedicated fraction instructions, and being without an FPU it is smaller by that much.8.3 Choosing a “menu” from the use
The more extensions you load, the more “high-function,” but that many more parts increase, eating area and power. So choose only what’s needed, from the use. It’s just like a meal’s menu. A few examples.
- A battery-run sensor node (small and low-power the top priority).
RV32IC— just the base plus compressed. If you need neither multiply nor fractions, don’t load them. - Signal-processing and other multiply-heavy uses.
RV32IMCorRV32IMAC— add the multiplier (M). - Loading an OS, a somewhat full-fledged use. On an
RV32IMACbase, if fractions are needed addF/D(a commonly-used set is also writtenG).
The designer decides here. What: choose only the extensions the use needs. How to decide: work backward from the content of the computation — do you use fractions? is there a lot of multiplication? do you load an OS? do you want to squeeze code size? Why: each extension adds a part, eating area and power. Only what’s needed = small, low-power. This is what deciding your own chip’s “menu” means.
Which decision is this knowledge for. The extension catalog is, as is, the list of options for “Extensions” on the preface’s “decisions map.” Once you know “what’s there, and what for,” you can assemble a “menu” from the use, no more and no less. In the next Chapter 9, we gather the judgment material up to here — core, extensions, memory, clock, verification — into a single “decisions sheet.”