MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / make_cache

Function make_cache

crates/virtual-machine/tests/vm_cache.rs:10–22  ·  view source on GitHub ↗
(size: usize, block_size: usize, ways: usize, write_back: bool)

Source from the content-addressed store, hash-verified

8const RAM_SIZE: usize = 1024 * 1024; // 1 MiB
9
10fn make_cache(size: usize, block_size: usize, ways: usize, write_back: bool) -> Cache<Ram> {
11 let ram = Ram::new(RAM_BASE, RAM_SIZE);
12 Cache::new(
13 CacheParams {
14 size,
15 block_size,
16 associativity: ways,
17 write_back,
18 read_only: false,
19 },
20 ram,
21 )
22}
23
24fn make_read_only_cache() -> Cache<Ram> {
25 let ram = Ram::new(RAM_BASE, RAM_SIZE);

Calls

no outgoing calls

Tested by

no test coverage detected