test: add number of generators/checkers to benchmark runner, update metrics

This commit is contained in:
Jędrzej Boczar 2020-02-12 14:20:21 +01:00
parent edf4ddb2f2
commit 4f613b5b00
1 changed files with 15 additions and 6 deletions

View File

@ -87,13 +87,16 @@ class CustomAccess(Settings):
class BenchmarkConfiguration(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()) self.set_attributes(locals())
def as_args(self): def as_args(self):
args = [ args = [
'--sdram-module=%s' % self.sdram_module, '--sdram-module=%s' % self.sdram_module,
'--sdram-data-width=%d' % self.sdram_data_width, '--sdram-data-width=%d' % self.sdram_data_width,
'--num-generators=%d' % self.num_generators,
'--num-checkers=%d' % self.num_checkers,
] ]
if self.bist_alternating: if self.bist_alternating:
args.append('--bist-alternating') args.append('--bist-alternating')
@ -222,6 +225,8 @@ class ResultsSummary:
'sdram_module': lambda d: d.config.sdram_module, 'sdram_module': lambda d: d.config.sdram_module,
'sdram_data_width': lambda d: d.config.sdram_data_width, 'sdram_data_width': lambda d: d.config.sdram_data_width,
'bist_alternating': lambda d: d.config.bist_alternating, '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_length': lambda d: getattr(d.config.access_pattern, 'bist_length', None),
'bist_random': lambda d: getattr(d.config.access_pattern, 'bist_random', 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), '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 # compute other metrics based on ticks and configuration parameters
df['clk_period'] = 1 / df['clk_freq'] df['clk_period'] = 1 / df['clk_freq']
df['write_bandwidth'] = (8 * df['length']) / (df['generator_ticks'] * df['clk_period']) # bandwidth is the number of bits per time
df['read_bandwidth'] = (8 * df['length']) / (df['checker_ticks'] * df['clk_period']) # 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['cmd_count'] = df['length'] / (df['ctrl_data_width'] / 8)
df['write_efficiency'] = df['cmd_count'] / df['generator_ticks'] df['write_efficiency'] = df['cmd_count'] * df['num_generators'] / df['generator_ticks']
df['read_efficiency'] = df['cmd_count'] / df['checker_ticks'] df['read_efficiency'] = df['cmd_count'] * df['num_checkers'] / df['checker_ticks']
df['write_latency'] = df[df['bist_length'] == 1]['generator_ticks'] df['write_latency'] = df[df['bist_length'] == 1]['generator_ticks']
df['read_latency'] = df[df['bist_length'] == 1]['checker_ticks'] df['read_latency'] = df[df['bist_length'] == 1]['checker_ticks']
@ -313,7 +322,7 @@ class ResultsSummary:
formatters = self.text_formatters if formatted else {} 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'] latency_columns = ['write_latency', 'read_latency']
performance_columns = ['write_bandwidth', 'read_bandwidth', 'write_efficiency', 'read_efficiency'] performance_columns = ['write_bandwidth', 'read_bandwidth', 'write_efficiency', 'read_efficiency']