soc.memory_pipe_experiment package¶
Submodules¶
soc.memory_pipe_experiment.config module¶
-
class
soc.memory_pipe_experiment.config.
MemoryPipeConfig
(*, bytes_per_cache_line=32, l1_way_count=8, l1_set_count=64, fu_op_id_shape=range(0, 32), fu_op_id_nop_value=0, physical_address_bits=48, memory_queue_chunk_size=4, memory_queue_entry_count=8)¶ Bases:
object
-
bits_per_cache_line
¶
-
l1_byte_count
¶
-
l1_line_count
¶
-
memory_queue_chunk_count
¶
-
memory_queue_chunk_entries_end_index
(chunk_index)¶ one past the end entry index for in the chunk chunk_index.
-
memory_queue_chunk_entries_start_index
(chunk_index)¶ entry index of the first memory queue entry in the chunk chunk_index.
-
memory_queue_entry_index
(chunk_index, index_in_chunk)¶
-
soc.memory_pipe_experiment.l1_cache_memory module¶
-
class
soc.memory_pipe_experiment.l1_cache_memory.
L1CacheMemory
(config: soc.memory_pipe_experiment.config.MemoryPipeConfig)¶ Bases:
nmigen.hdl.ir.Elaboratable
The data memory for the L1 cache.
It is conceptually organized into config.l1_way_count ways, where each way has config.l1_sets_count sets, where each set is a single cache line of config.bytes_per_cache_line bytes. None of the dimensions must be powers of 2, but must all be at least 1.
The memory has a single R/W port that can read or write (but not both) an entire cache line each cycle. When writing, writing to each byte can individually be enabled by setting the corresponding bit in write_byte_en.
The results of reading are available after the next clock edge.
The address is divided into set_index and way_index.
Parameters:
- config: MemoryPipeConfig
- The configuration.
Attributes:
- config: MemoryPipeConfig
- The configuration.
- set_index: Signal(range(config.l1_set_count))
- The input index of the set to read/write.
- way_index: Signal(range(config.l1_way_count))
- The input index of the way to read/write.
- write_byte_en: Signal(config.bytes_per_cache_line)
- The per-byte write enable inputs.
- write_enable: Signal()
- The overall write enable input. Set to 1 to write and to 0 to read.
- read_data: Signal(config.bits_per_cache_line)
- The read data output.
- write_data: Signal(config.bits_per_cache_line)
- The write data input.
-
elaborate
(platform)¶