English / 日本語
← Back to the Fundamentals home Chapter 7: Part 3 · Assemble only what you need

Chapter 7 What “combining modules” really means

The aim of this chapter. Part 3’s theme is “only as much as you need.” At its entrance, we first split the word “module” into two. ① the ISA vocabulary (the contract side: RV32I + extensions), and ② the hardware parts (the machine side: ALU, FPU, etc.). These two are separate things. And — add vocabulary, and you need the parts to execute it. So if you choose “only the vocabulary you need,” you can build a small chip with “only the parts you need.” This is what “combining” really is.

7.1 There are two kinds of “module”

When we say “combine modules,” we actually tend to confuse two things of different character. First, let’s split them here.

The preface’s “contract and machine are separate” works, as is, here too. Vocabulary is the contract, parts are the machine. Don’t mix them; first, think separately.

7.2 ① The ISA vocabulary — one base + any number of extensions

The vocabulary side is assembled with “one base + any number of extensions.” The base is RV32I / RV64I (always one). The extensions are M (multiply), A (atomic), F/D (fractions), C (compressed)… (as many as needed). Line up what you’ve added and name it like RV32IMC — the name is, as is, the vocabulary list. (The contents of each extension, one by one, we catalog in the next Chapter 8.)

7.3 ② The hardware parts — the metal that corresponds to the vocabulary

This is the crux of this chapter. Add one vocabulary, and you need a part to execute it. Add the multiply vocabulary (M) → you need a multiplier. Add the fraction vocabulary (F/D) → you need an FPU. Basic integer (I) → the ALU. The vocabulary (contract) and the parts (machine) correspond.

The ISA vocabulary and the hardware parts correspond Basic integer I corresponds to the ALU, multiply M to the multiplier, atomic A to a memory mechanism, fractions F/D to the FPU, compressed C to a decoder refinement. Add vocabulary, need parts. ISA vocabulary (contract) Hardware parts (machine) I (basic integer) ALU +M (multiply/divide) multiplier · divider +A (atomic) memory mechanism +F·D (fractions) FPU (floating point) +C (compressed) decoder refinement Add vocabulary (contract), and the matching part (machine) is needed.
Add one ISA vocabulary (left), and you need the hardware part (right) that executes it. Don’t load vocabulary you don’t need, and you don’t need the matching part — so it can be small, and low-power.

7.4 So, “only as much as you need”

Once this correspondence is clear, the meaning of “only as much as you need” becomes plain. Don’t load vocabulary you don’t need, and you don’t need the matching part = small, low-power (Chapter 6). Conversely, add only the vocabulary with no part, and that instruction won’t (as is) run. Match vocabulary and parts, no more, no less — this is what “choosing and assembling” your own chip means.

The designer decides here. What: which vocabulary (extensions) to choose, and to load the parts to match. How to decide: from the computations the use needs, choose the vocabulary (if you don’t use fractions, don’t include F/D = don’t carry an FPU). Why: each vocabulary adds one part, eating area and power. Only the vocabulary you need = only the parts you need = small, low-power. This makes Chapter 6’s “small and simple” concrete.

7.5 Summary

Which decision is this knowledge for. Once you know that “vocabulary (contract) and parts (machine) correspond,” then when you choose the “equipment” of the instruction set for your own chip, you can foresee, behind it, what parts increase (= area, power). This is the very region of “Extensions” on the preface’s “decisions map.” In the next Chapter 8, we look at that vocabulary’s extensions one by one — for what, what parts they need, and when to choose them.