Signed-off-by: Clifford Wolf <clifford@clifford.at>
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 $^
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()
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