-
Notifications
You must be signed in to change notification settings - Fork 0
Dram Cache Controller (Hit (rd/wr)+ Miss (rd)) #4
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
base: develop
Are you sure you want to change the base?
Changes from 22 commits
1f6ff60
63af958
e982073
4c327c5
d067acf
ae70805
a0cad47
0a903ab
6b016e7
d7db7b9
14253ff
56e1ad6
e2d5658
cfced46
1de8cf2
805664c
b39a4ff
0979c8d
d5256bd
cc5f320
5d1bacc
e8f3bd7
8c549d0
69c6d01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| { | ||
| "files.associations": { | ||
| "cctype": "cpp", | ||
| "clocale": "cpp", | ||
| "cmath": "cpp", | ||
| "csetjmp": "cpp", | ||
| "csignal": "cpp", | ||
| "cstdarg": "cpp", | ||
| "cstddef": "cpp", | ||
| "cstdio": "cpp", | ||
| "cstdlib": "cpp", | ||
| "cstring": "cpp", | ||
| "ctime": "cpp", | ||
| "cwchar": "cpp", | ||
| "cwctype": "cpp", | ||
| "array": "cpp", | ||
| "atomic": "cpp", | ||
| "hash_map": "cpp", | ||
| "hash_set": "cpp", | ||
| "strstream": "cpp", | ||
| "*.tcc": "cpp", | ||
| "bitset": "cpp", | ||
| "chrono": "cpp", | ||
| "cinttypes": "cpp", | ||
| "complex": "cpp", | ||
| "condition_variable": "cpp", | ||
| "cstdint": "cpp", | ||
| "deque": "cpp", | ||
| "forward_list": "cpp", | ||
| "list": "cpp", | ||
| "unordered_map": "cpp", | ||
| "unordered_set": "cpp", | ||
| "vector": "cpp", | ||
| "exception": "cpp", | ||
| "algorithm": "cpp", | ||
| "functional": "cpp", | ||
| "iterator": "cpp", | ||
| "map": "cpp", | ||
| "memory": "cpp", | ||
| "memory_resource": "cpp", | ||
| "numeric": "cpp", | ||
| "optional": "cpp", | ||
| "random": "cpp", | ||
| "ratio": "cpp", | ||
| "regex": "cpp", | ||
| "set": "cpp", | ||
| "string": "cpp", | ||
| "string_view": "cpp", | ||
| "system_error": "cpp", | ||
| "tuple": "cpp", | ||
| "type_traits": "cpp", | ||
| "utility": "cpp", | ||
| "fstream": "cpp", | ||
| "initializer_list": "cpp", | ||
| "iomanip": "cpp", | ||
| "iosfwd": "cpp", | ||
| "iostream": "cpp", | ||
| "istream": "cpp", | ||
| "limits": "cpp", | ||
| "mutex": "cpp", | ||
| "new": "cpp", | ||
| "ostream": "cpp", | ||
| "sstream": "cpp", | ||
| "stdexcept": "cpp", | ||
| "streambuf": "cpp", | ||
| "thread": "cpp", | ||
| "cfenv": "cpp", | ||
| "typeindex": "cpp", | ||
| "typeinfo": "cpp", | ||
| "valarray": "cpp", | ||
| "variant": "cpp", | ||
| "bit": "cpp", | ||
| "shared_mutex": "cpp" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| from m5.objects import * | ||
| import m5 | ||
|
|
||
| system = System() | ||
| system.clk_domain = SrcClockDomain() | ||
| system.clk_domain.clock = "4GHz" | ||
| system.clk_domain.voltage_domain = VoltageDomain() | ||
| system.mem_mode = 'timing' | ||
|
|
||
| system.generator = PyTrafficGen() | ||
|
|
||
| system.mem_ctrl = DcacheCtrl() | ||
| system.mem_ctrl.dram = DDR3_1600_8x8(range=AddrRange('1GB'), in_addr_map=False) | ||
| system.mem_ctrl.nvm = NVM_2400_1x64(range=AddrRange('1GB')) | ||
|
|
||
| system.mem_ctrl.dram.tREFI = "1000" | ||
| system.mem_ctrl.orb_max_size = "512" | ||
| system.mem_ctrl.crb_max_size = "32" | ||
| #system.mem_ctrl.static_frontend_latency = "0ns" | ||
|
|
||
| system.mem_ranges = [AddrRange('1GB')] | ||
|
|
||
| system.generator.port = system.mem_ctrl.port | ||
|
|
||
| def createRandomTraffic(tgen): | ||
| yield tgen.createRandom(100000000000, # duration | ||
|
||
| 0, # min_addr | ||
| 16700000, # max_adr | ||
| 64, # block_size | ||
| 1000, # min_period | ||
| 1000, # max_period | ||
| 100, # rd_perc | ||
| 0) # data_limit | ||
| yield tgen.createExit(0) | ||
|
|
||
| def createLinearTraffic(tgen): | ||
| yield tgen.createLinear(100000000000, # duration | ||
| 0, # min_addr | ||
| 16700000, # max_adr | ||
| 64, # block_size | ||
| 1000, # min_period | ||
| 1000, # max_period | ||
| 100, # rd_perc | ||
| 0) # data_limit | ||
| yield tgen.createExit(0) | ||
|
|
||
|
|
||
| root = Root(full_system=False, system=system) | ||
|
|
||
| m5.instantiate() | ||
| system.generator.start(createRandomTraffic(system.generator)) | ||
| #system.generator.start(createLinearTraffic(system.generator)) | ||
|
Comment on lines
+52
to
+53
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be an option, too. Whatever things in this script that you want to change frequently should be command line options. That's the purpose of command line options :) |
||
| exit_event = m5.simulate() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs a newline at the end of the file. You should configure your editor to automatically add newlines at the end of the file and remove all trailing whitespace. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| from m5.params import * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs a copyright. |
||
| from m5.proxy import * | ||
|
|
||
| from m5.objects.AbstractMemory import AbstractMemory | ||
|
|
||
| # Enum for the address mapping. With Ch, Ra, Ba, Ro and Co denoting | ||
| # channel, rank, bank, row and column, respectively, and going from | ||
| # MSB to LSB. Available are RoRaBaChCo and RoRaBaCoCh, that are | ||
| # suitable for an open-page policy, optimising for sequential accesses | ||
| # hitting in the open row. For a closed-page policy, RoCoRaBaCh | ||
| # maximises parallelism. | ||
| class AddrMap(Enum): vals = ['RoRaBaChCo', 'RoRaBaCoCh', 'RoCoRaBaCh'] | ||
|
|
||
| class DCMemInterface(AbstractMemory): | ||
| type = 'DCMemInterface' | ||
| abstract = True | ||
| cxx_header = "mem/dcmem_interface.hh" | ||
|
|
||
| # Allow the interface to set required controller buffer sizes | ||
| # each entry corresponds to a burst for the specific memory channel | ||
| # configuration (e.g. x32 with burst length 8 is 32 bytes) and not | ||
| # the cacheline size or request/packet size | ||
| write_buffer_size = Param.Unsigned(64, "Number of write queue entries") | ||
| read_buffer_size = Param.Unsigned(32, "Number of read queue entries") | ||
|
|
||
| # scheduler, address map | ||
| addr_mapping = Param.AddrMap('RoRaBaCoCh', "Address mapping policy") | ||
|
|
||
| # size of memory device in Bytes | ||
| device_size = Param.MemorySize("Size of memory device") | ||
| # the physical organisation of the memory | ||
| device_bus_width = Param.Unsigned("data bus width in bits for each "\ | ||
| "memory device/chip") | ||
| burst_length = Param.Unsigned("Burst lenght (BL) in beats") | ||
| device_rowbuffer_size = Param.MemorySize("Page (row buffer) size per "\ | ||
| "device/chip") | ||
| devices_per_rank = Param.Unsigned("Number of devices/chips per rank") | ||
| ranks_per_channel = Param.Unsigned("Number of ranks per channel") | ||
| banks_per_rank = Param.Unsigned("Number of banks per rank") | ||
|
|
||
| # timing behaviour and constraints - all in nanoseconds | ||
|
|
||
| # the base clock period of the memory | ||
| tCK = Param.Latency("Clock period") | ||
|
|
||
| # time to complete a burst transfer, typically the burst length | ||
| # divided by two due to the DDR bus, but by making it a parameter | ||
| # it is easier to also evaluate SDR memories like WideIO and new | ||
| # interfaces, emerging technologies. | ||
| # This parameter has to account for burst length. | ||
| # Read/Write requests with data size larger than one full burst are broken | ||
| # down into multiple requests in the controller | ||
| tBURST = Param.Latency("Burst duration " | ||
| "(typically burst length / 2 cycles)") | ||
|
|
||
| # write-to-read, same rank turnaround penalty | ||
| tWTR = Param.Latency("Write to read, same rank switching time") | ||
|
|
||
| # read-to-write, same rank turnaround penalty | ||
| tRTW = Param.Latency("Read to write, same rank switching time") | ||
|
|
||
| # rank-to-rank bus delay penalty | ||
| # this does not correlate to a memory timing parameter and encompasses: | ||
| # 1) RD-to-RD, 2) WR-to-WR, 3) RD-to-WR, and 4) WR-to-RD | ||
| # different rank bus delay | ||
| tCS = Param.Latency("Rank to rank switching time") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be committed.
I strongly suggest creating a PR like this, then looking at it yourself and doing a "self review" to fix some of these low hanging fruits