Advanced Computer Architectures Cache Memories

Slides:



Advertisements
Παρόμοιες παρουσιάσεις
Handling Local Variables General Purpose Registers
Advertisements

Cache Optimisations.
Processor-Memory (DRAM) Διαφορά επίδοσης
Εικονική Μνήμη (virtual memory) Πολλά προγράμματα εκτελούνται ταυτόχρονα σε ένα υπολογιστή Η συνολική μνήμη που απαιτείται είναι μεγαλύτερη.
Ανίχνευση κίνδυνου Επίλυση με προώθηση. Μπλέ: Εξαρτήσεις. Εξαρτήσεις προς προηγούμενα CC είναι κίνδυνοι δεδομένων Kόκκινο: Προώθηση IF/ID ID/EX EX/MEM.
Είδη των Cache Misses: 3C’s 1 Compulsory: 1 Compulsory: Συμβαίνουν κατά την πρώτη πρόσβαση σε ένα block. Το block πρέπει να κληθεί από χαμηλότερα επίπεδα.
Multi-threading Κορομηνάς Κωνσταντίνος – Μ437
Σχεδιασμός της Ιεραρχίας Μνήμης (1) Pedro Trancoso Τμήμα Πληροφορικής Πανεπιστήμιο Κύπρου.
1 Α. Βαφειάδης Αναβάθμισης Προγράμματος Σπουδών Τμήματος Πληροφορικής Τ.Ε.Ι Θεσσαλονίκης Μάθημα Προηγμένες Αρχιτεκτονικές Υπολογιστών Κεφαλαίο Τρίτο Συστήματα.
Multi-threading Κορομηνάς Κωνσταντίνος – Μ437 Χατζηανδρέου Ελένη - Μ400 Χήνου Διονυσία – Μ364.
Implicitly Multithreaded Processors Νίκος Ιωάννου EΠΛ605 Παρουσίαση άρθρου “IMT processors”
1 Α. Βαφειάδης Αναβάθμισης Προγράμματος Σπουδών Τμήματος Πληροφορικής Τ.Ε.Ι Θεσσαλονίκης Μάθημα Προηγμένες Αρχιτεκτονικές Υπολογιστών Κεφαλαίο Τρίτο Συστήματα.
© Processor-Memory (DRAM) Διαφορά επίδοσης Performance
Intel’s P6 Processor Family Architecture
Processor-Memory (DRAM) Διαφορά επίδοσης Performance
6/15/2015HY220: Ιάκωβος Μαυροειδής1 HY220 Static Random Access Memory.
ΗΥ Παπαευσταθίου Γιάννης1 Clock generation.
ΗΥ Καλοκαιρινός Γιώργος1 PCI Bus Pin List. ΗΥ Καλοκαιρινός Γιώργος2 Initiator Target.
ΗΥ Καλοκαιρινός Γιώργος1 Bus. ΗΥ Καλοκαιρινός Γιώργος2 MCS51.
6/26/2015HY220: Ιάκωβος Μαυροειδής1 HY220 Asynchronous Circuits.
Translation Lookaside Buffers Φροντιστήριο του μαθήματος “Προηγμένοι Μικροεπεξεργαστές”
Business English Ενότητα # 9: Financial Planning Ευαγγελία Κουτσογιάννη Τμήμα Διοίκησης Επιχειρήσεων ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ Ανώτατο Εκπαιδευτικό Ίδρυμα Πειραιά.
© Είδη των Cache Misses: 3C’s 1 Compulsory: 1 Compulsory: Συμβαίνουν κατά την πρώτη πρόσβαση σε ένα block. Το block πρέπει να κληθεί.
Προσομοίωση Δικτύων 2n Άσκηση Δημιουργία, διαμόρφωση μελέτη επικοινωνιακών ζεύξεων.
Week 11 Quiz Sentence #2. The sentence. λαλο ῦ μεν ε ἰ δότες ὅ τι ὁ ἐ γείρας τ ὸ ν κύριον Ἰ ησο ῦ ν κα ὶ ἡ μ ᾶ ς σ ὺ ν Ἰ ησο ῦ ἐ γερε ῖ κα ὶ παραστήσει.
Προσομοίωση Δικτύων 4η Άσκηση Σύνθετες τοπολογίες, διακοπή συνδέσεων, δυναμική δρομολόγηση.
Προσομοίωση Δικτύων 3η Άσκηση Δημιουργία, διαμόρφωση μελέτη σύνθετων τοπολογιών.
ΠΛΗΡΟΦΟΡΙΚΗ ΤΕΧΝΟΛΟΓΙΑ ΚΑΙ ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ Η/Υ Κ.ΑΛΑΦΟΔΗΜΟΣ καθηγητής Δ.Παπαχρήστος μέλος ΕΔΙΠ ΑΕΙ ΠΕΙΡΑΙΑ ΤΤ ΠΑΝΕΠΙΣΤΗΜΙΟ Α ΙΓΑIΟΥ & ΑΕΙ ΠΕΙΡΑΙΑ Τ.Τ.
ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΥΠΟΛΟΓΙΣΤΩΝ -- Δ. Σερπάνος 1 Κεφάλαιο 5.
Αρχιτεκτονική Υπολογιστών ΙΕΡΑΡΧΙΕΣ ΜΝΗΜΗΣ. Αρχιτεκτονική Υπολογιστών ΤΟΠΙΚΟΤΗΤΑ Χρονική Τοπικότητα (Temporal Locality) –μια λέξη μνήμης που χρησιμοποιήθηκε.
Αρχιτεκτονική Υπολογιστών Ενότητα # 3: Ιεραρχία Μνήμης Διδάσκων: Γεώργιος Κ. Πολύζος Τμήμα: Πληροφορικής.
Αριθμητική Επίλυση Διαφορικών Εξισώσεων 1. Συνήθης Δ.Ε. 1 ανεξάρτητη μεταβλητή x 1 εξαρτημένη μεταβλητή y Καθώς και παράγωγοι της y μέχρι n τάξης, στη.
ΕΙΣΑΓΩΓΉ ΣΤΗΝ ΠΛΗΡΟΦΟΡΙΚΉ ΝΊΚΟΣ ΠΑΠΑΔΆΚΗΣ Αρχιτεκτονική Υπολογιστών.
Διαφάνειες διδασκαλίας του πρωτότυπου βιβλίου μεταφρασμένες στα ελληνικά (μετάφραση, επιμέλεια: Δημήτρης Γκιζόπουλος, Πανεπιστήμιο Αθηνών) Οργάνωση και.
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Εικονική Μνήμη (virtual memory)
Διασύνδεση LAN Γιατί όχι μόνο ένα μεγάλο LAN
Καθηγητής Σταύρος Α. Κουμπιάς
Αντικειμενοστραφής Προγραμματισμός ΙΙ
Ενότητα 5 : Οργάνωση Υλικού Υπολογιστών Δρ. Γκόγκος Χρήστος
ΤΕΧΝΙΚΕΣ Αντικειμενοστραφουσ προγραμματισμου
Αρχές Πληροφορικής Ενότητα # 4: Δομή ενός υπολογιστικού συστήματος
Είδη των Cache Misses: 3C’s
ΠΑΝΕΠΙΣΤΗΜΙΟ ΙΩΑΝΝΙΝΩΝ ΑΝΟΙΚΤΑ ΑΚΑΔΗΜΑΪΚΑ ΜΑΘΗΜΑΤΑ
ΤΜΗΜΑ ΔΙΟΙΚΗΣΗΣ ΕΠΙΧΕΙΡΗΣΕΩΝ
Morgan Kaufmann Publishers
Θέματα Φεβρουαρίου
Οσμές στη Σχεδίαση του Λογισμικού
Ασκήσεις Caches
ΠΡΟΓΡΑΜΜΑΤΙΣΜΟΣ ΥΠΟΛΟΓΙΣΤΩΝ Ι
Τα θέματα μας σήμερα Ηλεκτρονικοί υπολογιστές Υλικό και λογισμικό
Πανεπιστήμιο Θεσσαλίας
Είδη των Cache Misses: 3C’s
Find: φ σ3 = 400 [lb/ft2] CD test Δσ = 1,000 [lb/ft2] Sand 34˚ 36˚ 38˚
Είδη των Cache Misses: 3C’s
Είδη των Cache Misses: 3C’s
aka Mathematical Models and Applications
ΕΝΣΤΑΣΕΙΣ ΠΟΙΟΣ? Όμως ναι.... Ένα σκάφος
Υλικό - Λογισμικό Υλικό (Hardware) Λογισμικό (Software)
Αρχιτεκτονική Υπολογιστών
O επεξεργαστής: Η δίοδος δεδομένων (datapath) και η μονάδα ελέγχου (control) 4 κατηγορίες εντολών: Αριθμητικές-λογικές εντολές (add, sub, slt κλπ) –R Type.
Είδη των Cache Misses: 3C’s
Single-cyle υλοποίηση:
Lower Bound for Partial Sums
Deriving the equations of
Είδη των Cache Misses: 3C’s
Διδάσκοντας: Κ. Χαλάτσης
CPSC-608 Database Systems
ΜΥΕ003: Ανάκτηση Πληροφορίας
Μεταγράφημα παρουσίασης:

Advanced Computer Architectures Cache Memories National and Kapodistrian University of Athens Department of Informatics and Telecommunications Advanced Computer Architectures Cache Memories Dimitris Tsirogiannis (grad0492@di.uoa.gr), Manolis Kafetzakis (grad0545@di.uoa.gr), Eirinaios Michelakis (grad0549@di.uoa.gr) Monday, 16 December 2002

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Problem’s Definition The problem: How to increase the performance of the memory keeping the total cost low? Mixture of two types of memory (Static RAM) Fast memory (cache) Slow memory

Memory Hierarchy

Cache Levels Level 1 cache or L1, into the chip of CPU, same speed Level 2 cache or L2 , on the motherboard Level 3 or L3

The basic principle of cache memory: Locality of time Locality of Reference The basic principle of cache memory: Locality of time Locality of space

Locality of Reference

Basic Questions Where can a block be placed in a cache? How is a block found if it is in the cache? Which block will be replaced after a failure of the cache memory? What happens on a write?

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Placement of a block in a cache The restrictions on where a block is placed create three categories of cache organization Direct map (Block address) MOD (Number of blocks in cache) Fully associative Set associative (Block address) MOD (Number of sets in cache)

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Localization of a block in a cache Caches have an address tag on each block that gives the block address. As a rule, all possible tags are searched in parallel because speed is critical Valid bit: A tag bit that says whether or not this entry contains a valid address (context switching)

Localization of a block in a cache Division of the address Tag Index Block Offset Block Frame address The offset is unnecessary in the comparison since the entire block is present or not. In the case of Fully Associative cache memories the index field is absent

Localization of a block in a cache Direct Map

Localization of a block in a cache Set -Associative

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Replacement of a block on a miss In the case of Direct Map organization ,only one block will be checked and replaced. For the other two organizations , replacement algorithms are: Random LRU – Least Recently Used FIFO - First In First Out NMRU –Not Most Recently Used Optimal –Belady’s algorithm

Comparison of the miss rate Associability 2-sets 4-sets 8-sets Size LRU Rand 16KB 5.18% 5.69% 4.67% 5.29% 4.39% 4.96% 64KB 1.88% 2.01% 1.54% 1.66% 1.39% 1.53% 256KB 1.15% 1.17% 1.13% 1.12%

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Caches: Reads & Writes CPU address: block address, block offset Block address: index field, tag field Reading: parallel tag comparison and data transfer On miss, ignore the transferred data Writing: parallelism cannot be accomplished Cache updating problem (cache coherency)

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Cache coherency Write – Through Block transfer both in cache and main memory Ease in block replacement and implementation Block transfers in main memory reduce performance Increased memory bandwidth Lower level has the most current copy of data 80386 Cache controller Data 1 Cache Main Memory

Cache coherency Buffered Write – Through Cache controller places data temporarily in buffer CPU gets instant ready signal CPU stalls still exist (read miss after write, buffer full) Write merging 100 104 108 112 1

Cache coherency Write – back Cache Flushing Hardware Transparency Data block updates only in cache memory Memory update when replacement occurs in cache Altered bit for modification check Increased performance Device accesses in memory require updated data blocks  stalls Cache Flushing Hardware Transparency Non Cacheable Memory

Cache coherency Write miss Write back caches use write allocate No – write allocate Write back caches use write allocate Write through caches use no – write allocate

Types of Caches Data caches cannot support CPU’s needs (instructions, data) Data caches to provide instructions  bottleneck Separate caches, through different ports Duplicate bandwidth Apply different optimization techniques

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Cache Performance

Cache Performance Improvement Reasons for cache failures: Compulsory (cold start misses) Misses in even an infinite cache Capacity misses (capacity misses) Misses in fully associative cache Conflict (collision misses) Misses in N – associative cache

Cache Performance Improvement Miss rate reduction techniques: Larger block size Reduce compulsory misses Take advantage of spatial locality Increase miss penalty Increase conflict misses Increase capacity misses if cache is small

Cache Performance Improvement Miss rate reduction techniques: Higher Associativity Reduce collision misses Increase hit time Victim caches Use of small fully associative cache Reduce conflict misses Does not effect clock rate or miss penalty

Cache Performance Improvement Miss rate reduction techniques: Pseudo – Associative Caches Miss rate of set – associative cache Hit speed of direct mapped Inversion of index’s most significant bit One fast and one slow hit time Variable hit times complicate pipelined CPU design Hit time Pseudo hit time Miss penalty

Cache Performance Improvement Miss rate reduction techniques: Hardware Prefetching of Instructions and Data Use of stream buffers Jouppi [1990] 1 data stream buffer got 25% misses from 4KB cache; 4 streams got 43% Palacharla & Kessler [1994] for scientific programs for 8 streams got 50% to 70% of misses from 2 64KB, 4-way set associative caches Requires available extra memory bandwidth

Cache Performance Improvement Miss rate reduction techniques: Compiler – Controlled Prefetching Insertion of prefetch instructions Register prefetch Cache prefetch Non blocking cache (lockup – free cache) Overlap execution with data prefetching Loops

Cache Performance Improvement Miss rate reduction techniques: Compiler Optimizations McFarling [1989] reduced caches misses by 75% on 8KB direct mapped cache, 4 byte blocks in software Instructions Reorder procedures  reduce conflict misses Profiling to look at conflicts (using tools they developed) Data Merging Arrays Loop Interchange Loop Fusion Blocking

Cache Performance Improvement Miss penalty reduction techniques: Priority to Read Misses over Writes Read misses Check write buffer contents (write through caches) Write buffer to hold the dirty block until memory is read (write back caches) Sub – block placement Block division in number of sub – blocks Use of valid bit in each sub – block Sub – block as minimum transfer unit on misses

Cache Performance Improvement Miss penalty reduction techniques: Sub – block placement (cont.) Associate block with address tag Require extra hardware 100 200 204 300 1

Cache Performance Improvement Miss penalty reduction techniques: Early Restart and Critical Word First CPU needs one word at the time Require very large cache blocks Likelihood to access word not yet been fetched Non blocking Caches Supply cache hits during miss Require out of order CPU execution Lower effective miss penalty overlapping one or more misses

Cache Performance Improvement Miss penalty reduction techniques: Non blocking Caches (cont.) Increase cache controller complexity Require multiple memory banks Second Level Caches Use another cache level between cache and memory Local miss rate, global miss rate Second level cache speed affect miss penalty Size of second level cache?

Cache Performance Improvement Miss penalty reduction techniques: Second Level Caches (cont.) Appropriate method to reduce miss penalty? Multilevel inclusion property

Cache Performance Improvement Hit time reduction techniques: Small and Simple Caches Small cache to fit in the processor chip Use of direct mapping Avoid Address Translation During Indexing of the Cache Use of virtual addresses for the cache Elimination translation time Require cache flushing on process switch Σκοπός των caches: η κατά το δυνατόν γρηγορότερη μεταφορά δεδομένων από και προς το Datapath. Η αύξηση του ρυθμού ρολογιού «εξαναγκάζει» τις caches σε ταχύτερη εξυπηρέτηση των αιτήσεων ανάγνωσης / εγγραφής, καθώς ένα αργό hit περιορίζει το ρυθμό ρολογιού, ακόμα και για τις αρχιτεκτονικές που χρειάζονται πολλαπλούς κύκλους για μια προσπέλαση. Όσο μικρότερη είναι η λογική που αποτυπώνεται σε ένα ολοκληρωμένο κύκλωμα, τόσο πιο ταχύ είναι αυτό. Συμβιβασμός: ενσωμάτωση της λογικής δεικτοδότησης στον επεξεργαστή (on-chip tags) με τα δεδομένα εκτός του chip (επεκτασιμότητα). Η κύρια μνήμη ως ένα επίπεδο της ιεραρχίας μνήμης, οπότε απαιτείται η αποτύπωση των ιδεατών διευθύνσεων από το δίσκο στην κύρια μνήμη. Μη μεταγλώττιση των ιδεατών διευθύνσεων -> επιτάχυνση των cache hits. Πρόβλημα: πολλές ιδεατές διευθύνσεις από διαφορετικές διεργασίες αντιστοιχούνται στην ίδια φυσική διεύθυνση -> χρήση και του PID.

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Instruction Fetch Bandwidth Trends of modern SuperScalar design consist of scaling already used techniques: Larger Instruction Windows More Functional Units Increased Instruction Fetch Bandwidth Instruction Fetch & Decode Execution Instruction Buffer(s) Branch Outcomes Γενική περιγραφή της αρχιτεκτονικής SimpleScalar. Ορσ.: Παράλληλη εκτέλεση γειτονικών εντολών, η οποία δεν καταστρατηγεί τη σειριακή σημασιολογία του προγράμματος. Ανάγκη για ανάκτηση πολλών εντολών σε κάθε κύκλο, αποκωδικοποίησή τους και έλεγχος διατήρησης των sequential semantics. (Περιγραφή των Instruction Windows). Αύξηση των λειτουργικών μονάδων, μέσω των οποίων επιτυγχάνεται παραλληλία (ALUs, registers, multiple memory ports). Εισροή περισσότερων εντολών προς «διεκπεραίωση». Διαχωρισμός της αρχιτεκτονικής σε 2 μέρη (αναφέρονται). Instruction Buffers: queues, reservation stations. Μηχανισμός ανάδρασης από τη δεύτερη στην πρώτη μονάδα λόγω εξαρτήσεων ελέγχου (branches).

Instruction Fetch Bandwidth Current SuperScalar processors fetch and issue 4 to 6 inst./cycle Bandwidth expected to increase (8 inst./cycle) Main Issues Predict Multiple Branches Fetch Multiple Cache Lines Align Instructions to feed the scheduler Μια στις 5 εντολές είναι εντολή μεταπήδησης. Σκοπός μας η αποφυγή εισαγωγής φυσαλίδων στη σωλήνωση. Μια τυπική SuperScalar αρχιτεκτονική με dual instruction issue και 10 βαθμίδων σωλήνωση, ανά πάσα στιγμή φέρει «ενεργές» 20 εντολές. Η πρόβλεψη παραπάνω από μιας διακλάδωσης είναι αναγκαία ώστε η σωλήνωση να είναι πάντα γεμάτη. Επίσης, θεμιτή θα ήταν η άμεση εκτέλεση των εντολών που ακολουθούν του στόχου μιας ακολουθούμενης διακλάδωσης. Δυστυχώς βρίσκονται σε διαφορετικές γραμμές της cache. Απαιτείται η ανάκτηση των εντολών αυτών και η τροφοδότησή τους στον αποκωδικοποιητή με τη σωστή σειρά.

Non-contiguous Block Fetching – Instruction Alignment Because of the existence of branches, insts. to be fetched may reside in multiple cache lines All insts. to be fetched in a cycle have to be accessed in parallel Alignment logic needed i-0 i-1 i-2 i-3 i-4 i-5 i-6 i-7 m m+1 want

Trace Caches Conventional Cache: Stores insts. in static order (in the order generated by the compiler) Trace Cache: Stores insts. in the order they were executed Main Idea: Programs tend to execute the same sequence of insts. many times, close in time Pay the penalty once, by using conventional cache and Branch Prediction mechanisms to construct the trace Implicitly predict multiple branches – fetch all insts. by using the constructed trace Ορισμός του Trace ως μια δυναμική ακολουθία εντολών. Πιο τυπικά: πρόκειται για μια ακολουθία n εντολών από το πολύ m blocks (τμήματα γειτονικών εντολών – δεν παρεμβάλλονται μεταξύ τους branches). Το n είναι το μέγεθος μιας γραμμής της trace cache και m ο μέγιστος αριθμός των προβλεπόμενων διακλαδώσεων του branch predictor. Κάθε trace προσδιορίζεται από τη διεύθυνση της πρώτης σε αυτό εντολής και από τα αποτελέσματα m-1 προβλέψεων του branch predictor.

Trace Caches Trace Caches rely on dynamic sequences of code being reused, due to: Temporal Locality: stored insts. That have been recently used and are to be used again in the near future Branch Behaviour: most branches tend to be biased towards one direction – certain paths through the control flow graph will be followed frequently

Trace Caches - Example Trace construction first time time next time

Trace Caches - Example Control – Indexing Information per trace: Valid bit Tag (starting address of the trace) Branch flags (m-1 bit array with T/N predictions for each of the m branches in the trace) Branch Mask (num. of branches in trace and prediction for the last branch included) Trace fall-through address (when the last branch is not taken) Trace target address (when the last branch is taken) Valid bit: όπως και στις συμβατικές caches. Tag: το tag πεδίο της πρώτης εντολής του trace. Branch Flags: το m-οστό flag δεν ακολουθείται από εντολές (λόγω περιορισμών χωρητικότητας στο trace), οπότε δε χρειάζεται να αποθηκευθεί. Branch Mask: Στοιχεία που απαιτούνται για τη σύγκριση των branch flags που έχουν αποδειχθεί ότι ακολουθούνται με τις προβλέψεις του branch predictor τη δεδομένη στιγμή. Τα πρώτα log2(m+1) bits κωδικοποιούν τον αρ. των branches που περιέχονται στο trace. Ένα επιπλέον bit δηλώνει αν η τελευταία εντολή στο trace είναι branch. Trace fall-through: Αν το τελευταίο branch δεν ακολουθείται, η διεύθυνση αυτή αποτελεί την επόμενη εντολή του branch που θα εκτελεστεί, και που θα αιτηθεί από τη μονάδα ανάκτησης εντολών. Trace target: Αντίστοιχο, αλλά για τα branches που ακολουθούνται.

Trace Cache Fetch Mechanism Ο Θεός βοηθός! BTB: {PC γνωστής εντολής διακλάδωσης – PC εντολής στόχου} Mask/Interchange/Shift: H Instruction Cache στο παράδειγμα αυτό θεωρείται ως 2-δρόμων συνολοσυσχετιστική. Με τη διεύθυνση που υποδεικνύει η BTB logic 2 cache lines διαβάζονται παράλληλα. Το εν λόγω κύκλωμα επιλέγει από αυτές τις 2n εντολές εκείνες που υποδεικνύονται μετά από τη διεύθυνση που ορίζει η BTB logic (η οποία αντιστοιχεί σε branch), τις ολισθαίνει κατάλληλα, ενώ αποκόπτει από αυτές τις εντολές που δεν ανήκουν στο block-στόχο, μέσω μιας κατάλληλα δημιουργηθείσας μάσκας. Τα Fill Control, merge logic & Line-fill buffer χρησιμοποιούνται στην περίπτωση trace cache miss για την κατασκευή ενός καινούριου trace.

Trace Cache Design Space Associativity Multiple Paths Partial Matches Fill Issues Judicious Trace Selection Victim Trace Cache Η απλούστερη trace cache: άμεσης αντιστοίχισης. Μια associative θα μείωνε τις αποτυχίες, αλλά θα επιβάρυνε χρονικά την προσπέλαση. Δεδομένης μιας αρχικής διεύθυνσης εντολής: ένα trace. Θα ήταν προτιμότερο από εκεί να αποθηκεύονταν διαφορετικά traces, ανάλογα με το αν τα branches ακολουθούνταν ή όχι – Path Associativity. Εφόσον οι πρώτες k προβλέψεις για τις διακλαδώσεις ενός trace είναι σωστές, το μέρος του αυτό θα μπορούσε να χρησιμοποιηθεί. Όταν ο line-fill buffer γεμίζει έπειτα από μια trace miss, η trace cache συνεχίζει να προσπελαύνεται από τη μονάδα ανάκτησης. Με μια δεύτερη ενδεχόμενη αποτυχία τι; Ignore new misses – Delay servicing new misses – Use multiple line-fill buffers. Μερικά traces που χρησιμοποιούνται μόνο για μια φορά πετάνε από την trace cache άλλα χρήσιμα caches. Αποθήκευσε στην cache μόνο τα traces που έχουν ακολουθηθεί πάνω από μια φορά. Γνωστή προσέγγιση.

Overview Memory Hierarchy and Notion of Caches Placement Strategies Block Localization Block Replacement on a Cache Miss Caches: Reads and Writes Maintaining Cache Coherency Cache Performance Improvement Trace Caches Case Studies

Case Study: Intel’s Pentium IV Cache Memory Subsystem Instruction Trace Cache with capacity of 12 K uops 6 uops per Trace Line Private BTB for local branch predictions in the subset of the program within the cache Microcode ROM Contains decoded complex instructions – uops (e.g. interrupt handling) Bypasses Trace Cache upon issuing of complex instructions

Case Study: Intel’s Pentium IV Cache Memory Subsystem Level 2 Instruction and Data Cache 256KB, 8-way set associative, write-back cache, with 128 bytes/cache line Hardware Prefetcher: fetches 256 bytes after the last data access location. Minimizes prefetching of unwanted data by keeping history of the last cache misses Hardware Prefetcher: Ανιχνεύει για συγκεκριμένα πρότυπα προσπέλασης δεδομένων (π.χ. πρόσβαση στις άρτιες θέσεις ενός array) και προσπαθεί να ανακτήσει έως και 256 bytes δεδομένων που ακολουθούν τα προβλεπόμενα πρότυπα, πολύ πριν αιτηθούν. Παρακολουθώντας επίσης και το ιστορικό των αποτυχιών, επιδιώκει την ανίχνευση ανεξάρτητων ροών δεδομένων που πρόκειται εντός ολίγου να χρησιμοποιηθούν.

Case Study: Intel’s Pentium Pro Cache Memory Subsystem 8K Level 1 Instruction Cache 8K Level 1 Dual Ported Data Cache 256K Level 2 on-chip Cache Fully pipelined, non-blocking architecture for both Data Caches Address translation in parallel with accessing L1 Cache

Case Study: AMD Processors’ Memory Subsystem K7 64KB split (instruction and data) Dual-ported, 2-way set associative, non-blocking Level 1 Cache Athlon 128KB split (instruction and data) Dual-ported, 2-way set associative, non-blocking Level 1 Cache Scalable L2 cache 72bit (64-bits for data and 8-bits for ECC capabilities) interface MOESI (Modify, Owner, Exclusive, Shared, Invalid) cache control protocol for x86 multiprocessing platforms