sweep.py (10323:5169ebd26163) | sweep.py (10392:0100f00a229e) |
---|---|
1# Copyright (c) 2014 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 44 unchanged lines hidden (view full) --- 53 54parser = optparse.OptionParser() 55 56# Use a single-channel DDR3-1600 x64 by default 57parser.add_option("--mem-type", type="choice", default="ddr3_1600_x64", 58 choices=MemConfig.mem_names(), 59 help = "type of memory to use") 60 | 1# Copyright (c) 2014 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 44 unchanged lines hidden (view full) --- 53 54parser = optparse.OptionParser() 55 56# Use a single-channel DDR3-1600 x64 by default 57parser.add_option("--mem-type", type="choice", default="ddr3_1600_x64", 58 choices=MemConfig.mem_names(), 59 help = "type of memory to use") 60 |
61parser.add_option("--ranks", "-r", type="int", default=1, 62 help = "Number of ranks to iterate across") 63 64parser.add_option("--rd_perc", type="int", default=100, 65 help = "Percentage of read commands") 66 67parser.add_option("--mode", type="choice", default="DRAM", 68 choices=["DRAM", "DRAM_ROTATE"], 69 help = "DRAM: Random traffic; \ 70 DRAM_ROTATE: Traffic rotating across banks and ranks") 71 72parser.add_option("--addr_map", type="int", default=1, 73 help = "0: RoCoRaBaCh; 1: RoRaBaCoCh/RoRaBaChCo") 74 |
|
61(options, args) = parser.parse_args() 62 63if args: 64 print "Error: script doesn't take any positional arguments" 65 sys.exit(1) 66 67# at the moment we stay with the default open-adaptive page policy, 68# and address mapping --- 15 unchanged lines hidden (view full) --- 84options.mem_channels = 1 85MemConfig.config_mem(options, system) 86 87# the following assumes that we are using the native DRAM 88# controller, check to be sure 89if not isinstance(system.mem_ctrls[0], m5.objects.DRAMCtrl): 90 fatal("This script assumes the memory is a DRAMCtrl subclass") 91 | 75(options, args) = parser.parse_args() 76 77if args: 78 print "Error: script doesn't take any positional arguments" 79 sys.exit(1) 80 81# at the moment we stay with the default open-adaptive page policy, 82# and address mapping --- 15 unchanged lines hidden (view full) --- 98options.mem_channels = 1 99MemConfig.config_mem(options, system) 100 101# the following assumes that we are using the native DRAM 102# controller, check to be sure 103if not isinstance(system.mem_ctrls[0], m5.objects.DRAMCtrl): 104 fatal("This script assumes the memory is a DRAMCtrl subclass") 105 |
92# for now the generator assumes a single rank 93system.mem_ctrls[0].ranks_per_channel = 1 | 106# Set number of ranks based on input argument; default is 1 rank 107system.mem_ctrls[0].ranks_per_channel = options.ranks |
94 | 108 |
109# Set the address mapping based on input argument 110# Default to RoRaBaCoCh 111if options.addr_map == 0: 112 system.mem_ctrls[0].addr_mapping = "RoCoRaBaCh" 113elif options.addr_map == 1: 114 system.mem_ctrls[0].addr_mapping = "RoRaBaCoCh" 115else: 116 fatal("Did not specify a valid address map argument") 117 |
|
95# stay in each state for 0.25 ms, long enough to warm things up, and 96# short enough to avoid hitting a refresh 97period = 250000000 98 99# this is where we go off piste, and print the traffic generator 100# configuration that we will later use, crazy but it works 101cfg_file_name = "configs/dram/sweep.cfg" 102cfg_file = open(cfg_file_name, 'w') --- 26 unchanged lines hidden (view full) --- 129max_stride = min(512, page_size) 130 131# now we create the state by iterating over the stride size from burst 132# size to the max stride, and from using only a single bank up to the 133# number of banks available 134nxt_state = 0 135for bank in range(1, nbr_banks + 1): 136 for stride_size in range(burst_size, max_stride + 1, burst_size): | 118# stay in each state for 0.25 ms, long enough to warm things up, and 119# short enough to avoid hitting a refresh 120period = 250000000 121 122# this is where we go off piste, and print the traffic generator 123# configuration that we will later use, crazy but it works 124cfg_file_name = "configs/dram/sweep.cfg" 125cfg_file = open(cfg_file_name, 'w') --- 26 unchanged lines hidden (view full) --- 152max_stride = min(512, page_size) 153 154# now we create the state by iterating over the stride size from burst 155# size to the max stride, and from using only a single bank up to the 156# number of banks available 157nxt_state = 0 158for bank in range(1, nbr_banks + 1): 159 for stride_size in range(burst_size, max_stride + 1, burst_size): |
137 cfg_file.write("STATE %d %d DRAM 100 0 %d " 138 "%d %d %d %d %d %d %d %d 1\n" % 139 (nxt_state, period, max_addr, burst_size, itt, itt, 0, 140 stride_size, page_size, nbr_banks, bank)) | 160 cfg_file.write("STATE %d %d %s %d 0 %d %d " 161 "%d %d %d %d %d %d %d %d %d\n" % 162 (nxt_state, period, options.mode, options.rd_perc, 163 max_addr, burst_size, itt, itt, 0, stride_size, 164 page_size, nbr_banks, bank, options.addr_map, 165 options.ranks)) |
141 nxt_state = nxt_state + 1 142 143cfg_file.write("INIT 0\n") 144 145# go through the states one by one 146for state in range(1, nxt_state): 147 cfg_file.write("TRANSITION %d %d 1\n" % (state - 1, state)) 148 --- 29 unchanged lines hidden --- | 166 nxt_state = nxt_state + 1 167 168cfg_file.write("INIT 0\n") 169 170# go through the states one by one 171for state in range(1, nxt_state): 172 cfg_file.write("TRANSITION %d %d 1\n" % (state - 1, state)) 173 --- 29 unchanged lines hidden --- |