Microprocessor Memory Systems -- CS 378h -- Announcement

Homepage: http://www.cs.utexas.edu/users/hunt/class/2026-spring/cs378h/cs378h.html

In this class, we will consider how microprocessor memory systems function. To do this, we will study microprocessor memory cache design and investigate a litany of programs that are designed to expose memory-system behavior. We will also attempt to expose the memory-translation caches as well. Time permitting, we will investigate multi-processor memory systems.

This class will be taught in an "inverted" style. That is, we will concentrate class time on examples, working through code, describing challenges, and exploring problems being faced by students. Thus, it is important that you bring your laptop to class. There will be lectures to introduce various topics, but primarily, we will use class time for problem solving, demonstrating how to use various tools, and exchanging information.

We will make use of (at least) the first five chapters (of Section 1) of the Understanding Software Dynamics by Richard L. Sites. It is recommended that student have access to this text as we will refer to it repeatedly during the early part of the semester. There is much more in this book that is worth study, but we will focus our attention on how to use microprocessor memory systems effectively.

We will sometimes refer to your CS429/CS439 textbook (Computer Systems, A Programmer's Perspective, 3rd Edition by Randal E. Bryant and David O'Hallaron, Prentice Hall). We may occasionally make reference to the 2nd edition of Hacker's Delight by Henry S. Warren, Jr. We will make use of other web-based material. Although not specifically referenced, a great source of interesting problems can be found on the the Hakmem website.

Tests and quizzes are open-book, open-notes affairs -- however, no electronic devices (laptops, cell phones, tablets, PDAs, calculators) of any kind are allowed during test and quiz events. As such, you may wish to have a physical copy of any materials that you believe will be helpful during quizzes and exams.

Remember, cell phones are not allowed at any time. During quizzes and exams the time remaining will be periodically announced.

This course expects students to program in C or C++. Knowledge of assembler will also be critical as it is the binary code that really determines what programs do -- and it is during binary execution that code will perform or fail.

It is recommended that you have access to "The C Programming Language", second edition, by Brian Kernighan and Dennis Ritchie, Prentice Hall Software Series. For examples and help with C-language use, you will find that there are many Web pages devoted to C-language programming. Why C, or its extension, C++? It is the language that is often used to implement core systems, such as FreeBSD, Linux, MacOS, Windows, as well as many user tools (e.g., wc, grep, ed, sed, gcc, emacs,...). Java programmers should have no problem with the subset of C (and C++) that we will use. Students may be introduced to some C-language library capabilities, such as referencing x86 processor-specific counters, that lie outside of the official C-language definition.

In some cases, it may be helpful to reference documentation about the x86 architecture; this documentation is available on the web. In some cases, students may be asked to read small sections from these documents. Note that these documents are quite large -- and these documents are indicative of the complexity of the x86 architecture and, in general, of modern computer memory systems. Other than Intel, only AMD develops and markets x86-compatible processors. Unfortunately, even though these manuals contains thousands of pages, the information contained in these documents is insufficient to develop a competitive x86 processor implementation. AMD offers their own set of manuals, which can be a place to look if the Intel documentation isn't sufficient. Note, there are many undocumented features (e.g., caching read-ahead strategies, I/O ordering behavior, virtualization, context-switch mechanisms, encryption-and-decryption instructions, etc.) that are necessary to make a x86 processor and it memory system to perform well on a litany of common benchmarks, and for a x86 processor to be competitive, it will need to contain these features. Although many x86 implementation mechanisms are protected by patents, anyone is now free to build their own 32-bit x86 implementation using Intel's IP as all of Intel's patents specific to the (32-bit x86) Pentium have expired. Even some of the early 64-bit x86 patents have also expired.

One might believe that RISC-oriented, Arm-compatible microprocessors are simpler than x86-based microprocessors, and thus, the Arm memory-system architecture is simpler than the x86 memory-system architecture. While the x86-ISA architecture specification is about 5000 pages, the Arm architecture specification about 15,000 pages! In addition, the Arm architecture has a weaker and more complex memory model than the x86 memory model. Unfortunately, the hardware offered by vendors that include Arm and x86-based products is very complex!

For the adventurous student, special projects are possible. The content of a special project is pretty flexible -- so long as it has to do with the course content. For instance, I am interested in the development of an ISA model of IBM's Harvest computer, which was a extension of IBM's Stretch computer. Another possible specification project might involve some older microprocessor, e.g., the Motorola 68030 or the National Semiconductor NS32032, including their memory-management mechanisms. Or, a student might wish to formally specify RISC-V or Arm architecture -- which is a LOT of work! Other independent study projects are possible; please discuss your ideas with the instructor.

The value you get from this class will be directly related to the effort you (as a student) put forward. This class will require that you work on your own, and this class may be less structured than many of the classes you have taken. For instance, I have taught CS429 many times, and when serving as an instructor for CS429, I lecture for many hours. In this class, there will be some lectures, but not nearly as many nor as long as is typical in CS429. The remainder of class time will be used to directly address problems and seek their solutions. If you have a laptop computer, you should bring it to class. In class, we will be doing some programming and discussing various issues, such as how the debugger or version control system functions. Eventually, all programming assignments must work on the CS Department Linux machines, but being able to use your own environment may speed your work and you may end up with more tools than when this class started. Having a laptop is not a requirement, but it will be very helpful for students to be able to individually access information during class, and when we are discussing programming issues it may be helpful for you to try things immediately.

To keep program timings consistent, all benchmark results submitted for homework assignments and projects must be performed on one of the UTCS gemstones machines. To get a list of these computers, execute cshosts gemstones at the prompt of a UTCS public Linux system. And, please report to the class if one of these machines has different performance characteristics from the others in the gemstones group of public Linux machines.

Students will be encouraged to give short (five- to ten-minutes) presentations in class on particular topics. When well done, these presentations can serve in place of a missed quiz or homework. In fact, any student may be called upon to give a two- or three-minute presentation on something being discussed in class or on their solution to a homework problem. Please come to class prepared to work; we will sometimes stop for a few minutes to make sure that everyone that has a chance to consolidate their thinking and to help students overcome problems with their understanding or with questions about the in-class presentations.

Our office hours are listed on the main class web-page. In addition, if you need help, you may certainly seek out and visit with the class TA(s) and/or the instructor(s). You may arrange to meet us at other times than those listed, but you will need to send E-mail to arrange a time. If we become too busy during the scheduled office hours, we will expand our office hours to meet the needs of the students. If you cannot come to the scheduled office hours due to conflicts with other classes, let us know quickly so we can make arrangements to meet your needs.

Class Schedule

The following gives an outline of what we will discuss. We are open to discussing other architecture topics of general interest, and we may include some of our own microprocessor design experience. The syllabus below is approximate; the exact rate at which we will cover the material will vary. Additional summary information about the class laboratories is available on the class laboratory and homework page.

  Schedule Below is Approximate, Lectures Dates May Change Slightly

  *** NOTE:  Exam dates are tentative until January 20, 2026    ***
  *** NOTE:  Quizzes will be given roughly every week randomly  ***
  *** NOTE:  Homework due dates are tentative until assigned    ***
  *** NOTE:  Laboratory due dates are tentative until assigned  ***

!!! Everything here needs to be updated.

  Week   Class    Date     Short Description

   0      00      Jan 13   Course Introduction
                           Course Procedures and UT-required disclosures
                           Sidebar: Getting your computing environment organized
                           Consider program "mystery0.cc"

   0      01      Jan 15   Measuring CPUs Performance (Chapter 2)


   1      02      Jan 20   In-class ALU operation measurement and experiments

   1      03      Jan 22   Presentation Memory-copy specification and project, Lab 0


   2      04      Jan 27   Measuring Memory Performance (Chapter 3)
                           Review microprocessor memory architecture

   2      05      Jan 29   Advanced memory-copy methods, Further Lab 0 discussion,
                           In-class Lab 0 on advanced memory-copy techniques


   3      06      Feb  3   In-class memory-performance experiments and measurement

   3      07      Feb  5   Measuring Memory Performance, continued, Lab 0 due


   4      08      Feb 10   CPU and Memory Interaction (Chapter 4)

   4      09      Feb 12   Review SSD and disk-drive architectures
                           Review Measurement issues (Chapters 1 - 5)


   5  *   10      Feb 17   Exam -- open notes, but no electronic devices

   5      11      Feb 19   Matrix transpose project


   6      12      Feb 24   Improved large-memory matrix transpose algorithms

   6      13      Feb 26   In-class Lab 1 on large-memory matrix transpose techniques


   7      14      Mar  3   Large-memory string search, summary of various
                           algorithms

   7      15      Mar  6   Measuring performance of search operations, Lab 2


   8      16      Mar 10   Array sort algorithms

   8      17      Mar 12   Large-memory array sort approaches, Lab 3

                  Mar 17   Spring Break

                  Mar 19   Spring Break


   9      18      Mar 24   Array-sort summary, Memory as a database

   9      19      Mar 26   Hashing,  Key-Value Data order, Query order


  10      20      Mar 31   In-class Lab 4 on using memory as a database

  10  *   21      Apr  2   Exam -- open notes, but no electronic devices


  11      22      Apr  7   Indirection chase

  11      23      Apr  9   Order of memory reads, Mersenne twister


  12      24      Apr 14   Jumping within and outside of a cache line

  12      25      Apr 16   In-class Lab 4 on memory indirection


  13      26      Apr 21   Memory system attributes, e.g., multi-processor

  13      27      Apr 23   In-class quiz worth two quiz grades,
                           Course Summary, Stump the Professor

                  Apr 24   Final Projects Due

Homework

There will be ten or so homework assignments given during the semester. On most weeks, homework will be assigned on Tuesdays and due nine days later (on Thursdays) by class time. No homework will be assigned the last week of class, but there may be a homework due the last week of class. The two lowest homework grades will be dropped in the computation of the final homework grade. Homework will not be accepted late.

Quizzes and Exams

There will be two, in-class (50- to 80-minute) examinations. The material on exams will be cumulative. See the above schedule (marked with a * above) for the dates. There will no final exam. There will be a number (six to nine) of unannounced "pop quizzes", and a quiz (worth double) on the last class. The lowest quiz grade will be dropped. Examinations must be taken at the scheduled times. Quizzes are offered at random times; each quiz will take 5 to 15 minutes.

Laboratory Projects

There will be several Laboratory Projects assigned. Once a laboratory due date has arrived, material addressed in that laboratory may appear on an exam. Laboratory assignments are important; performing the work necessary to complete the laboratories is the means by which you will solidify your understanding of the class material and the work that it takes to be a better programmer. Laboratory Projects may be turned in one week late, but no later than the last day of class. Late project submissions (up to 1 week) suffer a 20% reduction of the grade given for the content of the project.

For each laboratory, a lab report will be part of the requirement. So, it is important that you allot time and make a serious effort to provide the documentation required of each laboratory. Without documentation, we may not be able to understand what you have done -- and that will lower your grade.

The weighting of the grades for the various aspects of the course will be added before the semester begins.

     Component       Percentage of Course Grade
     Exam 1:           10%
     Exam 2:           10%
     Homework:         20%
     Labs:             40%  (see individual weighting just below)
     Quizzes:          20%
The Laboratory Projects will be weighted as follows:
     Laboratory      Percentage of Course Grade
     Lab 0:             5%
     Lab 1:             5%
     Lab 2:            10%
     Lab 3:            10%
     Lab 4:            10%
The grading for the entire course will be as follows:
    Course Score     Grade
     [90 -- 100]       A
     [87 --  90)       A-
     [85 --  87)       B+
     [80 --  85)       B
     [77 --  80)       B-
     [75 --  77)       C+
     [70 --  75)       C
     [67 --  70)       C-
     [65 --  67)       D+
     [60 --  65)       D
     [ 0 --  60)       F

Note the interval marks around the course-score column. For example, a course grade of B will be assigned if your semester grade is greater than or equal to 80 and less than 85. This also means that a course grade of at least 67 needs to be achieved for this course to count toward a UTCS degree.

The students that do well in this class are survivors. This class is a lot of work, and it is important to keep current. The material in this class is cumulative; it can be quite difficult to catch up if one falls behind. It is very important to keep turning in homework and laboratories. Generally, homework and laboratory grades are our most reliable indicator of how well a student will do in this class. Note, it is important to show up for class, as pop quizzes will be given roughly every week, and material not reproduced in any particular book or web page may be discussed.

Return to CS378h course homepage.