need help with cache simulator!

This is a discussion on need help with cache simulator! within the C Programming forums, part of the General Programming Boards category; Hello people, I am new here and I desperatley need some help... I have this assignment due very soon and ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    2

    need help with cache simulator!

    Hello people,
    I am new here and I desperatley need some help...

    I have this assignment due very soon and I am having trouble understanding and approaching it...starting from Part 1 below...

    Part 1:

    Create an address stream with good spatial locality but bad temporal locality called SpatialStream.txt. Then create a stream that has good temporal locality but bad spatial locality called TemporalStream.txt. Each stream must have at least 100 accesses in it.

    // What do they mean by creating an address stream with 100 accesses in it???
    I have somewhat an idea of what spatial and temporal locality is but don't know how to interpret it to an address stream.. please help!

    Part 2:

    1.

    Begin by writing a simple cache simulator in cache.c. This direct-mapped cache receives the cache size and line size for initialization.
    2.

    Write a simulator for the cache in cachesim.c. The simulator runs by reading in from a file. This file contains the address stream the cache sees. Each address is an integer, written in ascii characters. Each address represents an access into the cache. The simulator reports the # of accesses and miss rate at the end of the simulation.
    3.

    Run the simulation on each address stream with the following cache configurations:

    Cache Size Line Size
    64 4
    64 2
    64 1
    128 4

    Deliverables:

    1. TemporalStream.txt
    2. SpatialStrem.txt
    3. Make two graphs - one that graphs the different address streams with varying sizebut constant line size, and another that graphs the different address streams with varying line size but constant size. Graph the miss rates.
    4. cache.c
    5. cachesim.c

    Thank you everyone! Any help will be greately appreciated!

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >// What do they mean by creating an address stream with 100 accesses in it???


    Only your prof/TA will really know, but I'd guess it's a sequence (stream) of addresses representing data access. The stream needs to be at least 100 addresses long.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    395
    I have somewhat an idea of what spatial and temporal locality is but don't know how to interpret it to an address stream..
    If I understand the problem correctly, here is an example of accesses with a good spatial locality (close addresses are accessed at the same time) and a bad spatial locality (but those addresses are used rarely from the cache mechanism viewpoint), e.g.

    0x1000,0x1001,0x1005 ... 0x6006,0x6008,0x6003 etc. with 0x100_ reused far later (or not at all)

    now a bad spatial locality and a good temporal locality (same addresses used often):

    0x1000,0x6000,0x16789 ... (another set of accesses) ... 0x1000,0x6000,0x16789 again, etc.

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    2
    Thanks perspective and root4!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ideas requested for a CACHE.
    By bean66 in forum C Programming
    Replies: 2
    Last Post: 02-21-2008, 11:01 AM
  2. Resource manager tree
    By VirtualAce in forum Game Programming
    Replies: 23
    Last Post: 09-07-2007, 11:27 PM
  3. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 02:30 PM
  4. cache miss/hit
    By xddxogm3 in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2007, 07:51 PM
  5. destroywindow() problem
    By algi in forum Windows Programming
    Replies: 6
    Last Post: 03-27-2005, 11:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21