1 from enum
import Enum
, unique
8 file_dir
= os
.path
.dirname(os
.path
.realpath(__file__
))
9 file_path
= os
.path
.join(file_dir
, name
)
10 if not os
.path
.isfile(file_path
):
11 url
= 'https://libre-riscv.org/openpower/isatables/' + name
12 r
= requests
.get(url
, allow_redirects
=True)
13 with
open(file_path
, 'w') as outfile
:
14 outfile
.write(r
.content
.decode("utf-8"))
15 with
open(file_path
, 'r') as csvfile
:
16 reader
= csv
.DictReader(csvfile
)
20 # names of the fields in the tables that don't correspond to an enum
21 single_bit_flags
= ['CR in', 'CR out', 'inv A', 'inv out',
22 'cry out', 'BR', 'sgn ext', 'upd', 'rsrv', '32b',
23 'sgn', 'lk', 'sgl pipe']
26 def get_signal_name(name
):
27 return name
.lower().replace(' ', '_')
37 class InternalOp(Enum
):