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 16 Jan
(no class)
Wed 17 Jan

Lab: getting C


lab writeup

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

Thu 18 Jan

Course Introduction / Compilation Pipeline

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Chapter 1 (skim only)

  • Semester preview: Layers of abstraction
  • Why C?
  • Powers of Two
  • Endianness
  • Program Memory Layout (Stack, Heap, etc.)
  • Compilation Steps and Object Files
Week 2
Tue 23 Jan

Brief Assembly Refresher

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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
Wed 24 Jan

Lab: bomb lab


lab writeup
Lab due by end of day
Thu 25 Jan

Assembly 2 / C

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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
Quiz 00 (post-quiz for week 2) released, due 2018-01-29 16:00
Week 3
Tue 30 Jan

More C

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
  • Arrays versus Pointers
  • Command Line Tips
  • printf
  • struct and typedef struct
  • malloc, free, dynamic arrays
  • Problematic things:
    • Unsigned/signed comparision
    • Undefined behavior
Quiz 01 (pre-quiz for week 3) due 10:45 (released 2018-01-27)
Wed 31 Jan

Lab: memory safety lab


lab writeup

(add deadline)

bomb HW due at noon
Lab due by end of day
Thu 01 Feb

ISAs and Y86-64

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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-02-05 16:00
Week 4
Tue 06 Feb

Bitwise operators

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

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

  • Bitwise and/or/xor
  • Bit shifting (left, logical right)
  • Bit puzzle strategies
    • Mask and shift
    • Parallelism example: any-bit-set with &
  • Arithmetic shift
Quiz 03 (pre-quiz for week 4) due 10:45 (released 2018-02-03)
Wed 07 Feb

Lab: bit-fiddling lab


lab writeup
lists in C due at noon
Lab due by end of day
Thu 08 Feb

SEQ part 1

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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 04 (post-quiz for week 4) released, due 2018-02-13 10:59
Week 5
Tue 13 Feb

SEQ part 2 / HCLs

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.2 (remaining), 4.3.3; HCLRS writeup

  • HCLRS intro
    • HCLRS built-in components
    • Defining register banks
    • Wires and wire widths
    • MUXes
  • Simple processors in HCLRS
  • mov CPU
Quiz 05 (pre-quiz for week 5) due 10:59 (released 2018-02-10)
Quiz 04 (post-quiz for week 4) due 10:59 (released 2018-02-08)
Wed 14 Feb

Lab: HCL1 (pc)


lab writeup
bit-fiddling HW due at noon
Lab due by end of day
Thu 15 Feb

SEQ part 3

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.3.4

  • SEQ “stages”
  • Less simple processors: ??mov
  • Handling push, pop, ret, call, etc.
Quiz 06 (post-quiz for week 5) released, due 2018-02-19 16:00
Week 6
Tue 20 Feb

Exam review

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]

from 11am class:

from 2pm class:

Wed 21 Feb

Exam Review in Lab

HCL2 (irmovq + rrmovq + jmp) due at noon
Thu 22 Feb

Exam 1

Week 7
Tue 27 Feb

Pipelining 1

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.4

  • pipelining idea (laundry example)
  • latency and throughput
  • register tolerances and diminishing pipelining returns
  • the textbook’s five-stage pipelined processor
  • pipelining the addq CPU
  • critical paths and circuit speeds
Quiz 07 (pre-quiz for week 7) due 10:45 (released 2018-02-24)
Wed 28 Feb

Lab: HCL3 (seqlab)


lab writeup

(drop deadline)

Lab due by end of day
Thu 01 Mar

Pipelining 2

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.5.1-4.5.3

  • HCL register naming
  • addq CPU pipelined in HCL
  • 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-03-12 16:00
Week 8
Tue 06 Mar
(no class)
Wed 07 Mar
Thu 08 Mar
(no class)
Week 9
Tue 13 Mar

Pipelining 3

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.5.4-5

  • Forwarding
    • Motivation, HCL example
  • Forwarding paths exercies
  • Branch prediction and squashing
Quiz 09 (pre-quiz for week 9) due 10:45 (released 2018-03-10)
Wed 14 Mar

Lab: HCL5 (pipelab1)


lab writeup

(withdrawl deadline)

HCL4 (seqhw) due at noon
Lab due by end of day
Thu 15 Mar

Pipelining 4 / Caches 1

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 4.5.8, 6.2-3

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

Caches 2

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 6.4-6.4.4

  • 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 10:45 (released 2018-03-17)
Wed 21 Mar

Lab: HCL7 (pipelab2)


lab writeup
HCL6 (pipehw1) due at noon
lab due 23 March at 11:59pm (because of snow)
Thu 22 Mar

Caches 3

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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 10) released, due 2018-03-26 16:00
Fri 23 Mar

HCL7 due at 11:59pm (extended due to snow day)

Week 11
Tue 27 Mar

Cache performance

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 6.6.2

  • Loop reordering
  • Cache blocking
Quiz 13 ([dropped] pre-quiz for week 11) due 10:45 (released 2018-03-24)
Wed 28 Mar

Lab: CacheLab


lab writeup
HCL8 (pipehw2) due at noon
Lab due by end of day
Thu 29 Mar

Optimization 1

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 5.1, 5.4-6, 5.8

  • Compiler limitations
    • Aliasing
    • Seperate compilation
    • Code Size versus Time
  • Inlining
  • Removing redundant operations
  • Loop Unrolling
Quiz 14 (post-quiz for week 11) released, due 2018-04-02 16:00
Week 12
Tue 03 Apr

Exam 2 Review

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]

from 11am class:

Wed 04 Apr

Exam Review In Lab

Thu 05 Apr

Exam 2

Week 13
Tue 10 Apr

Optimization 2

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

Section 5.7, 5.9, 5.11

  • Loop Unrolling Versus Cache Blocking
  • Rotate assignment intro
    • RIDX and C macros
    • partners
  • Multiple Issue, Out-of-Order CPUs
    • What instruction queues do
    • The latency bound
    • Functional/execution units
    • Multiple accumulators, reassociation
  • Addressing efficiency
Quiz 15 (pre-quiz for week 13) due 10:45 (released 2018-04-07)
Wed 11 Apr

Lab: LoopLab


lab writeup
Lab due by end of day
Thu 12 Apr

Optimizations 3 / Exceptions 1

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

page 546 aside ‘SIMD’, Section 5.14.1, Section 8.1

  • 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 13) released, due 2018-04-16 16:00
Week 14
Tue 17 Apr

Exceptions 2 / Virtual Memory 0

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

section 8.2-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
  • System calls
    • Linux system call calling convention and example
    • System calls must trust no one
  • 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 17 (pre-quiz for week 14) due 10:45 (released 2018-04-14)
Wed 18 Apr

Lab: SIMDLab


lab writeup
Rotate due at noon
Lab due by end of day
Thu 19 Apr

Virtual Memory 1

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Reading:

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

  • Four-page example page table example continued
    • Simple page tables
  • Kernel-mode-only pages (e.g. for page table switching code)
  • 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 18 (post-quiz for week 14) released, due 2018-04-23 16:00
Week 15
Tue 24 Apr

Virtual Memory 2

 [ SK:
| screencapture (mp4: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
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 19 (pre-quiz for week 15) due 10:45 (released 2018-04-21)
Wed 25 Apr

Lab: get help with memory HW (due next week) or exam review

Smooth due at noon
Thu 26 Apr

Virtual Memory 3

 [ SK:
| screencapture (mp4: 2pm; browser: 2pm) | audio only (2pm)
 ]
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 20 (post-quiz for week 15) released, due 2018-04-30 16:00
Week 16
Tue 01 May

Exam Review

 [ CR:
| screencapture (webm: 11am 2pm; browser: 11am 2pm) | audio only (11am 2pm)
 ]
Wed 02 May
Memory due at noon
Week 17
Thu 10 May

FINAL EXAM

7PM.

Wilson 402.

conflict form