Since that brief aside on terminology is out of the way, let us continue with the kitchen analogy.
For the Intel® Xeon Phi™ family of products, and indeed for any processor, one of its cores is like a kitchen. The components of the processor pipeline (ALU, Instruction Decoder, Memory Cluster, etc) are the different pieces of cooking equipment in the kitchen (range, oven, food processors, etc). The sequence of instructions being executed, i.e. the program, is the recipe. And the actual execution of those instructions is done by the CPU, or, to say it more succinctly, the micro-architecture’s electronics performing each instruction in the executing thread. (I will refer to the micro-architecture’s electronics as the uArchitecture for short.) See Figure KITCHEN.
Figure KITCHEN. The common kitchen. |
The pantry is the computer’s memory, its contents (broth, dried noodles, flour, sugar, etc) are the data used by the computer (variables, data structures, etc). A pantry is generally in a separate room, adjacent to but not in the kitchen. Likewise, the computer’s primary memory is generally outside of the processor but connected via a fast bus. By the way, I am assuming the refrigerator and freezer are also in the pantry. For a summary, see Table COMPARE.
THE COMPUTER SYSTEM | THE KITCHEN |
Core / pipeline / cache | The kitchen |
Execution engine/micro-architecture | The chef |
The program | Recipe |
An instruction | Recipe step |
Cache | Working space (e.g. a counter top) |
Memory | Pantry |
Result of the program | |
Table COMPARE. The parts of a kitchen compared to the components of a computer. |
The counter top and other preparation surfaces of our kitchen are the computer’s cache. When preparing a meal, the chef places frequently used ingredients on the surfaces, such as salt and flour, as well as frequently used utensils and containers (spoons, knives, pots and pans). Similarly, the processor will place frequently used data into its data-cache, and frequently executed instructions into its instruction cache.
The recipe the chef is using is the computer program. The recipe tells the chef step by step, what ingredients he needs (salt, flour, cheese, etc), and what he needs to do with them (mix, bake, sauté, etc). The program tells the computer what data (numbers, images, etc.) it needs and how it should process that data (add them together, sort them, etc). See Table RECIPE.
To belabor the point, let us briefly trace the preparation of a recipe (i.e., the execution of our program) through our kitchen.
Scenario: Our gourmet home chef has found a positively wonderful recipe, and he proceeds to create an exotic and tasty dish for a good friend: pizza.
Kitchen | Computer |
Chef removes the cook book from the shelf, opens it up, and finds the pizza recipe of his dreams. | The operating system loads a program and starts executing the PZZAH.EXE application found under the GOURMET directory. |
Going to the pantry, the chef gathers up the different ingredients he needs to create the mystic pizza. He cannot gather all the ingredients as he has limited counter space so he instead gathers the ingredients he needs immediately. | The computer, following the instructions in the program PZZAH.EXE, fetches from memory the data FLOUR, SALT, SUGAR, OIL and YEAST. As it executes the program, the uArchitecture places data and instructions that the program uses frequently in the data and instruction caches, respectively. |
The chef places flour, salt, sugar, oil and yeast in a bowl, mixes thoroughly, and then kneads | The computer executes instructions from the subroutines, MIX() and KNEAD(). Since FLOUR and SALT are used often, the uArchitecture places them in cache for fast access. It also uses MIX() often and so, places the code into the instruction cache. |
The chef seasons the dough and rolls it out, and places it onto a pizza pie sheet. | The computer continues to execute instructions, including ROLLOUT() and PLACE-IN-PIZZH-PIE-SHEET() subroutines. It continues to fetch data that it needs from memory, such as THYME and GARLIC. |
Going back to the pantry, the chef gathers vegetables, meats, cheeses, herbs and spices, and carries them over to his preparation area, placing no longer needed ingredients back into the pantry. | The uArchtecture accesses memory for a variety of new data, including TOMATOES, PEPPERONI, MOZZARELLA and OREGANO. Data that is no longer needed often is moved back into memory, making room in the cache for new frequently used data. |
The chef sautés vegetables, meat, cheeses, his secret blend of fresh herbs and spices, and then layers it on top of the pizza dough. | The computer fetches the data MEAT, CHEESES, HERBS and SPICES, and executes subroutines BLEND(), SAUTÉ() and LAYER(). |
Layering exotic cheeses along with his mystery pizza sauce, he places the pizza in the oven for 20 minutes until golden brown. | The computer fetches EXOTIC-CHEEESES and SECRET-SAUCE, and executes subroutines LAYER() and COOK(). |
He removes the pizza from the oven and, voilà! He has gourmet pizza perfection. | The computer stores the result into the PERFECTION memory location, and completes the execution of the PZZAH.EXE program. |
The chef cleans up countertops, putting unused food stuff back into the pantry, and washes and returns pots, pans and dishes to the shelves and cabinets where they are stored | The computer completes executing PZZAH.EXE, and starts executing an OS subroutine that releases memory, resets execution tables, and does other clean up in preparation for the next program. |
Table RECIPE. Making gourmet pizza in the common computer. |
AN ASIDE FOR OUR COMPUTER PROGRAMMING CHEFS
I have taken some liberties with mapping the kitchen to a computer. This is mostly because I have not built up the knowledge base of many of the readers, and partly because digging in too far requires too much explanation.
An example of this is defining the computer part that is analogous to our chef. What actually coordinates and drives forward the use of the pipeline to execute an instruction? Is it the microcode? Only partially as microcode is in part just the series of sub-instructions used to execute instructions. Is it some abstract unknown controlling and hidden master CPU executing the microcode? If so, then how does the controlling master CPU work? Is it a series of pulses created by the master oscillator and masked by what we think of as a microcode sub-instruction, and used to activate and deactivate digital circuits?
I will do my best to add an addendum to each blog looking more closely at the computer technology being discussed.