|
| 1 | +from m5.params import * |
| 2 | +from m5.proxy import * |
| 3 | + |
| 4 | +from m5.objects.AbstractMemory import AbstractMemory |
| 5 | + |
| 6 | +# Enum for the address mapping. With Ch, Ra, Ba, Ro and Co denoting |
| 7 | +# channel, rank, bank, row and column, respectively, and going from |
| 8 | +# MSB to LSB. Available are RoRaBaChCo and RoRaBaCoCh, that are |
| 9 | +# suitable for an open-page policy, optimising for sequential accesses |
| 10 | +# hitting in the open row. For a closed-page policy, RoCoRaBaCh |
| 11 | +# maximises parallelism. |
| 12 | +class AddrMap(Enum): vals = ['RoRaBaChCo', 'RoRaBaCoCh', 'RoCoRaBaCh'] |
| 13 | + |
| 14 | +class DCMemInterface(AbstractMemory): |
| 15 | + type = 'DCMemInterface' |
| 16 | + abstract = True |
| 17 | + cxx_header = "mem/dcmem_interface.hh" |
| 18 | + |
| 19 | + # Allow the interface to set required controller buffer sizes |
| 20 | + # each entry corresponds to a burst for the specific memory channel |
| 21 | + # configuration (e.g. x32 with burst length 8 is 32 bytes) and not |
| 22 | + # the cacheline size or request/packet size |
| 23 | + write_buffer_size = Param.Unsigned(64, "Number of write queue entries") |
| 24 | + read_buffer_size = Param.Unsigned(32, "Number of read queue entries") |
| 25 | + |
| 26 | + # scheduler, address map |
| 27 | + addr_mapping = Param.AddrMap('RoRaBaCoCh', "Address mapping policy") |
| 28 | + |
| 29 | + # size of memory device in Bytes |
| 30 | + device_size = Param.MemorySize("Size of memory device") |
| 31 | + # the physical organisation of the memory |
| 32 | + device_bus_width = Param.Unsigned("data bus width in bits for each "\ |
| 33 | + "memory device/chip") |
| 34 | + burst_length = Param.Unsigned("Burst lenght (BL) in beats") |
| 35 | + device_rowbuffer_size = Param.MemorySize("Page (row buffer) size per "\ |
| 36 | + "device/chip") |
| 37 | + devices_per_rank = Param.Unsigned("Number of devices/chips per rank") |
| 38 | + ranks_per_channel = Param.Unsigned("Number of ranks per channel") |
| 39 | + banks_per_rank = Param.Unsigned("Number of banks per rank") |
| 40 | + |
| 41 | + # timing behaviour and constraints - all in nanoseconds |
| 42 | + |
| 43 | + # the base clock period of the memory |
| 44 | + tCK = Param.Latency("Clock period") |
| 45 | + |
| 46 | + # time to complete a burst transfer, typically the burst length |
| 47 | + # divided by two due to the DDR bus, but by making it a parameter |
| 48 | + # it is easier to also evaluate SDR memories like WideIO and new |
| 49 | + # interfaces, emerging technologies. |
| 50 | + # This parameter has to account for burst length. |
| 51 | + # Read/Write requests with data size larger than one full burst are broken |
| 52 | + # down into multiple requests in the controller |
| 53 | + tBURST = Param.Latency("Burst duration " |
| 54 | + "(typically burst length / 2 cycles)") |
| 55 | + |
| 56 | + # write-to-read, same rank turnaround penalty |
| 57 | + tWTR = Param.Latency("Write to read, same rank switching time") |
| 58 | + |
| 59 | + # read-to-write, same rank turnaround penalty |
| 60 | + tRTW = Param.Latency("Read to write, same rank switching time") |
| 61 | + |
| 62 | + # rank-to-rank bus delay penalty |
| 63 | + # this does not correlate to a memory timing parameter and encompasses: |
| 64 | + # 1) RD-to-RD, 2) WR-to-WR, 3) RD-to-WR, and 4) WR-to-RD |
| 65 | + # different rank bus delay |
| 66 | + tCS = Param.Latency("Rank to rank switching time") |
0 commit comments