This is the website for a prior semester's offering of CS 3330.

This schedule is tentative more than two weeks in advance.

Readings are sections of the textbook (Computer Systems: A Programmer's Perspective, 3rd Edition) unless otherwise noted.

DateTopicAssignment
Week 1
Tue 28 Aug

Course Introduction / Compilation Pipeline

 [ DG/CR:
| screencapture (mp4: 12:30pm; browser: 12:30pm) | audio only (12:30pm)
 ]
Reading:

Chapter 1 (skim only)

  • Semester preview: Layers of abstraction
  • Endianness
  • Program Memory Layout (Stack, Heap, etc.)
  • Compilation Steps and Object Files
Wed 29 Aug

Lab: getting C


lab writeup

Work on getting a working C environment on your own. The lab will not be staffed.

Thu 30 Aug

Brief Assembly Refresher

 [ DG:
| screencapture (mp4: 12:30pm; browser: 12:30pm) | audio only (12:30pm)
 ]
Reading:

page 177’s Aside: ATT versus Intel assembly-code formats, Section 3.4.1, 3.5.1, 3.6.1-3, Figure 3.2, 3.3

  • Compilation Steps and Object Files (finish)
  • AT&T syntax assembly
  • X86-64 calling convention
  • LEA (load effective address)
  • If, loop-to assembly
  • X86 condition codes (start)
    • cmpq versus subq
    • testq %rax, %rax
Week 2
Tue 04 Sep

Assembly 2 / C

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 3.6.5, 3.6.7; review section 2 if you need a C refresher

  • X86 condition codes (finish)
    • SF, ZF
  • Loop-to-assembly (revisited)
  • C types
  • Truth in C, &&, ||
  • Pointer Arithmetic
Wed 05 Sep

Lab: bomb lab


lab writeup
Lab due by end of day
Thu 06 Sep

More C / Bitwise

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 2.1.6-7, 2.1.9; review section 2.2 if you need a 2’s complement refresher

  • Jump Tables
  • Arrays versus Pointers
  • Bit shifting
  • Bitwise and/or/xor
Week 3
Tue 11 Sep

Even More C / Bitwise

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]

(add deadline)

  • Command Line Tips
  • printf
  • struct and typedef struct
  • malloc, free, dynamic arrays
  • Problematic things in C:
    • Unsigned/signed comparision
    • Undefined behavior and its consequences
  • Bit puzzle strategies
    • Mask and shift
    • Parallelism example: any-bit-set with &
Quiz 01 (pre-quiz for week 3) due 12:15 (released 2018-09-08)
Wed 12 Sep

Lab: memory safety lab


lab writeup
bomb HW due at 9am
Lab due by end of day
Thu 13 Sep

ISAs and Y86-64

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 4-4.1, p 361 aside “RISC and CISC instruction sets”

  • CISC versus RISC
  • Y86-64 instruction set
  • Y86-64 machine code
Quiz 02 (post-quiz for week 3) released, due 2018-09-17 23:59
Week 4
Tue 18 Sep

SEQ part 1

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 4.2.2-3, 4.2.5, 4.3-4.3.2 You may ignore details of HCL syntax for now.

  • SEQ components
    • Registers generally and the PC
    • Instruction and data memory
    • Register file
    • MUXes
  • Simple processors: nop, addq, jmp, mov
Quiz 03 (pre-quiz for week 4) due 12:15 (released 2018-09-15)
Wed 19 Sep

Lab: bit-fiddling lab


lab writeup
lists in C due at 9am
Lab due by end of day
Thu 20 Sep

SEQ part 2 / HCLs

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.2 (remaining), 4.3.3; HCLRS writeup

  • mov CPU, continued
  • HCLRS intro
    • HCLRS built-in components
    • Defining register banks
    • Wires and wire widths
    • MUXes
  • Simple processors in HCLRS
Quiz 04 (post-quiz for week 4) released, due 2018-09-24 23:59
Week 5
Tue 25 Sep

SEQ part 3

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.3.3-4.3.4

  • HCLRS continued
    • Built-in components
  • SEQ “stages”
  • Setting MUXes
Quiz 05 (pre-quiz for week 5) due 12:15 (released 2018-09-22)
Wed 26 Sep

Lab: HCL1 (pc)


lab writeup
bit-fiddling HW due at 9am
Lab due by end of day
Thu 27 Sep

SEQ part 4 / Pipelining 1

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.4-4.4.3

  • SEQ stages/MUXes finishing details
  • pipelining idea (laundry example)
  • latency and throughput
  • register tolerances and diminishing pipelining returns
Quiz 06 (post-quiz for week 5) released, due 2018-10-01 23:59
Week 6
Tue 02 Oct

Exam review

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Wed 03 Oct

Exam review in Lab

HCL2 (irmovq + rrmovq + jmp) due at 9am
Thu 04 Oct

Exam 1

Week 7
Tue 09 Oct

Reading Day

Wed 10 Oct

Lab: HCL3 (seqlab)


lab writeup
Lab due by end of day
Thu 11 Oct

Pipelining 2

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.4.4, 4.5.1-4.5.3

  • Critical paths
  • Pipelining addq
  • addq CPU pipelined in HCL
    • HCL register naming
  • SEQ to PIPE
    • Where to add registers/what registers to add?
    • Rules for programming pipeline stages
  • Hazards — Data and Control
  • Stalling as a Hazard Solution
Quiz 08 (post-quiz for week 7) released, due 2018-10-15 23:59
Quiz 07 (pre-quiz for week 7) due 12:15 (released 2018-10-06)
Week 8
Tue 16 Oct

Pipelining 3

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.5.4-5

(drop deadline)

  • Forwarding
    • Motivation, HCL example
  • Forwarding paths exercies
  • Branch prediction and squashing
Quiz 09 (pre-quiz for week 8) due 12:15 (released 2018-10-13)
Wed 17 Oct

Lab: HCL5 (pipelab1)


lab writeup
HCL4 (seqhw) due at 9am
Lab due by end of day
Thu 18 Oct

Pipelining 4 / Caches 1

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 4.5.8, 6.2-3

  • Remaining problem: The Load-Use Hazard
  • Implementing stalling/squashing in HCLRS
    • bubble and stall signals
  • Better branch prediction ideas
  • Preview: Out-of-Order, Multiple Issue Execution
  • The Memory Hierarchy Idea
  • Locality
    • Spatial versus Temporal
    • Examples with Loops
Quiz 10 (post-quiz for week 8) released, due 2018-10-22 23:59
Week 9
Tue 23 Oct

Caches 2

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 6.4-6.4.4

(withdraw deadline)

  • Direct-Mapped Caches
  • Tag/Index/Offset for Direct-Mapped Caches
  • Set-associative caches
  • Tag/Index/Offset for set-associative caches
Quiz 11 (pre-quiz for week 10) due 12:15 (released 2018-10-20)
Wed 24 Oct

Lab: HCL7 (pipelab2)


lab writeup
HCL6 (pipehw1) due at 9am
Lab due by end of day
Thu 25 Oct

Caches 3

 [ DG:
| audio only (3:30pm)
 ]
Reading:

Seciton 6.4.5-7, 6.5

  • Replacement policies
  • Write policies and write buffers
  • Cache parameters and performance
    • Average memory access time (AMAT)
  • C code and cache misses
Quiz 12 (post-quiz for week 9) released, due 2018-10-29 23:59
Week 10
Tue 30 Oct

Cache performance

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 6.6.2

  • Loop reordering
  • Cache blocking
Quiz 13 (pre-quiz for week 10) due 12:15 (released 2018-10-27)
Wed 31 Oct

Lab: CacheLab


lab writeup
HCL8 (pipehw2) due at 9am
Lab due by end of day
Thu 01 Nov

Optimization 1

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 5.1, 5.4-6, 5.8

  • Cache blocking (con’t)
  • Compiler limitations
    • Aliasing
    • Seperate compilation
    • Code Size versus Time
  • Inlining
  • Removing redundant operations
  • Loop Unrolling
Quiz 14 (post-quiz for week 10) released, due 2018-11-05 23:59
Week 11
Tue 06 Nov

Exam 2 Review

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]

12pm: notes, drawing 1 2

3pm: notes

Wed 07 Nov

Exam Review In Lab

Thu 08 Nov

Exam 2

Week 12
Tue 13 Nov

Optimization 2

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

Section 5.7, 5.9, 5.11

  • Loop Unrolling (review)
  • Multiple Issue, Out-of-Order CPUs
    • What instruction queues do
    • The latency bound
    • Functional/execution units
    • Multiple accumulators, reassociation
  • Rotate assignment intro
    • RIDX and C macros
    • partners
  • [aside] Loop Unrolling Versus Cache Blocking
Quiz 15 (pre-quiz for week 12) due 12:15 (released 2018-11-10)
Wed 14 Nov

Lab: LoopLab


lab writeup
Lab due by end of day
Thu 15 Nov

Optimizations 3 / Exceptions 1

 [ CR:
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Reading:

page 546 aside ‘SIMD’, Section 5.14.1, Section 8-8.1.2

  • Addressing efficiency
  • Vector intructions
    • What they are, examples
    • The Intel intrinsics
  • Profilers
  • Processes
    • Time multiplexing and measuring an empty loop
    • Contexts and context switches
Quiz 16 (post-quiz for week 12) released, due 2018-11-19 23:59
Week 13
Tue 20 Nov

Exceptions 2 / Virtual Memory 0

 [ CR:
| screencapture (webm: 12:30pm; browser: 12:30pm) | audio only (12:30pm)
 ]
Reading:

section 8.1.2-8.3, section 9.1-9.3.3

  • Processes continued
    • Address spaces — illusions of dedicated memory
    • Threads — illusions of dedicated CPU
    • Process = Thread(s) + Address Space
  • Kinds of exceptions
  • System calls
    • Linux system call calling convention and example
  • Lack of consistent exception/kernel mode terms
  • Virtual versus physical addresses
    • What a “4GB address space” means
  • Four-page example page table example
    • Splitting addresses: page number, page offset
Quiz 18 (post-quiz for week 13) released, due 2018-11-26 23:59
Quiz 17 (pre-quiz for week 13) due 12:15 (released 2018-11-17)
Wed 21 Nov
(no class)
Thu 22 Nov
(no class)
Week 14
Tue 27 Nov

Virtual Memory 1

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

section 9.6-9.6.1, 9.3.4-9.3.6, 9.4-5

  • Address splitting and page counting examples
  • Storing/using page tables in memory
    • Memory management units location in the CPU pipeline
  • Preview: single-level tables too big, memory accesses too slow
    • Remark: how 48-bit virtual addresses on 64-bit system?
  • Page table lookup exercises
  • Page permission bits
    • Motivation: shared read-only code
  • Page table ‘tricks’ (not failing on a page fault):
    • Allocating space on demand
    • Swapping
      • Motivation: HDD/SSD performance
      • Example timeline
    • Implementing write-back policies
    • Implementing swapping replacement policies
    • Copy-on-write
Quiz 19 (pre-quiz for week 14) due 12:15 (released 2018-11-24)
Wed 28 Nov

Lab: SIMDLab


lab writeup
Rotate due at 9am
Lab due by end of daySmooth checkpoint due at 9am
Thu 29 Nov

Virtual Memory 2

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 9.6.3

  • Multi-level page tables
    • Motivation: impossibly huge single-level page tables
    • Motivation: large holes
    • Two-level page table lookup
    • Note that parts of VPNs aren’t VPNs
    • Splitting addresses for multi-level tables
    • Page table lookup exercises
    • x86-64 page table structure
    • Page table space exercises
Quiz 20 (post-quiz for week 14) released, due 2018-12-03 23:59
Week 15
Tue 04 Dec

Virtual Memory 3

 [ DG:
| screencapture (mp4: 3:30pm; browser: 3:30pm) | audio only (3:30pm)
 ]
Reading:

Section 9.6.2, 9.6.4, 9.7

  • TLBs
    • Motivation: temporal locality in PTE accesses
    • TLBs versus L1 caches
    • TLBs and the memory management unit
    • TLB layout, lookup process
    • TLB + multi-level page table address splitting exercises
    • Changing page tables and TLB invalidation
Quiz 21 (pre-quiz for week 15) due 11:15 (released 2018-12-01)
Wed 05 Dec

Lab: work on memory HW


Smooth due at 9am
Thu 06 Dec

Exam Review

 [ :
| screencapture (webm: 12:30pm 3:30pm; browser: 12:30pm 3:30pm) | audio only (12:30pm 3:30pm)
 ]
Fri 07 Dec
(no class)
Memory due by 11:59pm
Week 16
Tue 11 Dec

FINAL EXAM

7PM. Physics 203.