[CS61C FA20] Lecture 27.4 - Caches IV: Actual CPUs — Transcript
Full transcript
- 0:00and welcome back this is it we're at the
- 0:03end this is the last lecture of the
- 0:05caches series i love this
- 0:08let's let's show some pictures of actual
- 0:10cpus
- 0:11let's see what it looks like so let's
- 0:14take a look the early power pc
- 0:17so this is a long time ago this is a
- 0:19couple generations ago
- 0:21we mentioned before that we have
- 0:23separate
- 0:24l1 caches for instructions of data
- 0:27partly because they come from different
- 0:29places of memory so why corrupt them so
- 0:31how big are they 32 kbytes of
- 0:35instructions is data okay and data for
- 0:37each instructional data
- 0:39i've got an external l2 cache interface
- 0:42and the integrated controller and cache
- 0:44tags so look at this
- 0:46this l2 cache tags just the tags for l2
- 0:51are here
- 0:52okay here's my data cache this is my l1
- 0:55data cache this is my l1 instruction
- 0:58cache that's the big one
- 1:00and what i've stored is i don't have l2
- 1:02on chip but i have the
- 1:04tags are on chip so i can do the tag
- 1:06comparison really fast
- 1:07but that's it by the way here are the
- 1:10tags for data there's the tags for my l1
- 1:12this is my tags for my l1 and these are
- 1:14my tags
- 1:15for my l1 instruction so each of these
- 1:18related to that guy
- 1:19this is the l2 cache tags um
- 1:22i've got different units here so we can
- 1:23talk about this i've got uh here's maybe
- 1:26here's a memory management unit to kind
- 1:27of coordinate all this we don't know
- 1:28about the tlb for now
- 1:30i've got a load store unit an energy
- 1:32unit and a floating point unit
- 1:33and that lets me in the best case we
- 1:36talked about this a little bit of
- 1:37pipelining
- 1:38super scalar means i can run parallel
- 1:40jobs so i can actually have
- 1:41three i could have a load store
- 1:44situation i can
- 1:44integer i'm doing some aou kind of thing
- 1:46i'm doing a floating point thing
- 1:48all at the same time that was pretty
- 1:50cool
- 1:51so here is six execution units allow for
- 1:54two integer
- 1:56and double precision and one double
- 1:58precision at exactly the same time in
- 1:59terms of my execution units
- 2:01that's it this is this is a single core
- 2:02this wasn't a multi-core machine back in
- 2:04the day
- 2:06pentium m this is again early here we go
- 2:09same kind of thing here's uh so a
- 2:11completely different company that was
- 2:13motorola this is intel
- 2:14here's my here's my 32 kb of
- 2:17instructional and data here
- 2:19and anything else i want to say oh look
- 2:21this is
- 2:23here is my l2 cache
- 2:26so not just well here's the tags for l2
- 2:29i put
- 2:29the ca i put this is on the chip l2 is
- 2:32on the chip this is
- 2:33l2 there's my l2 there okay here's my l1
- 2:37and there's my l1 i love this so that's
- 2:39pretty cool and now
- 2:41watch what happens as i get to the next
- 2:42level
- 2:45intel core i7 it's hard to get more
- 2:48recent than this
- 2:49i've got six cores here's six cores
- 2:52okay in that core
- 2:56i'm not showing you what
- 2:59the cache looks like but rarely
- 3:05i'm going to show you something
- 3:06interesting each core
- 3:08has an l2 on it
- 3:12and probably i actually don't know where
- 3:15it is i think it's
- 3:16usually what happens is you look for the
- 3:17things that look all the same see how
- 3:19this looks like it's all the same
- 3:20housing
- 3:21i don't have it in this document so i'm
- 3:24not i'm just going to guess
- 3:25that i'm looking at here as an area and
- 3:28here there's a big area i'm not sure
- 3:30this is we can take a look at this
- 3:31but this has l1
- 3:34and l2 per core we talked about we saw
- 3:37that number from when i did under
- 3:38the perimeter of that and here's what's
- 3:40fun
- 3:42i also have on chip this is on chip i
- 3:44also have
- 3:46a shared l3 across all cores
- 3:50so all cores share this l3 which is
- 3:53pretty neat
- 3:55in conclusion boy bringing it all
- 3:57together
- 3:59we have talked about caching we spent
- 4:01four lectures talking about caching
- 4:03in detail i mean this is remarkable and
- 4:05caching shows up
- 4:06as i mentioned before in one of my first
- 4:08lectures caching is a big deal
- 4:09caching's a big deal in computer science
- 4:11it's one of the big ideas that we've
- 4:12contributed to the space
- 4:13i don't know if caching it like has an
- 4:16example
- 4:17abstraction exists in engineering you
- 4:19know there's abstraction you hide the
- 4:20details of how you
- 4:21you know have a shuttle flight or
- 4:22something how you build a bridge
- 4:24abstraction is there
- 4:25i don't know if caching occurs in a
- 4:28non-computer engineering computer
- 4:30science context if there's an equivalent
- 4:32thing
- 4:32like that i certainly know that i have
- 4:34you know
- 4:35any kind of technology where i can make
- 4:37a simple copy of something that's there
- 4:38but if i don't make
- 4:39if it's a physical element i don't know
- 4:41if the cat if the idea of a cache
- 4:43and a memory hierarchy exists outside of
- 4:45a computer engineering computer science
- 4:46kind of idea
- 4:47but we certainly have software caches
- 4:49and caches except everywhere
- 4:50file system caches web page caches game
- 4:53databases table bases
- 4:55phone most recent calls all those things
- 4:57are caches
- 4:58software memorization software my
- 5:00goodness software memorization is a big
- 5:02idea is a cache in some sense
- 5:04as i'm walking through fibonacci uh why
- 5:07don't you just write it down as you're
- 5:08seeing it
- 5:09and so you're kind of caching it and now
- 5:10if i have i seen it recently yes i have
- 5:12i forget about the recently part but i
- 5:13haven't seen it before yes well grab it
- 5:14from my
- 5:15cache and my memoization storage same
- 5:18idea so that same idea is with caches
- 5:21and again the big idea is if something's
- 5:23expensive we want to do repeatedly do it
- 5:24once and catch the result
- 5:26so if i have this computation as being
- 5:27really heavy i don't care what it is
- 5:29do it once and remember what it is
- 5:31that's what it is that's the kind of big
- 5:32idea in kind of computing
- 5:33but it's also don't go to sacramento
- 5:35don't compute it and spend an hour
- 5:36computing it if i'm going to ask for it
- 5:38twice computer once remember it now i've
- 5:39got it for the second time especially if
- 5:41it's a function and only and the output
- 5:44is only a function of its inputs if it's
- 5:45somehow a function of all these other
- 5:46state elements i can't cache it because
- 5:47it might be different
- 5:48but if it's a pure function so i
- 5:50remember that for the next time um
- 5:52similarly if i have to go to sacramento
- 5:54why go to sacramento all the time
- 5:55bring it to some local space don't have
- 5:57to go to the book i mean imagine the
- 5:59world without caches that
- 6:01really like dumb and dumber level okay
- 6:04i'm gonna write a paper
- 6:05i go to the find it look at the thing i
- 6:07find the book i get it out i read one
- 6:09line of it okay great put it back
- 6:10hashtag my paper oh what else did they
- 6:12say i have to go get the book again are
- 6:14you kidding me that's like going to
- 6:15sacramento all the time
- 6:16put it on your table that's the cash so
- 6:18that library analogy introduced
- 6:20you know first or second lecture same
- 6:22idea here
- 6:23go grab it and have it in a local space
- 6:24so it's handy you can use it that's the
- 6:26idea
- 6:27a ton of knobs holy moly how many knobs
- 6:31you have
- 6:31how big is your cash overall what's your
- 6:34technology behind that
- 6:36what's your block size how wide is your
- 6:38cash what's your right pilot what's your
- 6:39aspect ratio
- 6:40once you have your cash is it is it why
- 6:42you know fat and thin
- 6:44is it short and fat or one big block
- 6:47size or is it really small block size
- 6:49and now it's really tall and skinny
- 6:51what's my right policy right through
- 6:52versus right back we talked about that
- 6:55what's my associativity what's my knob
- 6:57for my
- 6:58n my m is it one or is it n
- 7:01what's my block replacement policy we
- 7:03talked about a couple of policies
- 7:05do i have a second level cash do i have
- 7:07a third level oh my gosh i mean
- 7:09but all that for a cash designer is just
- 7:12more
- 7:13more freedom more flex more pens of an
- 7:16artist
- 7:16to draw whatever i want to be able to
- 7:18create what i want to optimize for
- 7:19whatever usage case i have
- 7:21and again there are software usage cases
- 7:22there hardware uses caches all these
- 7:24things are out there
- 7:24for a cache designer which again is not
- 7:26always a hardware designer could be a
- 7:27software designer thinking about what
- 7:28parameters for the cache that you want
- 7:31and again what's your metric you're
- 7:32trying to think about you have some
- 7:34metric as you're having all these knobs
- 7:35don't just
- 7:36randomly okay i'll randomly set it i'm
- 7:37good thanks so much where's the paycheck
- 7:39no you
- 7:39you go and you kind of try to run it on
- 7:41traces you run it on practice things you
- 7:42see
- 7:43if it's performing and you adjust you
- 7:44tweak maybe i'll change the block
- 7:45replacement policy
- 7:46maybe i'll make it more associative all
- 7:48those things are parameters that you can
- 7:49play all the things listed here
- 7:50are things you can play with as you're
- 7:52trying to adjust it for that ever work
- 7:53whatever tracers you could be running
- 7:54those are simulated traces may not be
- 7:56perfect but it'll be a
- 7:58show me the example kind of how i'm
- 7:59going to be hitting this cache in the
- 8:00future
- 8:01thinking about that and use that
- 8:02performance model to adjust between all
- 8:04those choices
- 8:05and also factor in your budget factor in
- 8:07your technology your budget
- 8:08what's there all of a sudden flash comes
- 8:10around how am i that factor
- 8:12that was really fun watching the
- 8:13computer engineering world as flash
- 8:15became really
- 8:15interesting where that fit in by the way
- 8:18your hard drive has a cache
- 8:20go look at your hard drive specs there's
- 8:21a cache on your hard drive
- 8:23because going to disk spinning disk is
- 8:25really slow so there'll be a cache on
- 8:27your
- 8:27hard drive caches are everywhere so
- 8:30think about what technology you have the
- 8:31space
- 8:32based on and think of your cost for your
- 8:34particular workload
- 8:35that's it thank you so much for coming
- 8:37to these cast lectures i really had a
- 8:38good time teaching them to you
- 8:39and we'll see at the next module take
- 8:41care folks
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 27.4 - Caches IV: Actual CPUs by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,794 words across 289 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.