Skip to content

Commit 7de7e0f

Browse files
authored
Merge pull request #2 from darchr/dcache_orb
DCC PR (Dev/Orb)
2 parents a2c42a1 + 949d4d0 commit 7de7e0f

17 files changed

+10152
-2
lines changed

.vscode/settings.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"files.associations": {
3+
"cctype": "cpp",
4+
"clocale": "cpp",
5+
"cmath": "cpp",
6+
"csetjmp": "cpp",
7+
"csignal": "cpp",
8+
"cstdarg": "cpp",
9+
"cstddef": "cpp",
10+
"cstdio": "cpp",
11+
"cstdlib": "cpp",
12+
"cstring": "cpp",
13+
"ctime": "cpp",
14+
"cwchar": "cpp",
15+
"cwctype": "cpp",
16+
"array": "cpp",
17+
"atomic": "cpp",
18+
"hash_map": "cpp",
19+
"hash_set": "cpp",
20+
"strstream": "cpp",
21+
"*.tcc": "cpp",
22+
"bitset": "cpp",
23+
"chrono": "cpp",
24+
"cinttypes": "cpp",
25+
"complex": "cpp",
26+
"condition_variable": "cpp",
27+
"cstdint": "cpp",
28+
"deque": "cpp",
29+
"forward_list": "cpp",
30+
"list": "cpp",
31+
"unordered_map": "cpp",
32+
"unordered_set": "cpp",
33+
"vector": "cpp",
34+
"exception": "cpp",
35+
"algorithm": "cpp",
36+
"functional": "cpp",
37+
"iterator": "cpp",
38+
"map": "cpp",
39+
"memory": "cpp",
40+
"memory_resource": "cpp",
41+
"numeric": "cpp",
42+
"optional": "cpp",
43+
"random": "cpp",
44+
"ratio": "cpp",
45+
"regex": "cpp",
46+
"set": "cpp",
47+
"string": "cpp",
48+
"string_view": "cpp",
49+
"system_error": "cpp",
50+
"tuple": "cpp",
51+
"type_traits": "cpp",
52+
"utility": "cpp",
53+
"fstream": "cpp",
54+
"initializer_list": "cpp",
55+
"iomanip": "cpp",
56+
"iosfwd": "cpp",
57+
"iostream": "cpp",
58+
"istream": "cpp",
59+
"limits": "cpp",
60+
"mutex": "cpp",
61+
"new": "cpp",
62+
"ostream": "cpp",
63+
"sstream": "cpp",
64+
"stdexcept": "cpp",
65+
"streambuf": "cpp",
66+
"thread": "cpp",
67+
"cfenv": "cpp",
68+
"typeindex": "cpp",
69+
"typeinfo": "cpp",
70+
"valarray": "cpp",
71+
"variant": "cpp",
72+
"bit": "cpp",
73+
"shared_mutex": "cpp"
74+
}
75+
}

simple.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from m5.objects import *
2+
import m5
3+
4+
system = System()
5+
system.clk_domain = SrcClockDomain()
6+
system.clk_domain.clock = "4GHz"
7+
system.clk_domain.voltage_domain = VoltageDomain()
8+
system.mem_mode = 'timing'
9+
10+
system.generator = PyTrafficGen()
11+
12+
system.mem_ctrl = DcacheCtrl()
13+
system.mem_ctrl.dram = DDR3_1600_8x8(range=AddrRange('1GB'), in_addr_map=False)
14+
system.mem_ctrl.nvm = NVM_2400_1x64(range=AddrRange('1GB'))
15+
16+
system.mem_ctrl.dram.tREFI = "1000"
17+
system.mem_ctrl.orb_max_size = "512"
18+
system.mem_ctrl.crb_max_size = "32"
19+
#system.mem_ctrl.static_frontend_latency = "0ns"
20+
21+
system.mem_ranges = [AddrRange('1GB')]
22+
23+
system.generator.port = system.mem_ctrl.port
24+
25+
def createRandomTraffic(tgen):
26+
yield tgen.createRandom(1000000000, # duration
27+
0, # min_addr
28+
16700000, # max_adr
29+
64, # block_size
30+
1000, # min_period
31+
1000, # max_period
32+
0, # rd_perc
33+
0) # data_limit
34+
yield tgen.createExit(0)
35+
36+
def createLinearTraffic(tgen):
37+
yield tgen.createLinear(1000000000, # duration
38+
0, # min_addr
39+
16700000, # max_adr
40+
64, # block_size
41+
1000, # min_period
42+
1000, # max_period
43+
0, # rd_perc
44+
0) # data_limit
45+
yield tgen.createExit(0)
46+
47+
48+
root = Root(full_system=False, system=system)
49+
50+
m5.instantiate()
51+
#system.generator.start(createRandomTraffic(system.generator))
52+
system.generator.start(createLinearTraffic(system.generator))
53+
exit_event = m5.simulate()

src/mem/DCMemInterface.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

Comments
 (0)