aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-17 15:53:17 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-17 15:53:17 +0200
commit6f4af8387e70ec7902e5a06faa87eb4bba28eadf (patch)
treef9fd386ab82e015b694c104faa4eaa6b6d5ce0e5 /ice40
parent5d46ff54bae1d5b4f447b21fea70ea76ad5f64bb (diff)
downloadnextpnr-6f4af8387e70ec7902e5a06faa87eb4bba28eadf.tar.gz
nextpnr-6f4af8387e70ec7902e5a06faa87eb4bba28eadf.tar.bz2
nextpnr-6f4af8387e70ec7902e5a06faa87eb4bba28eadf.zip
Move PackageInfoPOD to ice40 chipdb blob
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/chip.cc2
-rw-r--r--ice40/chip.h6
-rw-r--r--ice40/chipdb.py14
3 files changed, 12 insertions, 10 deletions
diff --git a/ice40/chip.cc b/ice40/chip.cc
index 7b1afd2e..49821e68 100644
--- a/ice40/chip.cc
+++ b/ice40/chip.cc
@@ -102,7 +102,7 @@ Chip::Chip(ChipArgs args) : args(args)
package_info = nullptr;
for (int i = 0; i < chip_info.num_packages; i++) {
- if (chip_info.packages_data[i].name == args.package) {
+ if (chip_info.packages_data[i].name.get() == args.package) {
package_info = &(chip_info.packages_data[i]);
break;
}
diff --git a/ice40/chip.h b/ice40/chip.h
index 2c7b7d0e..2e08b67b 100644
--- a/ice40/chip.h
+++ b/ice40/chip.h
@@ -151,9 +151,9 @@ struct PackagePinPOD
struct PackageInfoPOD
{
- const char *name;
- int num_pins;
- PackagePinPOD *pins;
+ RelPtr<char> name;
+ int32_t num_pins;
+ RelPtr<PackagePinPOD> pins;
} __attribute__((packed));
enum TileType : uint32_t
diff --git a/ice40/chipdb.py b/ice40/chipdb.py
index c6511e4e..4f7951e2 100644
--- a/ice40/chipdb.py
+++ b/ice40/chipdb.py
@@ -679,11 +679,11 @@ for package in packages:
pin_bel = "X%d/Y%d/io%d" % (x, y, z)
bel_idx = bel_name.index(pin_bel)
pins_info.append((pinname, bel_idx))
- bba.l("package_%s_pins" % safename, "PackagePinPOD", export=True)
+ bba.l("package_%s_pins" % safename, "PackagePinPOD")
for pi in pins_info:
bba.s(pi[0], "name")
bba.u32(pi[1], "bel_index")
- packageinfo.append('{"%s", %d, package_%s_pins}' % (name, len(pins_info), safename))
+ packageinfo.append((name, len(pins_info), "package_%s_pins" % safename))
tilegrid = []
for y in range(dev_height):
@@ -803,16 +803,18 @@ bba.l("tile_grid_%s" % dev_name, "TileType", export=True)
for t in tilegrid:
bba.u32(tiletypes[t], "tiletype")
+bba.l("package_info_%s" % dev_name, "PackageInfoPOD", export=True)
+for info in packageinfo:
+ bba.s(info[0], "name")
+ bba.u32(info[1], "num_pins")
+ bba.r(info[2], "pins")
+
bba.finalize()
if compact_output:
bba.write_compact_c(sys.stdout)
else:
bba.write_verbose_c(sys.stdout)
-print("static PackageInfoPOD package_info_%s[%d] = {" % (dev_name, len(packageinfo)))
-print(" " + ",\n ".join(packageinfo))
-print("};")
-
print('} // namespace')
print('NEXTPNR_NAMESPACE_BEGIN')