Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doubts about L1 cache configuration #1352

Closed
clx7913 opened this Issue Apr 16, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@clx7913
Copy link

clx7913 commented Apr 16, 2018

For example,my L1 cache has the configuration:"NSets=64,NWays=4".How many bytes or bits each way has?Which parameter should I refer to in /coreplex/Configs.scala,the RowBits or the CacheBlockBytes?

@hcook

This comment has been minimized.

Copy link
Contributor

hcook commented Apr 16, 2018

CacheBlockBytes controls the size of each cache block (of which there are ways*sets).

RowBits controls the dimensions of the data SRAM.

@clx7913

This comment has been minimized.

Copy link
Author

clx7913 commented Apr 16, 2018

You mean each way has CacheBlockBytes bytes?

If the default value of CacheBlockBytes is 64,so the size of the L1 cache is sets*ways*CacheBlockBytes=64*4*64.Am I right?

@hcook

This comment has been minimized.

Copy link
Contributor

hcook commented Apr 17, 2018

It depends what you mean by "each way". Each way of a set is CacheBlockBytes of data. Each way of a cache is therefore CacheBlockBytes*sets. The default cache size is 16Kb.

@clx7913

This comment has been minimized.

Copy link
Author

clx7913 commented Apr 18, 2018

Thank you so much!That's really detailed.

@clx7913 clx7913 closed this Apr 18, 2018

@cabingh

This comment has been minimized.

Copy link

cabingh commented Sep 8, 2018

Hello I am still learning the source code structures. where I can find this default CacheBlockBytes setting? I don't see /coreplex/Configs.scala in current src/main/scala. Thanks in advance.

@aignacio

This comment has been minimized.

Copy link

aignacio commented Nov 15, 2018

@cabingh I'm not sure about that but check this line where it's defined as 64 bytes. As an example, the configuration of L1 for TinyCore (If I'm right) it's:
D$ cache size = 256 nSets * 1 nWays * 64 CacheBlockbytes = 16384 Bytes = 16 KiB
I$ cache size = 64 nSets * 1 nWays * 64 CacheBlockbytes = 4096 Bytes = 4 KiB
...using the image below (different cfg) we can say that by default we have block size equals to 512-bit (64*8) instead of 32-bit like image.
screenshot from 2018-11-15 14-30-45
is this right @aswaterman ?

@aswaterman

This comment has been minimized.

Copy link
Member

aswaterman commented Nov 15, 2018

@aignacio that sounds correct to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.