manudebuck
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # PCS - Lab 2 De Baets Robin, De Buck Manu ## Q1 ``` L1.1 Data Cache Stats: Hits: 9835723 Misses: 164277 Accesses: 10000000 Bus Stats: busReads: 67043 busWrites: 97234 busUpgrades: 0 Dram Stats: Access: 299840 Reads: 164277 Written: 135563 Data read: 10267 kbyte Data written: 8472 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 1.64277 | 8472 | 10267 | ## Q2 There is no actual cache coherence protocol between the multiple cores. If one core WB a CacheBlock, another core is not notified that it needs to invalidate the CacheBlock and will then use invalid CacheBlocks leading to errors. This obviously can not happen using one core. ## Q3 ``` L1.1 Data Cache Stats: Hits: 2788781 Misses: 163502 Accesses: 2952283 L1.2 Data Cache Stats: Hits: 2533959 Misses: 186925 Accesses: 2720884 L1.3 Data Cache Stats: Hits: 2072075 Misses: 172513 Accesses: 2244588 L1.4 Data Cache Stats: Hits: 1904897 Misses: 177348 Accesses: 2082245 Bus Stats: busReads: 611474 busWrites: 88814 busUpgrades: 0 Dram Stats: Access: 808675 Reads: 110432 Written: 698243 Data read: 6902 kbyte Data written: 43640 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 7.00288 | 43640 | 6902 | * Due to constantly invalidating CacheBlocks and also writing them back (if previously in the **Modified** state), a lot more bytes are written to the DRAM memory in contrast to one core that does not need to invalidate and writeback (that often). This protocol allows only one core to have a cache block at a single point in time, when multiple cores constantly need the same cacheblock this will lead to a lot of WB's. * There are fewer bytes read from DRAM because it is possible that one core wants to read a cacheblock another core is holding in it's cache. In this case, the cacheblock is send immediately to the other core instead of retrieving it from the DRAM memory. * There are a lot more bus reads than the single core execution, since the different cores are constantly communicating with each other. ## Q4 The performance will be worse, because we're using multiple cores with this configuration. This causes writebacks to DRAM, which carry a big overhead. The execution will be much slower than using one core (which writes much less to DRAM). This is because DRAM is a slow component compared to the cache. ## Q5 A cacheblock consists of multiple bytes. If our write operation only writes to a subsection of these bytes, we need the current value of the other bytes. To do this, we fetch the part of the cacheblock that we don't write to. If we didn't do this, we would not know which other bytes to put in our cacheblock besides the ones we're writing. This means we would be throwing away previous writes. ## Q6 A cacheblock is in the exclusive state when a fetched cacheblock is received from DRAM and not from the cache of another core -- since there is only one copy of it. This means we have a single unique copy of the cacheblock. The cacheblock stays in the exclusive state as long as it hasn't been written to. This means that it matches the contents from main memory. The problem that this solves is preventing a writeback when the cacheblock is evicted or invalidated, but was not yet modified. Using the exclusive state, we know a writeback to main memory is not necessary. ## Q7 ``` L1.1 Data Cache Stats: Hits: 2788781 Misses: 163502 Accesses: 2952283 L1.2 Data Cache Stats: Hits: 2533959 Misses: 186925 Accesses: 2720884 L1.3 Data Cache Stats: Hits: 2072075 Misses: 172513 Accesses: 2244588 L1.4 Data Cache Stats: Hits: 1904897 Misses: 177348 Accesses: 2082245 Bus Stats: busReads: 611474 busWrites: 88814 busUpgrades: 0 Dram Stats: Access: 213675 Reads: 110432 Written: 103243 Data read: 6902 kbyte Data written: 6452 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 7.00288 | 6452 | 6902 | We can see that the problem is indeed solved (we now only write 6452 bytes to DRAM instead of 43640 bytes). Nevertheless we can see the number of bytes read from DRAM is still the same the same as in the MI protocol. We can also see that our number of bus reads is significantly higher than the single-core execution. Our average cache miss rate is also higher than in the single-core execution. Because a cache block can only be held by a single cache, there will be a cache miss when another core wants to read this data. This happens very often. When multiple cores need the same data, it will constantly be transferred between their caches, which has a bad impact on performance. ## Q8 A cacheblock has a shared state when the cacheblock being read is not coming from DRAM but coming from another core that had a shared or exclusive cacheblock -- note that this cacheblock can not be modified yet. This state solves the problem we explained in Q7, where we were constantly transferring a cacheblock that was not modified yet between different cores . ## Q9 ``` L1.1 Data Cache Stats: Hits: 2911875 Misses: 40408 Accesses: 2952283 L1.2 Data Cache Stats: Hits: 2696024 Misses: 24860 Accesses: 2720884 L1.3 Data Cache Stats: Hits: 2218736 Misses: 25852 Accesses: 2244588 L1.4 Data Cache Stats: Hits: 2060637 Misses: 21608 Accesses: 2082245 Bus Stats: busReads: 23918 busWrites: 88810 busUpgrades: 354 Dram Stats: Access: 212556 Reads: 109313 Written: 103243 Data read: 6832 kbyte Data written: 6452 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 1.112728 | 6452 | 6832 | The problem explained in Q7 is indeed solved, as we can see fewer bus reads are being performed (23918 instead of 611474) and the cache miss rate also became lower. ## Q10 ``` L1.1 Data Cache Stats: Hits: 2911875 Misses: 40408 Accesses: 2952283 L1.2 Data Cache Stats: Hits: 2696117 Misses: 24767 Accesses: 2720884 L1.3 Data Cache Stats: Hits: 2218828 Misses: 25760 Accesses: 2244588 L1.4 Data Cache Stats: Hits: 2060737 Misses: 21508 Accesses: 2082245 Bus Stats: busReads: 112443 busUpdates: 1303452 Dram Stats: Access: 211678 Reads: 108879 Written: 102799 Data read: 6804 kbyte Data written: 6424 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 1.112443 | 6452 | 6804 | We can see that the amount of bus reads is higher than the MEI protocol (112443 instead of 23916). This would lead to bad scalability on large multiprocessors since a lot of traffic on the bus yields large overhead on the performance of the processor across the different cores. ## Q11 A cacheblock is in the **shared modified** state if the cacheblock is not a unique copy and it has been modified and other cores are not yet aware of the modification. It is in **shared clean** state if it is not a unique copy if it *may* not be up-to-date in memory. The DRAGON protocol only uses BU if a cacheblock is in one of these shared states. This change in the protocol will solve the large amounts of traffic on the bus the previous protocol suffered from. ## Q12 ``` L1.1 Data Cache Stats: Hits: 2911875 Misses: 40408 Accesses: 2952283 L1.2 Data Cache Stats: Hits: 2696117 Misses: 24767 Accesses: 2720884 L1.3 Data Cache Stats: Hits: 2218828 Misses: 25760 Accesses: 2244588 L1.4 Data Cache Stats: Hits: 2060737 Misses: 21508 Accesses: 2082245 Bus Stats: busReads: 112443 busUpdates: 199480 Dram Stats: Access: 211678 Reads: 108879 Written: 102799 Data read: 6804 kbyte Data written: 6424 kbyte ``` | Cache miss rate (%) | Data written (kbyte) | Data read (kbyte) | | - | - | - | | 1.112443 | 6424 | 6804 | We can see this problem is indeed solved since now there are only 199480 bus updates compared to 1303452 in the update protocol. ## Q13 No problems will arise when we leave it in the shared state, but if we are certain the cacheblock is unique we can put it in the modified state, avoiding future bus update calls when rewriting to the cache block and thus avoiding unnecessary bus operations.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully