1 / 13

Salvador Petit, Noel Tomás Computer Engineering Department Faculty of Computer Science

An Execution-Driven Simulation Tool for Teaching Cache Memories in Introductory Computer Organization Courses. Julio Sahuquillo , and Ana Pont Computer Engineering Department Technical School of Applied Computer Science Polytechnic University of Valencia jsahuqui, apont@disca.upv.es.

ping
Download Presentation

Salvador Petit, Noel Tomás Computer Engineering Department Faculty of Computer Science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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. Cachememories • Identified as core topic in the Computer Organization/Architecture area of knowledgeby 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. Tools used in the Academia • Academia tools • Different purposes: research, teach • Different complexity • Different simulators: trace and execution driven

  5. Tools used in the Academia • Trace driven • Widely used in undergraduate courses because of simplicity • Trace • < memory operation > < address> • Read 4 0 C 0 4 8 • Read 4 0 C 0 4 C • … • Use • Mapping functions • Example: • Useless • Spatial locality, temporal locality, … • 4 0 C 0 4 8 tag set offset

  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 startingin a given memory address - The cache has a given geometry: size, ways, line size - Auxiliary variables in registers

  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. 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. 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. Exercise example • Mapping functions solution must be firstly solved using paper and pencil

  11. More exercises • This academic year a lab session covering more exercises,like temporal locality and strides has beenperformed • Temporal locality • Strides

  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. Thank you very much for your attention

More Related