From c75ed478fa1d3d2fc8336818cdefe0b1c0ba72ef Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Mon, 4 Sep 2017 23:37:39 -0400 Subject: WIP on reg alloc --- etc/compile-by-zinc/make-graph-with-reg.py | 38 ++---------------------------- 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'etc/compile-by-zinc/make-graph-with-reg.py') diff --git a/etc/compile-by-zinc/make-graph-with-reg.py b/etc/compile-by-zinc/make-graph-with-reg.py index 275f45e25..12357bf1b 100755 --- a/etc/compile-by-zinc/make-graph-with-reg.py +++ b/etc/compile-by-zinc/make-graph-with-reg.py @@ -8,7 +8,7 @@ LAMBDA = u'\u03bb' OP_NAMES = {'*':'MUL', '+':'ADD', '>>':'SHL', '<<':'SHR', '|':'OR', '&':'AND'} -REGISTERS = tuple(['RAX', 'RBX', 'RCX', 'RDX', 'RSI', 'RDI', 'RBP', 'RSP'] +REGISTERS = tuple(['RAX', 'RBX', 'RCX', 'RDX', 'RSI', 'RDI', 'RBP'] #, 'RSP'] # RSP is stack pointer? + ['r%d' % i for i in range(8, 16)]) REGISTER_COLORS = ['color="black"', 'color="white",fillcolor="black"', 'color="maroon"', 'color="green"', 'fillcolor="olive"', 'color="navy"', 'color="purple"', 'fillcolor="teal"', 'fillcolor="silver"', 'fillcolor="gray"', 'fillcolor="red"', @@ -18,40 +18,6 @@ COLOR_FOR_REGISTER = dict(zip(REGISTERS, REGISTER_COLORS)) MAX_INSTRUCTION_WINDOW = 10000 -CORE_DATA = (('ADD_MUL', 2), ('MUL_CORE', 1), ('LEA_BW', 2)) -CORES = tuple(name for name, count in CORE_DATA) -CORE_COUNT = dict(CORE_DATA) - -BITWISE_CORES = tuple({ - 'core' : { 'name' : core_name , 'latency' : 1 }, - 'latency' : 1 - } for core_name in ('LEA_BW',)) - -MODEL = { - '*': tuple({ - 'core' : { 'name' : core_name , 'latency' : 1 }, - 'latency' : 3 - } - for core_name in ('ADD_MUL', 'MUL_CORE')), - '+': tuple({ - 'core' : { 'name' : core_name , 'latency' : 1 }, - 'latency' : 1 - } - for core_name in ('ADD_MUL', 'LEA_BW')), - '>>': BITWISE_CORES, - '<<': BITWISE_CORES, - '|': BITWISE_CORES, - '&': BITWISE_CORES, - 'LOAD': tuple({ - 'core' : { 'name' : core_name , 'latency' : 1 }, - 'latency' : 1 - } for core_name in REGISTERS), - 'STORE': tuple({ - 'core' : { 'name' : core_name , 'latency' : 1 }, - 'latency' : 1 - } for core_name in REGISTERS) - } - def get_lines(filename): with codecs.open(filename, 'r', encoding='utf8') as f: lines = f.read().replace('\r\n', '\n') @@ -281,7 +247,7 @@ def adjust_bits(input_data, graph): if line['type'] == 'uint128_t': graph = graph.replace(line['out'], line['out'] + '_128') return graph - + data_list = parse_lines(get_lines('femulDisplay.log')) for i, data in enumerate(data_list): -- cgit v1.2.3