Skip to main content

Questions tagged [cache]

Cache is a type of memory used by the central processing unit (CPU) of a computer to reduce the average time to access data from the main memory. The cache is a smaller, faster memory which stores copies of the data from frequently used main memory locations.

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

does data and instruction memory we see in the data path corresponds to the L1 Instruction and Data cache inside of the core?

In CPU data path there are blocks called data memory and instruction memory ? Are these blocks L1 Instruction and L1 data caches ? For instance check figure 4.10 in this link. We know that generally ...
Abdulkadir Arslan's user avatar
0 votes
0 answers
85 views

In a N-way associative cache, how do we decide which "Way" to select?

I am having a hard time understanding the part of the cache after a Word has been selected by the 8:1 MUX. As far as I understand, the 2:1 MUX must have a select line coming from the MSB of the Index. ...
Nihal Ahmad's user avatar
1 vote
0 answers
145 views

How to handle flash write/read operations on STM32L552 with ICACHE enabled without disabling it?

I am currently working with an STM32L552 microcontroller and encountering some peculiar behavior when writing and reading double words to and from the flash memory. After writing data to a specific ...
tronhawk's user avatar
  • 217
0 votes
0 answers
22 views

Entering memory adresses into a direct mapping cache

I have been given the following problem: A computer CPU generates the following adresses in 8 bit binary form: 91, B3, 70 etc. The computer has direct mapping cache that can store 64 words and 8 words ...
bill kladis's user avatar
0 votes
0 answers
49 views

Direct Mapping of 8GByte memory with 64-bit addressable word size

The question: A computer has 8 GByte of memory with 64-bit addressable word sizes. Each block of memory stores 16 words. The computer has a direct-mapping cache of 128 blocks Calculate the tag bits, ...
AMunim's user avatar
  • 103
0 votes
0 answers
43 views

Can we service another memory request from L1 cache when an L1 miss is being serviced from L2?

Consider the case where L1 cache miss occurred and is being serviced by L2 cache which could take many cycles (may go to main memory in case of L2 cache miss). In the meantime L1 cache is idle, in ...
HWDesigner's user avatar
1 vote
1 answer
552 views

Data coherency with DMA and I2S audio on STM32H7

Moving from a audio effect prototype based on the STM32F407 to the STM32H757. Did a lot of stuff on the F4 with audio but on the H7 I'm getting stuck and can't get a simple audio loopback with DMA. I'...
Alefal's user avatar
  • 31
0 votes
0 answers
42 views

How different layers of cache connect in hardware?

I had a RISC-V CPU with L1 Instruction Cache and L1 Data Cache, and I want to connect these two L1 Caches to unified L2 Cache. I have the following questions: Does the unified L2 Cache have dual port ...
Johnson_NCKU_EE's user avatar
0 votes
1 answer
1k views

How do computer memories interact with each other (registers, cache, RAM, ROM)?

After Googling around for some time, I have managed to get a good understanding what makes these components different, but I've yet to find any clear computer architecture-focused article/thread on ...
EL02's user avatar
  • 103
0 votes
1 answer
364 views

How does CPU control implement pipeline stall [closed]

The original question was deemed lack of focus. This post is specifically about cpu pipeline stall. How does synchronous microarchitecture implement pipeline stall when a cache miss occurs during ...
Oliver Young's user avatar
0 votes
1 answer
150 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 ...
seb's user avatar
  • 3
2 votes
1 answer
144 views

Size of a memory cache

Assuming we have a virtual address issued by a model CPU that contains a total of 32 bits and 20 bits of this address are reserved for the tag + the cache comprises a total of 1024 cache lines. Should ...
Samir's user avatar
  • 227
1 vote
1 answer
535 views

Debugging Cortex-M7 with data cache

I'm using gdb, openocd and stlink to debug an application running on STM32H7. When data ...
jpa's user avatar
  • 8,703
1 vote
0 answers
617 views

How to find Base CPU Time and Memory-Stall Time

The program described below runs on a multiple issue processor with a 3-level CPU cache, a 4 GHz clock frequency, and the following performance metrics: Miss Penalty R/W Data Miss Rate Instruction ...
Theory94's user avatar
0 votes
1 answer
405 views

Cache comparator usage

Referring to the photo below, in direct-mapping cache design, why we need a comparator to compare between the tag in the address and the tag in the cache? Isn't a valid bit enough?
NAND's user avatar
  • 498
0 votes
1 answer
51 views

Displacement strategy for (Computer) Cache

Here, under displacement strategies, the following is written (Unfortunately, only in German available): Laszlo Belady's method of displacing the memory area that will not be accessed for the longest ...
Ben's user avatar
  • 625
1 vote
0 answers
22 views

Lines transferred from main memory to Cache

I'm studying Cache memories and I would like to know exactly how the lines are transferred from memory to cache. Supposing I have a 32-bit machine with a 16kB directly mapped cache and 8 words per ...
Granger Obliviate's user avatar
-2 votes
2 answers
107 views

Does a processor ‘know’ that there is a cache in the computer system?

I think with general purpose processors it would just go straight to the memory (let me know if I'm wrong), and the processor won't be bothered if or not there is a cache. What happens with DSPs?
dismal-audience's user avatar
0 votes
1 answer
263 views

Number of read and write ports on L2 and L3 cache

I have an Intel Core i9-9900K processor (some specs here) and I'm trying to figure out how many read and write ports each level of cache has, for a personal project. I cannot find this in any online ...
Anthony Krivonos's user avatar
2 votes
1 answer
878 views

How does cache coherency and DMA work together?

I am currently reading about caches and how they are used in Computer Science. The explanation of how the cache is always up to date with the actual memory is understandable as long writing and ...
Niclas's user avatar
  • 175
0 votes
1 answer
48 views

Do official transistor counts include cache?

Title says it all: do official transistor counts, such as here, include the transistors needed to implement L1, L2, and L3 cache? I assume they do.
Gavin D. Howard's user avatar
1 vote
1 answer
5k views

In Directed-mapped cache, a problem in exercise!

5.2 Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, ...
user777's user avatar
  • 111
-1 votes
1 answer
207 views

A problem dealing with a two-way set-associative cache

This is Problem 13-4 from the book "Logic and Computer Design Fundamentals" by M. Morris Mano and Charles R. Kime. I did the problem. I would like somebody to confirm that my answer is correct or tell ...
Bob's user avatar
  • 209
1 vote
0 answers
54 views

A Problem dealing with Cache memory on a computer

This is Problem 13-3 from the book "Logic and Computer Design Fundamentals" by M. Morris Mano and Charles R. Kime. I believe I have the answer right for part a and part b. That is, they match the ...
Bob's user avatar
  • 209
1 vote
0 answers
57 views

Cache Memory Read and Write Miss/hit policies: details of a real processor

All the references I have checked so far explain the Read Miss,Write Hit/Miss policies at the same level of detail. I understand their concepts but I am looking for more details on their ...
KM23's user avatar
  • 13
1 vote
1 answer
478 views

How x86-64 Intel CPU understands how many bytes load into a register

I have the following byte code one the left and and its byte representation on the right: ...
No Name QA's user avatar
1 vote
1 answer
90 views

CPU cache write policy - evict already dirty? + storage of memory address

I'm reading about cache in wiki https://en.m.wikipedia.org/wiki/CPU_cache and the following phrase seems not clear. Also, a write to a main memory location that is not yet mapped in a write-back ...
Child Detektiv's user avatar
2 votes
1 answer
301 views

How would I go about the write port of a set-associative cache memory?

Let's consider a four-way set-associative cache, just like this one: As you can see this cache has a read port but there is no write port. I was wondering if you guys could help me figure out how one ...
SkullHex2's user avatar
0 votes
2 answers
486 views

How to use two Demux to index a matrix layout of registers

Consider the following. Let's say for simplicity sake I have an arrangement of 8 bit registers in a 4x4 matrix layout. I could easily use a Demux that has a 4 bit input select line for the addresses ...
Francis Cugler's user avatar
1 vote
1 answer
338 views

How fast is L1 cache of ARM Cortex-A9 in Xilinx Zynq-7000 FPGA?

I consider writing a small program for the ARM Cortex-A9 in the Xilinx Zynq-7000 FPGA, so the program will be small enough to fit into the 32 KB L1 instruction cache. The data will also be less than ...
EquipDev's user avatar
  • 579
6 votes
3 answers
4k views

What information exactly does an instruction cache store?

Processors use both data and instruction caches in order to reduce the number of slow accesses to main memory. However, while it is clear to me that the data cache's purpose is to store frequently ...
MartinX's user avatar
  • 79
3 votes
1 answer
9k views

Cache miss types: capacity miss vs. conflict miss

Categorizing Cache Misses I was wondering if somebody could provide an example illustrating a capacity miss in contrast to a conflict miss for a 2-way cache with arbitrarily small line size and cache ...
MrCasuality's user avatar
0 votes
1 answer
1k views

CPU Memory Hierarchy: Calculating Average Memory Access Time

(From Schuam's Outlines Computer Architecture, 2002, page 193, problem 8.7(b)) Suppose I have the following memory hierarchy of: CPU <-> SRAM <=> DRAM <=> DISK SRAM has 5 ns access time ...
MrCasuality's user avatar
0 votes
2 answers
373 views

Multilevel cache effective access time calculations considering cache miss

I was solving exercise from William Stallings book on Cache memory chapter. The problem was: For a system with two levels of cache, define Tc1 = first-level cache access time; Tc2 = second-level ...
RajS's user avatar
  • 227
0 votes
2 answers
2k views

Cache access time for write back and write through caches

I was solving exercise questions on caching from the book Computer Organization and Architecture by William Stallings. The exercise has following question: The performance of a single-level cache ...
RajS's user avatar
  • 227
1 vote
0 answers
69 views

How is CAM implemented?

I have a book statement: A content addressable memory is a circuit that combines comparison and storage in a single device. I want to know how this is implemented in real world? Sounds like an ...
Kindred's user avatar
  • 221
0 votes
1 answer
96 views

Cache programming techniques

I am trying to understand hardware Caches. I have some understanding, and I would like to ask if my understanding is correct. I understand that there are three types of cache mapping; direct, full ...
user avatar
1 vote
1 answer
449 views

Why increasing block sizes in caches leads to decreased miss rate?

My book about computer organization said that: If size of a block is 1 word (4 bytes), it will encounter 10 misses when accessing 10 consecutive integers in an array. If we set the size of a block ...
Tjh Thon's user avatar
5 votes
2 answers
1k views

What is the meaning of this line? "Memory-mapped, cached view of external QSPI flash. The cache is specified as 32 KB with 4-way associativity."

Memory-mapped, cached view of external QSPI flash. The cache is specified as 32 KB with 4-way associativity. Does it mean that my external QSPI Flash is only 32Kb or it has been memory mapped onto ...
MaNyYaCk's user avatar
  • 1,468
-1 votes
1 answer
75 views

Cache memory on hit, no data stored

So, I have a question about the cache memory, i know that if the tag matches the data will be retrieved, but what happens if the current address has the same tag with others but in that place, in my ...
Sp1tfire's user avatar
  • 101
2 votes
3 answers
295 views

What determines the maximum size of a cpu cache?

Looking at a list of the very latest CPUs, I see several of them with a cache size of 12MB or 8MB - pretty small, when compared to the ever-increasing size of hard drives and ram. It seems to be taken ...
Benubird's user avatar
  • 123
1 vote
1 answer
614 views

Is my cache hit rate calculation correct?

I study cache memories. I'm supposed to calculate the data hit rate for a function call with a 1024 byte direct mapped data cache and block size 16 byte. ...
Niklas Rosencrantz's user avatar
3 votes
2 answers
296 views

Instruction cache's purpose

A processor is working at 100 MHz. The program memory interfaced to it can work only at 25 MHz maximum. Is there anyway we can fetch an instruction from it in one clock cycle of the processor ? I read ...
Meenie Leis's user avatar
  • 2,772
1 vote
1 answer
1k views

Instruction Register Size in Processors

I am learning processor basics. I have this doubt. If I have a processor with 9 one-byte instructions and one 2-bytes instruction in its instruction set architecture, should n't the instruction ...
Meenie Leis's user avatar
  • 2,772
45 votes
5 answers
13k views

How can cache be that fast?

Here is a screenshot of a cache benchmark: In the benchmark the L1 cache read speed is about 186 GB/s, with the latency being about 3-4 clock cycles. How is such a speed even achieved? Consider the ...
Knight's user avatar
  • 613
0 votes
2 answers
249 views

Pipelining vs Caching in an FPGA design

To my understanding both pipelining and caching make use of memory to reduce the amount of idle hardware. I am considdering a project that has multiple input data streams with a slow clock rate, ...
Chandran Goodchild's user avatar
1 vote
2 answers
271 views

Does cache access time scale down with frequency in modern CPUs?

I have an application where I suspect the main overhead is accessing L3 cache. It is run on a modern Intel server-grade microprocessor with a huge L3 cache. There are many microprocessors available ...
juhist's user avatar
  • 1,653
0 votes
2 answers
226 views

Methods to detect errors in cache

Are there methods apart from ECC, to detect and possibly correct cache errors?
user avatar
65 votes
4 answers
12k views

Can a CPU function with nothing more than a power supply and a ROM, using only the internal cache as RAM?

Can a CPU (such as the Intel i3/i5/i7/Xeon) with on-chip cache RAM use that as its only functional RAM, without any external memory banks attached? Or must there be external RAM, and the cache cannot ...
Dale Mahalko's user avatar
  • 1,580
1 vote
1 answer
32k views

Cache memory calculation

I'm learning the logic of cache memories. I wonder if you can verify that I understood correctly. If a cache memory in the tag field has 16 bits, the set field has 10 bits and the byte in block field ...
Niklas Rosencrantz's user avatar