Fix pmgen for out-of-tree build

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2019-02-28 14:00:58 -08:00
parent 069801e441
commit 64d91219b4
2 changed files with 6 additions and 4 deletions

View File

@ -4,5 +4,5 @@ passes/pmgen/ice40_dsp.o: passes/pmgen/ice40_dsp_pm.h
EXTRA_OBJS += passes/pmgen/ice40_dsp_pm.h
.SECONDARY: passes/pmgen/ice40_dsp_pm.h
passes/pmgen/ice40_dsp_pm.h: passes/pmgen/ice40_dsp.pmg passes/pmgen/pmgen.py
$(P) cd passes/pmgen && python3 pmgen.py ice40_dsp
passes/pmgen/ice40_dsp_pm.h: passes/pmgen/pmgen.py passes/pmgen/ice40_dsp.pmg
$(P) mkdir -p passes/pmgen && cd passes/pmgen && python3 $^

View File

@ -6,7 +6,9 @@ import pprint
pp = pprint.PrettyPrinter(indent=4)
prefix = sys.argv[1]
pmgfile = sys.argv[1]
prefix = pmgfile.split("/")[-1]
prefix = prefix.split(".")[0]
state_types = dict()
udata_types = dict()
@ -73,7 +75,7 @@ def rewrite_cpp(s):
return "".join(t)
with open("%s.pmg" % prefix, "r") as f:
with open(pmgfile, "r") as f:
while True:
line = f.readline()
if line == "": break