From: Luke Kenneth Casson Leighton Date: Thu, 26 Nov 2020 21:03:26 +0000 (+0000) Subject: add constant-detection into sv_analysis.py X-Git-Tag: convert-csv-opcode-to-binary~1651 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c5b12e639aaf1828d2ee40522cc714265a89dbb;p=libreriscv.git add constant-detection into sv_analysis.py --- diff --git a/openpower/sv_analysis.py b/openpower/sv_analysis.py index 2066b17ee..57f5153d9 100644 --- a/openpower/sv_analysis.py +++ b/openpower/sv_analysis.py @@ -49,7 +49,7 @@ def isreg(field): keycolumns = ['unit', 'in1', 'in2', 'in3', 'out', 'CR in', 'CR out', ] # don't think we need these: 'ldst len', 'rc', 'lk'] -tablecols = ['unit', 'in', 'outcnt', 'CR in', 'CR out', +tablecols = ['unit', 'in', 'outcnt', 'CR in', 'CR out', 'imm' ] # don't think we need these: 'ldst len', 'rc', 'lk'] def create_key(row): @@ -106,6 +106,12 @@ def create_key(row): res['in'] = str(res['in']) res['outcnt'] = str(res['outcnt']) + # constants + if row['in2'].startswith('CONST_'): + res['imm'] = row['in2'].split("_")[1] + else: + res['imm'] = '' + return res # @@ -132,6 +138,8 @@ def keyname(row): res.append("CRi") elif row['CR out'] == '1': res.append("CRo") + elif 'imm' in row: + res.append("imm") return '-'.join(res)