Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions checks/genchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

cfgname = "checks"
basedir = "%s/../.." % os.getcwd()
incdir = basedir
corename = os.getcwd().split("/")[-1]
solver = "boolector"
dumpsmt2 = False
Expand All @@ -37,8 +38,12 @@
mode = "bmc"

if len(sys.argv) > 1:
assert len(sys.argv) == 2
assert 2 <= len(sys.argv) <= 4
cfgname = sys.argv[1]
if len(sys.argv) > 2:
basedir = sys.argv[2]
if len(sys.argv) > 3:
incdir = sys.argv[3]

print("Reading %s.cfg." % cfgname)
with open("%s.cfg" % cfgname, "r") as f:
Expand Down Expand Up @@ -134,6 +139,7 @@ def print_hfmt(f, text, **kwargs):

hargs = dict()
hargs["basedir"] = basedir
hargs["incdir"] = incdir
hargs["core"] = corename
hargs["nret"] = nret
hargs["xlen"] = xlen
Expand Down Expand Up @@ -333,7 +339,7 @@ def check_insn(grp, insn, chanidx, csr_mode=False):
print(line, file=sby_file)

for grp in groups:
with open("../../insns/isa_%s.txt" % isa) as isa_file:
with open("%s/insns/isa_%s.txt" % (basedir, isa)) as isa_file:
for insn in isa_file:
for chanidx in range(nret):
check_insn(grp, insn.strip(), chanidx)
Expand Down