Questions tagged [cpu-cache]
A fast memory limited in space close to the CPU. A cache is designed to reduce the average time to access memory.
249 questions
0
votes
0
answers
34
views
How is two way set associative cache better than a direct mapped cache?
I'm trying to learn computer architecture now on my own, and while I understand how two way set associative cache and direct mapped (one way) cache works from watching videos, it's not clearly what ...
0
votes
0
answers
44
views
Clarification about caching fault rate proof: How is it established that a partition of phases into blocks exists?
I am reading "On paging with locality of reference" and I am trying to understand Theorem 1.
For some prerequisites, their idea is to consider only paging sequences that satisfy "...
0
votes
0
answers
35
views
Is this David Patterson 'Computer Architecture A Quantitative Approach' scheme right?
My guess is that L1 cache tag is also 28 bits as the L1 tag compare adress.
Another question is why the offset is going to CPU?
And the last one What other improvements and errors does this memory ...
0
votes
0
answers
29
views
Is memory barrier NECESSARY for memory consistency?
After reading Memory Barriers: a Hardware View for Software Hackers, I came up with a point which I am not sure of its correctness, as posted in the title.
I came up with this point because of ...
0
votes
0
answers
28
views
Inverting position of MMU and cache inside a computer
I was thinking about a topic in my actual course and a question came to my mind.
What would happen if, at the hardware level, the position of the MMU and the cache were reversed inside a computer?
...
1
vote
1
answer
184
views
MIPS: How can the least 2 significant bits of a 32-bit address specify a byte?
I was reading Computer Architecture Organization and Design by David A. Patterson and John L. Hennessy. Specifically, I was reading chapter 5, section 5.3, Basics of Caches. I read the following ...
2
votes
1
answer
116
views
Measuring Cache Access Time
I want to make a simple C program in order to measure L1, L2 and L3 latencies of my CPU. I know some info about them:
...
2
votes
0
answers
115
views
What is dynamic biased cache replacement policy?
The Arm documentation for Cortex-A76 (Raspberry Pi 5) says the L2 cache replacement policy is "dynamic biased". But what is it?
More precisely:
How does it works?
Why not using pseudo-LRU, ...
0
votes
1
answer
30
views
Cache Miss in First Private Cache but Hit in Shared LEvel 2 Cache: Does it Result in a Penalty?
In the context of Shared Memory Multiprocessor (SMP) systems with different cache levels, if a cache miss occurs in the first private cache but is followed by a hit in the second shared cache, would ...
0
votes
0
answers
104
views
How to calculate memory bandwidth?
I'm studying for final and currently stuck in the question below.
You have an embedded processor. It has its L1 instruction and data cache.
No L2 or last level cache are available. Consider the ...
2
votes
2
answers
178
views
Is loading from L2 or L3 of multi level cache direct or require a transfer to L1
(This is mainly about reads, and commercial products not hypothetical machines.) When loading a CPU register with data contained in L2 or L3 of a multi-level cache. Can the data that is in L2 or L3 ...
0
votes
1
answer
57
views
Associative memory addressing
I would like to understand better how associative memory works.In associative memory we have the tag and the actual data being stored.The tag describes where the data came from but what does this mean ...
0
votes
1
answer
78
views
I'm completely stumped by these questions for a Computer Organization assignment
My Professor for my Computer Organization class gave us a few questions about caches on an assignment. I'm completely stumped by most of them. I've watched a few videos on caches on YouTube by ...
1
vote
1
answer
62
views
How is the memory address structured when the number of blocks per cache set is not a power of 2?
When it comes to defining the memory address structure given the RAM size, cache size, and other parameters such as the cache block size..., we can have the following generalization:
$$Address = TAG|...
1
vote
0
answers
57
views
Adding two 2D matrices together: row by row vs column by column
When adding two 2D matrices of the same size (in row major format), in sequential code with no vector operations, is it faster to add them column by column or row by row?
At first I thought it would ...
1
vote
0
answers
94
views
Can compilers improve performance in real workloads by inserting prefetches in their output?
Prefetching is a task that the compiler feels like it should be suited for. Prefetching requires knowing in advance what data the program is about to load, and the compiler has a ton of information at ...
0
votes
0
answers
151
views
Help with a question on write-through and no-write allocate in caches
I am struggling with this question as I am not sure whether the answer that has been provided is correct or not. The image should be sufficient to tell the question.
The attached image is of the ...
0
votes
0
answers
59
views
Memory Hierarchy Mappings to real world
This article from IBM (link) talks about Memory hierarchy in its actual hardware parts.
NUMA
While operating systems present memory to the running applications as a unified space, modern large ...
1
vote
1
answer
852
views
Page/Frame VS Block
I am bit confused on these terminologies.
While studying Paging of Operating System we study about Page and Frame.
Size of one Frame of Main Memory = Size of one Page of a Process
While studying ...
0
votes
1
answer
973
views
compute cache miss rate by given code
I have been trying to solve questions like this before but I have stumbled in difficulty to track the the space of the cache.
so there is an example of a question like this:
Given the code:
...
1
vote
1
answer
134
views
Are really only ~1% of the physical CPU space used for computing
In a Talk by Herb Sutter C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2 at 46:30 the point is made that only around 15% of the physical space (or the transistors) on a CPU do actual ...
1
vote
0
answers
42
views
Direct-Mapped cache for Multicore Processor using MSI Protocol
I am reading a case study for Computer architecture, A Quantitative Approach 5th Edition. For reference, I am looking at the case study #1 in Chapter 5 and none of it is making any sense.
It says:
...
0
votes
0
answers
45
views
CPU cache sets and address bits
I have some questions about CPU caches I would like some clarification on.
Assume that I have a 128 KB cache with a block size of 64. It is 4-way associative.
How many sets does the cache have?
How ...
1
vote
0
answers
42
views
How to decide row / column strides for a loop over a matrix get these cache hit rates?
Given CPU with:
L1 cache: 4-ways, block size = 32 bytes , cache size = 64KB , LRU (Cache replacement policy).
L2 cache: 2-ways, block size = 32 bytes , cache size = 512KB , LRU (Cache replacement ...
2
votes
0
answers
86
views
Von Neumann mixed with Havard in modern CPU?
Modern CPUs (for a very wider range of "modern") use separate data- and instruction-caches. So at the core they (probably) have separate busses for data and instructions. Does that make the &...
1
vote
1
answer
62
views
Performance of CPU with two caches
I was very confused how to solve the problem when there are two levels of cache, My doubt is how does we quantify the performance when there are two caches. Consider a problem like this
Cache L1 ...
0
votes
1
answer
147
views
Are sample memory access traces/dumps available, and where?
I am looking for a realistic physical memory access trace/dump of significant, but not insane, length (on the order of 1M accesses) for the purpose of cache simulation. Preferably for a 16-bit or 32-...
1
vote
1
answer
514
views
Where does tag directory is stored
I am studying direct mapping in cache. I understood the concepts like dividing into blocks and lines , tag directory etc. When solving numerical problems of finding main memory size or tag directory ...
-3
votes
1
answer
47
views
8085 microprocessor connection of CPU data bus with RAM data bus
What would happen if the CPU data-bus bit 2 is connected to the RAM data-bit 5 and CPU data-bus
bit 5 is connected to RAM data bit 2? Assume the rest of the connections are all right – explain.
1
vote
2
answers
527
views
How can an instruction be fetched every cycle?
From what I understand, in a pipelined CPU, every stage takes 1 cycle. But instructions are fetched from memory which takes up to ~150 cycles. The CPU fetches most instructions from the L1-cache, but ...
0
votes
1
answer
196
views
Confusion regarding calculation of estimated memory access time in a system containing only a cache and main memory for simplicity
Let us consider a system having cache and main memory. Now suppose we are asked to find the average memory access time. Let $h$ be the hit ratio for the cache, $t_c$ be the cache access time, $t_m$ be ...
2
votes
1
answer
169
views
How does software prefetching work with in order processors?
From prof. Onut Mutlu's slides on prefetching, this example has been shown as software prefetching:
...
1
vote
2
answers
285
views
How to determine offset bits when addressing CPU cache?
I know that the offset is based off of the line size for a cache. I have seen the example: "32-btye line size would use the last 5-bits (i.e. $2^5$) off the address as the offset into the line&...
0
votes
2
answers
120
views
Cache memory temporal locality and spatial locality principles
How does cache memory take advantage of both temporal locality and spatial locality principles?
1
vote
0
answers
46
views
How could one construct a TLB so that not all the bits of the presented address need match to result in a hit?
I was wondering besides the typical matching of all bits in the presented address to the resulting page, is there another way of doing so? what are the benefits/ cons and how would one go about doing ...
2
votes
1
answer
303
views
Would increasing system memory speed reduce a Von Neumann Architecture bottleneck?
A Von Neumann Architecture bottleneck is a limit on the amount of data a computer can process due to limited bandwidth between the CPU and RAM. Possible mitigations to the problem according to ...
1
vote
1
answer
2k
views
Formula to see where a memory address can be depicted in cache?
I've been trying to find a formula that helps us identify where an address can be depicted in cache. I remember my professor talking about some kind of division but I can't find it in my textbook nor ...
0
votes
1
answer
121
views
Query Regarding Direct cache mapping [closed]
Thank you for looking into this, I have a problem regarding direct cache mapping, My problem really though is with the question formation itself and the problem I am about to present seems to have ...
0
votes
1
answer
55
views
Cache read controller
Does the cpu interface with a memory controller to read the cache? What happens when data is not in the cache, a cache miss, does it automatically fetch the data?
0
votes
3
answers
2k
views
Calculate the effective access time
This question seems to be causing a lot of debate and I'm wondering whether my working is correct.
A computer with a single cache (access time 20ns) and main memory (access
time 500ns) also uses the ...
4
votes
7
answers
14k
views
What is a cache write miss?
I'm reading Computer Organization and Design MIPS Edition 5th Edition The Hardware/Software Interface on how memory cache works. I came across the following paragraph on page 393;
The other key ...
4
votes
1
answer
5k
views
What does "associative" exactly mean in "n-way set-associative cache"?
I'm trying to grasp what does associative actually mean in n-way set-associative cache. I understand n-way set-associative cache as a concept; n is the degree of ...
0
votes
0
answers
132
views
I'm to calculate the tag, index and offset for a given setup
Total Memory size = 65,536 bytes
Number of cache blocks = 32 cache blocks
Cache size = total 512 bytes
So using this info provided I cannot figure out how to calculate the cache block number.
I know ...
2
votes
1
answer
436
views
Cache Miss and Processor Speed
today in my class my professor mentioned that
Cache misses becomes more expensive as the speed of the processor increases
But he didn't explain the reason. I ...
-2
votes
1
answer
599
views
Find main memory location in cache(direct mapping)
Consider main memory of the size 64 kB with each word being 8 bits(one byte) only and a direct mapping Cache memory of size 4 kB also having data word size 8 bits.
Find the following :
Find the size ...
1
vote
1
answer
201
views
How does the cache / memory know where to return results of read requests to?
The pipeline of a modern processor has many stages that may issue read
requests to main memory, e.g. in fetching the next command or loading
some memory location into a register. How is the result of ...
0
votes
1
answer
675
views
Computing average access time
A computer has a cache memory and a main memory with the following features:
- Memory cache access time: 4 ns
- Main memory access time: 80 ns
- The time ...
0
votes
1
answer
161
views
Virtual Memory vs Cache for block identification
Both are based on the principle of locality. Then why virtual memory uses table lookup while cache memory uses associative memory for block identification?
1
vote
0
answers
303
views
Cache write misses
I've been using Intel Pin tool to perform analysis of cache miss rates of a parallel application in multi-level caches, using one of the examples allcache.cpp, the results differentiate load and write ...
0
votes
2
answers
252
views
How does a cache handle overwriting between 2 addresses in the same block?
Consider a byte-addressable cache with block size 16 bytes, bytes 0-15 form one block.
First I write an int(let's say 7) to address 0, so now bytes 0-3 contain the int 7. Now if I try to write another ...