Fixes for LP384 in some make_xx.py, etc

This commit is contained in:
hermitsoft 2017-03-07 18:11:07 +01:00
parent 2281f91536
commit 2ca9f929ac
4 changed files with 22 additions and 10 deletions

View File

@ -100,10 +100,11 @@ else
ICE384PINS=1 python3 make_$(1).py
+ICEDEV=lp384-qn32 $(MAKE) -C work_$(1)
python3 extract.py -3 work_$(1)/*.glb > $$@
endif
else
python3 make_$(1).py
+$(MAKE) -C work_$(1)
python3 extract.py work_$(1)/*.glb > $$@
endif
endif
endef

View File

@ -394,5 +394,6 @@ if [ -n "$ICE_SBTIMER_LP" ]; then
cp "$1.tmp"/outputs/netlist/top_timing_lp.rpt "$1.rlp"
fi
export LD_LIBRARY_PATH=""
$scriptdir/../icepack/iceunpack "$1.bin" "$1.asc"

View File

@ -9,15 +9,20 @@ os.mkdir("work_fanout")
for idx in range(num):
with open("work_fanout/fanout_%02d.v" % idx, "w") as f:
print("module top(input [1:0] a, output [63:0] y);", file=f)
print(" assign y = {32{a}};", file=f)
if os.getenv('ICE384PINS'):
print("module top(input [1:0] a, output [15:0] y);", file=f)
print(" assign y = {8{a}};", file=f)
else:
print("module top(input [1:0] a, output [63:0] y);", file=f)
print(" assign y = {32{a}};", file=f)
print("endmodule", file=f)
with open("work_fanout/fanout_%02d.pcf" % idx, "w") as f:
p = np.random.permutation(pins)
for i in range(64):
r = 16 if os.getenv('ICE384PINS') else 64
for i in range(r):
print("set_io y[%d] %s" % (i, p[i]), file=f)
print("set_io a[0] %s" % p[64], file=f)
print("set_io a[1] %s" % p[65], file=f)
print("set_io a[0] %s" % p[r], file=f)
print("set_io a[1] %s" % p[r+1], file=f)
with open("work_fanout/Makefile", "w") as f:
print("all: %s" % " ".join(["fanout_%02d.bin" % i for i in range(num)]), file=f)

View File

@ -9,15 +9,20 @@ os.mkdir("work_mesh")
for idx in range(num):
with open("work_mesh/mesh_%02d.v" % idx, "w") as f:
print("module top(input [39:0] a, output [39:0] y);", file=f)
if os.getenv('ICE384PINS'):
print("module top(input [9:0] a, output [9:0] y);", file=f)
else:
print("module top(input [39:0] a, output [39:0] y);", file=f)
print(" assign y = a;", file=f)
print("endmodule", file=f)
with open("work_mesh/mesh_%02d.pcf" % idx, "w") as f:
p = np.random.permutation(pins)
for i in range(40):
if os.getenv('ICE384PINS'): r = 10
else: r = 40
for i in range(r):
print("set_io a[%d] %s" % (i, p[i]), file=f)
for i in range(40):
print("set_io y[%d] %s" % (i, p[40+i]), file=f)
for i in range(r):
print("set_io y[%d] %s" % (i, p[r+i]), file=f)
with open("work_mesh/Makefile", "w") as f:
print("all: %s" % " ".join(["mesh_%02d.bin" % i for i in range(num)]), file=f)