ecp5: Script for BRAM IO connections
authorDavid Shah <dave@ds0.me>
Wed, 10 Oct 2018 15:11:00 +0000 (16:11 +0100)
committerDavid Shah <dave@ds0.me>
Wed, 10 Oct 2018 15:11:00 +0000 (16:11 +0100)
Signed-off-by: David Shah <dave@ds0.me>
techlibs/ecp5/.gitignore
techlibs/ecp5/bram_map.v [new file with mode: 0644]
techlibs/ecp5/brams_connect.py [new file with mode: 0755]
techlibs/ecp5/cells_sim.v

index 84d26081035d2dacbc4adf628e7db7916805aeef..3f66045f8be990e7fb397f5fb6f23d71b677494f 100644 (file)
@@ -1,3 +1,8 @@
 bram_init_1_2_4.vh
 bram_init_9_18_36.vh
 brams_init.mk
+bram_conn_1.vh
+bram_conn_2.vh
+bram_conn_4.vh
+bram_conn_9.vh
+bram_conn_18.vh
diff --git a/techlibs/ecp5/bram_map.v b/techlibs/ecp5/bram_map.v
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/techlibs/ecp5/brams_connect.py b/techlibs/ecp5/brams_connect.py
new file mode 100755 (executable)
index 0000000..f86dcfc
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env python3
+
+def write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits):
+    ada_conn = [".ADA%d(%s)" % (i, ada_bits[i]) for i in range(len(ada_bits))]
+    adb_conn = [".ADB%d(%s)" % (i, adb_bits[i]) for i in range(len(adb_bits))]
+    dia_conn = [".DIA%d(%s)" % (i, dia_bits[i]) for i in range(len(dia_bits))]
+    dob_conn = [".DOB%d(%s)" % (i, dob_bits[i]) for i in range(len(dob_bits))]
+    print("    %s," % ", ".join(ada_conn), file=f)
+    print("    %s," % ", ".join(adb_conn), file=f)
+    print("    %s," % ", ".join(dia_conn), file=f)
+    print("    %s," % ", ".join(dob_conn), file=f)
+
+with open("techlibs/ecp5/bram_conn_1.vh", "w") as f:
+    ada_bits = ["A1ADDR[%d]" % i for i in range(14)]
+    adb_bits = ["B1ADDR[%d]" % i for i in range(14)]
+    dia_bits = ["A1DATA[0]"] + ["1'b0" for i in range(17)]
+    dob_bits = ["B1DATA[0]"]
+    write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits)
+
+with open("techlibs/ecp5/bram_conn_2.vh", "w") as f:
+    ada_bits = ["1'b0"] + ["A1ADDR[%d]" % i for i in range(13)]
+    adb_bits = ["1'b0"] + ["B1ADDR[%d]" % i for i in range(13)]
+    dia_bits = ["A1DATA[%d]" % i for i in range(2)] + ["1'b0" for i in range(16)]
+    dob_bits = ["B1DATA[%d]" % i for i in range(2)]
+    write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits)
+
+with open("techlibs/ecp5/bram_conn_4.vh", "w") as f:
+    ada_bits = ["1'b0", "1'b0"] + ["A1ADDR[%d]" % i for i in range(12)]
+    adb_bits = ["1'b0", "1'b0"] + ["B1ADDR[%d]" % i for i in range(12)]
+    dia_bits = ["A1DATA[%d]" % i for i in range(4)] + ["1'b0" for i in range(14)]
+    dob_bits = ["B1DATA[%d]" % i for i in range(4)]
+    write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits)
+
+with open("techlibs/ecp5/bram_conn_9.vh", "w") as f:
+    ada_bits = ["1'b0", "1'b0", "1'b0"] + ["A1ADDR[%d]" % i for i in range(11)]
+    adb_bits = ["1'b0", "1'b0", "1'b0"] + ["B1ADDR[%d]" % i for i in range(11)]
+    dia_bits = ["A1DATA[%d]" % i for i in range(9)] + ["1'b0" for i in range(9)]
+    dob_bits = ["B1DATA[%d]" % i for i in range(9)]
+    write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits)
+
+with open("techlibs/ecp5/bram_conn_18.vh", "w") as f:
+    ada_bits = ["A1EN[0]", "A1EN[1]", "1'b0", "1'b0"] + ["A1ADDR[%d]" % i for i in range(10)]
+    adb_bits = ["1'b0", "1'b0", "1'b0", "1'b0"] + ["B1ADDR[%d]" % i for i in range(10)]
+    dia_bits = ["A1DATA[%d]" % i for i in range(18)]
+    dob_bits = ["B1DATA[%d]" % i for i in range(18)]
+    write_bus_ports(f, ada_bits, adb_bits, dia_bits, dob_bits)
index 3e7e83aac488de5991200f05ac5ae8e1f0808b4b..4732381caf4a9f1481ab955b82860b04526b1e4a 100644 (file)
@@ -478,68 +478,68 @@ module DP16KD(
 
   parameter GSR = "ENABLED";
 
-  parameter INITVAL_00 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_01 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_02 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_03 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_04 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_05 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_06 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_07 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_08 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_09 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0A = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0B = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0C = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0D = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0E = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_0F = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_10 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_11 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_12 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_13 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_14 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_15 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_16 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_17 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_18 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_19 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1A = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1B = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1C = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1D = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1E = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_1F = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_20 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_21 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_22 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_23 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_24 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_25 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_26 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_27 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_28 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_29 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2A = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2B = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2C = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2D = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2E = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_2F = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_30 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_31 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_32 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_33 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_34 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_35 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_36 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_37 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_38 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_39 = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3A = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3B = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3C = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3D = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3E = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
-  parameter INITVAL_3F = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000";
+  parameter INITVAL_00 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_01 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_02 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_03 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_04 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_05 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_06 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_07 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_08 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_09 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0A = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0B = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0C = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0D = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0E = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_0F = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_10 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_11 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_12 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_13 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_14 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_15 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_16 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_17 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_18 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_19 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1A = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1B = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1C = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1D = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1E = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_1F = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_20 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_21 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_22 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_23 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_24 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_25 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_26 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_27 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_28 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_29 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2A = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2B = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2C = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2D = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2E = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_2F = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_30 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_31 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_32 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_33 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_34 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_35 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_36 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_37 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_38 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_39 = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3A = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3B = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3C = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3D = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3E = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
+  parameter INITVAL_3F = 320'h00000000000000000000000000000000000000000000000000000000000000000000000000000000;
 endmodule