test: add number of generators/checkers to benchmark runner, update metrics
This commit is contained in:
parent
edf4ddb2f2
commit
4f613b5b00
|
@ -87,13 +87,16 @@ class CustomAccess(Settings):
|
|||
|
||||
|
||||
class BenchmarkConfiguration(Settings):
|
||||
def __init__(self, name, sdram_module, sdram_data_width, bist_alternating, access_pattern):
|
||||
def __init__(self, name, sdram_module, sdram_data_width, bist_alternating,
|
||||
num_generators, num_checkers, access_pattern):
|
||||
self.set_attributes(locals())
|
||||
|
||||
def as_args(self):
|
||||
args = [
|
||||
'--sdram-module=%s' % self.sdram_module,
|
||||
'--sdram-data-width=%d' % self.sdram_data_width,
|
||||
'--num-generators=%d' % self.num_generators,
|
||||
'--num-checkers=%d' % self.num_checkers,
|
||||
]
|
||||
if self.bist_alternating:
|
||||
args.append('--bist-alternating')
|
||||
|
@ -222,6 +225,8 @@ class ResultsSummary:
|
|||
'sdram_module': lambda d: d.config.sdram_module,
|
||||
'sdram_data_width': lambda d: d.config.sdram_data_width,
|
||||
'bist_alternating': lambda d: d.config.bist_alternating,
|
||||
'num_generators': lambda d: d.config.num_generators,
|
||||
'num_checkers': lambda d: d.config.num_checkers,
|
||||
'bist_length': lambda d: getattr(d.config.access_pattern, 'bist_length', None),
|
||||
'bist_random': lambda d: getattr(d.config.access_pattern, 'bist_random', None),
|
||||
'pattern_file': lambda d: getattr(d.config.access_pattern, 'pattern_file', None),
|
||||
|
@ -240,12 +245,16 @@ class ResultsSummary:
|
|||
|
||||
# compute other metrics based on ticks and configuration parameters
|
||||
df['clk_period'] = 1 / df['clk_freq']
|
||||
df['write_bandwidth'] = (8 * df['length']) / (df['generator_ticks'] * df['clk_period'])
|
||||
df['read_bandwidth'] = (8 * df['length']) / (df['checker_ticks'] * df['clk_period'])
|
||||
# bandwidth is the number of bits per time
|
||||
# in case with N generators/checkers we actually process N times more data
|
||||
df['write_bandwidth'] = (8 * df['length'] * df['num_generators']) / (df['generator_ticks'] * df['clk_period'])
|
||||
df['read_bandwidth'] = (8 * df['length'] * df['num_checkers']) / (df['checker_ticks'] * df['clk_period'])
|
||||
|
||||
# efficiency calculated as number of write/read commands to number of cycles spent on writing/reading (ticks)
|
||||
# for multiple generators/checkers multiply by their number
|
||||
df['cmd_count'] = df['length'] / (df['ctrl_data_width'] / 8)
|
||||
df['write_efficiency'] = df['cmd_count'] / df['generator_ticks']
|
||||
df['read_efficiency'] = df['cmd_count'] / df['checker_ticks']
|
||||
df['write_efficiency'] = df['cmd_count'] * df['num_generators'] / df['generator_ticks']
|
||||
df['read_efficiency'] = df['cmd_count'] * df['num_checkers'] / df['checker_ticks']
|
||||
|
||||
df['write_latency'] = df[df['bist_length'] == 1]['generator_ticks']
|
||||
df['read_latency'] = df[df['bist_length'] == 1]['checker_ticks']
|
||||
|
@ -313,7 +322,7 @@ class ResultsSummary:
|
|||
|
||||
formatters = self.text_formatters if formatted else {}
|
||||
|
||||
common_columns = ['name', 'sdram_module', 'sdram_data_width', 'bist_alternating']
|
||||
common_columns = ['name', 'sdram_module', 'sdram_data_width', 'bist_alternating', 'num_generators', 'num_checkers']
|
||||
latency_columns = ['write_latency', 'read_latency']
|
||||
performance_columns = ['write_bandwidth', 'read_bandwidth', 'write_efficiency', 'read_efficiency']
|
||||
|
||||
|
|
Loading…
Reference in New Issue