mirror of https://github.com/YosysHQ/icestorm.git
Fix make_ram40 for UltraPlus
Sometimes make_ram40 was assigning too many IO pins, causing a placment failure, and also sometimes connecting a global clock net to WCLKE or RCLKE which was also causing a placment failure.
This commit is contained in:
parent
42047c6114
commit
172d561b01
|
|
@ -14,6 +14,10 @@ os.mkdir(working_dir)
|
||||||
for idx in range(num):
|
for idx in range(num):
|
||||||
with open(working_dir + "/ram40_%02d.v" % idx, "w") as f:
|
with open(working_dir + "/ram40_%02d.v" % idx, "w") as f:
|
||||||
glbs = ["glb[%d]" % i for i in range(np.random.randint(8)+1)]
|
glbs = ["glb[%d]" % i for i in range(np.random.randint(8)+1)]
|
||||||
|
# Connecting GLB to CE pins seemingly disallowed
|
||||||
|
if device_class == "5k":
|
||||||
|
glbs_choice = ["wa", "ra", "msk", "wd", "we", "wc", "re", "rc"]
|
||||||
|
else:
|
||||||
glbs_choice = ["wa", "ra", "msk", "wd", "we", "wce", "wc", "re", "rce", "rc"]
|
glbs_choice = ["wa", "ra", "msk", "wd", "we", "wce", "wc", "re", "rce", "rc"]
|
||||||
print("""
|
print("""
|
||||||
module top (
|
module top (
|
||||||
|
|
@ -26,7 +30,7 @@ for idx in range(num):
|
||||||
.USER_SIGNAL_TO_GLOBAL_BUFFER(glb_pins),
|
.USER_SIGNAL_TO_GLOBAL_BUFFER(glb_pins),
|
||||||
.GLOBAL_BUFFER_OUTPUT(glb)
|
.GLOBAL_BUFFER_OUTPUT(glb)
|
||||||
);
|
);
|
||||||
""" % (len(glbs)-1, len(pins) - 16 - 1, len(glbs)-1, len(glbs)-1), file=f)
|
""" % (len(glbs)-1, len(pins) - len(glbs) - 16 - 1, len(glbs)-1, len(glbs)-1), file=f)
|
||||||
bits = ["in_pins[%d]" % i for i in range(60)]
|
bits = ["in_pins[%d]" % i for i in range(60)]
|
||||||
bits = list(np.random.permutation(bits))
|
bits = list(np.random.permutation(bits))
|
||||||
for i in range(num_ramb40):
|
for i in range(num_ramb40):
|
||||||
|
|
@ -102,7 +106,7 @@ for idx in range(num):
|
||||||
print("endmodule", file=f)
|
print("endmodule", file=f)
|
||||||
with open(working_dir + "/ram40_%02d.pcf" % idx, "w") as f:
|
with open(working_dir + "/ram40_%02d.pcf" % idx, "w") as f:
|
||||||
p = list(np.random.permutation(pins))
|
p = list(np.random.permutation(pins))
|
||||||
for i in range(len(pins) - 16):
|
for i in range(len(pins) - len(glbs) - 16):
|
||||||
print("set_io in_pins[%d] %s" % (i, p.pop()), file=f)
|
print("set_io in_pins[%d] %s" % (i, p.pop()), file=f)
|
||||||
for i in range(16):
|
for i in range(16):
|
||||||
print("set_io out_pins[%d] %s" % (i, p.pop()), file=f)
|
print("set_io out_pins[%d] %s" % (i, p.pop()), file=f)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue