Go to Post No really though, a robot game with rules similar to Risk. This would combine FIRST, Battlebots, and US Government... - Betty_Krocker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-04-2008, 01:01
ddfan1234 ddfan1234 is offline
Registered User
no team
 
Join Date: Apr 2008
Location: goleta
Posts: 3
ddfan1234 is on a distinguished road
need help with cache homework~!

Hey people,

I am new to this forum and here for desperate need of help...

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

Thanks in advance!

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   Spotlight this post!  
Unread 30-04-2008, 01:24
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: need help with cache homework~!

As a warning, there are some great programmers here, and many if not all will be happy to point you in the right direction or answer any specific questions you may have, but I guarantee you will not get your homework done for you here.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #3   Spotlight this post!  
Unread 30-04-2008, 08:26
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: need help with cache homework~!

Quote:
Originally Posted by ddfan1234 View Post
// What do they mean by creating an address stream with 100 accesses in it???
In the context of a memory cache, an address stream would be a list of memory access events. Each access is to a specific address at a specific time. A typical system can have many address streams mixed in with each other, and one of the jobs of a good cache manager is to detect patterns in the stream and split out certain accesses into separate streams.
  #4   Spotlight this post!  
Unread 30-04-2008, 20:28
ddfan1234 ddfan1234 is offline
Registered User
no team
 
Join Date: Apr 2008
Location: goleta
Posts: 3
ddfan1234 is on a distinguished road
Re: need help with cache homework~!

Yeah Vikesrock... I think i know that. I'm just looking for help on some kind of approach like Alan who posted after you who generously did. Thank you Alan.
  #5   Spotlight this post!  
Unread 30-04-2008, 21:41
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: need help with cache homework~!

Quote:
Originally Posted by ddfan1234 View Post
Yeah Vikesrock... I think i know that. I'm just looking for help on some kind of approach like Alan who posted after you who generously did. Thank you Alan.
I was just making sure, I was not accusing you of anything. People stumble in here every once in a while expecting to have their homework done for them.

I am glad that you were able to find some help here ( I would have helped myself if I had any idea what you were talking about, my programming knowledge is really small and mostly covers embedded systems)
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #6   Spotlight this post!  
Unread 30-04-2008, 22:05
SL8's Avatar
SL8 SL8 is offline
...
AKA: Jesus
FRC #0647 (Cyber Wolf Corps)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: Killeen, Texas (Fort Hood)
Posts: 352
SL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud ofSL8 has much to be proud of
Send a message via Yahoo to SL8
Re: need help with cache homework~!

Quote:
Originally Posted by Alan Anderson View Post
In the context of a memory cache, an address stream would be a list of memory access events. Each access is to a specific address at a specific time. A typical system can have many address streams mixed in with each other, and one of the jobs of a good cache manager is to detect patterns in the stream and split out certain accesses into separate streams.
Alan, it's people like you who remind me daily that I don't know a sliver of what there is to learn, Thanks!
__________________


  #7   Spotlight this post!  
Unread 30-04-2008, 22:21
ddfan1234 ddfan1234 is offline
Registered User
no team
 
Join Date: Apr 2008
Location: goleta
Posts: 3
ddfan1234 is on a distinguished road
Re: need help with cache homework~!

it's ok man. Just stressing to get something done thats all. I think we've all been there. haha
  #8   Spotlight this post!  
Unread 01-05-2008, 18:00
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,019
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: need help with cache homework~!

Quote:
Originally Posted by Vikesrock View Post
I would have helped myself if I had any idea what you were talking about, my programming knowledge is really small and mostly covers embedded systems
Heh, and I know even less, just a PDU. But, if someone reading this actually understands the original question, tell me how close I am with my guesses:

1. A text file of an address stream would be merely a list of addresses and timestamps, right?
2. If so, a stream with "good spatial locality but poor temporal locality" would just be a list with a wider range of addresses over a very short period of time - right? Or is it the other way around, addresses near each other over a long time?
(2a - Good temporal and bad spatial is the opposite I guess)

The rest - I only wish I knew. It sounds like something cool to know, but all I know about cache is that bigger can be better, but optimization is critical.

Don
__________________

I am N2IRZ - What's your callsign?
  #9   Spotlight this post!  
Unread 01-05-2008, 18:04
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: need help with cache homework~!

For all that are lost, Wikipedia is your friend - as always.

from http://en.wikipedia.org/wiki/Locality_of_reference
Quote:
In computer science, locality of reference, also known as the principle of locality, is the phenomenon of the same value or related storage locations being frequently accessed. There are three basic types of locality of reference: temporal, spatial and sequential:

Temporal locality
Here a resource that is referenced at one point in time is referenced again soon afterwards.
Spatial locality
Here the likelihood of referencing a storage location is greater if a storage location near it has been recently referenced.
Sequential locality
Here storage is accessed sequentially, in descending or ascending order.
Don, awesome deriving skills!
  #10   Spotlight this post!  
Unread 01-05-2008, 21:31
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,019
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: need help with cache homework~!

My robocoach says I'm a pretty good deriver...

Anyhow, I had it backwards: Good spatial locality is addresses near each other, and good temporal locality is close in time. What i described was spatial / temporal diversity.

Diversity is a good thing, except in caching I suppose.

Thanks for the explanation, I shoulda' thoughta' the wikipedia'

Don

.
__________________

I am N2IRZ - What's your callsign?
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with autonomous caderader Programming 3 14-02-2005 18:25
Need help with beacons magical hands Programming 2 11-02-2004 21:48
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
Need help with C++ Tton Programming 7 04-11-2003 19:15


All times are GMT -5. The time now is 01:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi