Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 An Execution-Driven Simulation Tool for Teaching Cache Memories in Introductory Computer Organization Courses Salvador Petit, Noel Tomás Computer Engineering.

Similar presentations


Presentation on theme: "1 An Execution-Driven Simulation Tool for Teaching Cache Memories in Introductory Computer Organization Courses Salvador Petit, Noel Tomás Computer Engineering."— Presentation transcript:

1 1 An Execution-Driven Simulation Tool for Teaching Cache Memories in Introductory Computer Organization Courses Salvador Petit, Noel Tomás Computer Engineering Department Faculty of Computer Science Polytechnic University of Valencia spetit@disca.upv.es, noetoar@eui.upv.es Julio Sahuquillo, and Ana Pont Computer Engineering Department Technical School of Applied Computer Science Polytechnic University of Valencia jsahuqui, apont@disca.upv.es

2 © Julio Sahuquillo WCAE-Boston-2006 -2- Outline Introduction and motivation –Cache memories –Tools used in the Academia –Classroom exercises –Goals of this work PCSpim-cache –Features –Exercise example –More exercises Conclusions

3 © Julio Sahuquillo WCAE-Boston-2006 -3- Cache memories Identified as core topic in the Computer Organization/Architecture area of knowledge by the joint IEEE Computer Society and ACM Computer Engineering Computer Organization courses –Basis of caches –How to find a block? –Replacement algorithms Computer Architecture courses –Advanced concepts –Victim caches –Coherence –Trace Cache

4 © Julio Sahuquillo WCAE-Boston-2006 -4- Tools used in the Academia Academia tools –Different purposes: research, teach –Different complexity –Different simulators: trace and execution driven

5 © Julio Sahuquillo WCAE-Boston-2006 -5- Tools used in the Academia Trace driven –Widely used in undergraduate courses because of simplicity –Trace Read 4 0 C 0 4 8 Read 4 0 C 0 4 C … –Use Mapping functions Example: –Useless Spatial locality, temporal locality, … tag set offset 4 0 C 0 4 8

6 © Julio Sahuquillo WCAE-Boston-2006 -6- Typical exercises at classrooms Code based exercises: –Valuable pedagogical help and widely used at classrooms This exercise illustrates spatial locality No tool for undergraduates dealing with this kind of exercises sum = 0; for (i=0; i<N; i++) sum = sum + A[i] - Array A is located starting in a given memory address - The cache has a given geometry: size, ways, line size - Auxiliary variables in registers

7 © Julio Sahuquillo WCAE-Boston-2006 -7- Goal of this work Main goal: a tool that provides support to perform code-based exercises, i.e., allowing the study of: –Temporal and spatial localities –Replacement algorithms –Write policies –… Target students –Computer Organization course How? –As an extension of PCSpim simulator, widely used, which runs MIPS32 assembly programs Why? –Because of familiarity –“Our” students are trained with this assembly language simulator

8 © Julio Sahuquillo WCAE-Boston-2006 -8- PCSpim-Cache Let us run PCspim-cache to ilustrate its features Cache extension –Enabled/disabled through Simulator – settings – cache simulation Cache configuration –Options: data cache, instruction cache, or both Cache settings –Allows to choose the cache geometry (size, ways and line size), write policy, and replacement algorithms

9 © Julio Sahuquillo WCAE-Boston-2006 -9- Exercise example Example: sum of the elements of an Array and mapping functions Students must obtain: –For a given cache, the sets in which Array_A and Array_B map to –Number of misses and classify them according to the three C’s

10 © Julio Sahuquillo WCAE-Boston-2006 -10- Exercise example Mapping functions solution must be firstly solved using paper and pencil

11 © Julio Sahuquillo WCAE-Boston-2006 -11- More exercises This academic year a lab session covering more exercises, like temporal locality and strides has been performed Temporal locality Strides

12 © Julio Sahuquillo WCAE-Boston-2006 -12- Conclusions Code based exercises are a valuable pedagogical help, but no tool exists to be used by undergraduates PCSpim-cache is a solution –Supports code based exercises performed at classrooms Spatial locality, temporal locality, strides, … Students can use PCSpim-cache to check their exercises Visualizes how processor-memory work as a whole –Has been used in a lab session, with a wide acceptance among students –Source code is publicly available at http://www.disca.upv.es/spetit/spim.htm An extension of this paper, covering a detailed lab with an assessment study, is going to be submitted to an educational journal

13 © Julio Sahuquillo WCAE-Boston-2006 -13- Thank you very much for your attention


Download ppt "1 An Execution-Driven Simulation Tool for Teaching Cache Memories in Introductory Computer Organization Courses Salvador Petit, Noel Tomás Computer Engineering."

Similar presentations


Ads by Google