aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2022-09-15 12:27:36 +0200
committergatecat <gatecat@ds0.me>2022-09-15 12:27:36 +0200
commit7ca3ba3835ee6083b441d693a30ef7530a7e2eed (patch)
tree95337e95db349c3d26ee16e8a3997f80122e723b /nexus
parent79aad0988a17537409c9894081d9562c693745cf (diff)
downloadnextpnr-7ca3ba3835ee6083b441d693a30ef7530a7e2eed.tar.gz
nextpnr-7ca3ba3835ee6083b441d693a30ef7530a7e2eed.tar.bz2
nextpnr-7ca3ba3835ee6083b441d693a30ef7530a7e2eed.zip
nexus: Add ES2 device names and --list-devices
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/arch.cc36
-rw-r--r--nexus/arch.h2
-rw-r--r--nexus/main.cc5
3 files changed, 42 insertions, 1 deletions
diff --git a/nexus/arch.cc b/nexus/arch.cc
index c2d3b6e4..274c5ad3 100644
--- a/nexus/arch.cc
+++ b/nexus/arch.cc
@@ -58,7 +58,9 @@ Arch::Arch(ArchArgs args) : args(args)
log_error("Unknown device string '%s' (expected device name like 'LIFCL-40-8SG72C')\n", args.device.c_str());
device = args.device.substr(0, last_sep);
speed = args.device.substr(last_sep + 1, 1);
- auto package_end = args.device.find_last_of("0123456789");
+ auto package_end = args.device.find_last_of("0123456789", args.device.substr(args.device.size() - 3) == "ES2"
+ ? args.device.size() - 3
+ : std::string::npos);
if (package_end == std::string::npos || package_end < last_sep)
log_error("Unknown device string '%s' (expected device name like 'LIFCL-40-8SG72C')\n", args.device.c_str());
package = args.device.substr(last_sep + 2, (package_end - (last_sep + 2)) + 1);
@@ -67,6 +69,9 @@ Arch::Arch(ArchArgs args) : args(args)
// Check for 'ES' part
if (rating.size() > 1 && rating.substr(1) == "ES") {
variant = "ES";
+ } else if (rating.size() > 1 && rating.substr(1) == "ES2") {
+ // ES2 devices are production-equivalent from nextpnr's and bitstream point of view
+ variant = "";
} else {
variant = "";
}
@@ -194,6 +199,35 @@ Arch::Arch(ArchArgs args) : args(args)
}
}
+void Arch::list_devices()
+{
+ std::vector<std::string> families{
+ "LIFCL",
+ };
+ log("Supported devices: \n");
+ for (auto fam : families) {
+ std::string chipdb = stringf("nexus/chipdb-%s.bin", fam.c_str());
+ auto db_ptr = reinterpret_cast<const RelPtr<DatabasePOD> *>(get_chipdb(chipdb));
+ if (!db_ptr)
+ continue; // chipdb not available
+ // enumerate chips
+ for (auto &chip : db_ptr->get()->chips) {
+ // enumerate packages
+ for (auto &pkg : chip.packages) {
+ // enumerate suffices
+ for (auto speedgrade : {"7", "8", "9"}) { // TODO: these might depend on family
+ for (auto rating : {"I", "C"}) {
+ for (auto suffix : {"", "ES", "ES2"}) {
+ log(" %s-%s%s%s%s\n", chip.device_name.get(), speedgrade, pkg.short_name.get(), rating,
+ suffix);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
// -----------------------------------------------------------------------
std::string Arch::getChipName() const { return args.device; }
diff --git a/nexus/arch.h b/nexus/arch.h
index 4a28dfb7..df4f976a 100644
--- a/nexus/arch.h
+++ b/nexus/arch.h
@@ -1522,6 +1522,8 @@ struct Arch : BaseArch<ArchRanges>
// -------------------------------------------------
void write_fasm(std::ostream &out) const;
+ // -------------------------------------------------
+ static void list_devices();
};
NEXTPNR_NAMESPACE_END
diff --git a/nexus/main.cc b/nexus/main.cc
index bca6661f..cfa06b74 100644
--- a/nexus/main.cc
+++ b/nexus/main.cc
@@ -48,6 +48,7 @@ po::options_description NexusCommandHandler::getArchOptions()
{
po::options_description specific("Architecture specific options");
specific.add_options()("device", po::value<std::string>(), "device name");
+ specific.add_options()("list-devices", "list all supported device names");
specific.add_options()("fasm", po::value<std::string>(), "fasm file to write");
specific.add_options()("pdc", po::value<std::string>(), "physical constraints file");
specific.add_options()("no-post-place-opt", "disable post-place repacking (debugging use only)");
@@ -73,6 +74,10 @@ void NexusCommandHandler::customBitstream(Context *ctx)
std::unique_ptr<Context> NexusCommandHandler::createContext(dict<std::string, Property> &values)
{
ArchArgs chipArgs;
+ if (vm.count("list-devices")) {
+ Arch::list_devices();
+ exit(0);
+ }
if (!vm.count("device")) {
log_error("device must be specified on the command line (e.g. --device LIFCL-40-9BG400CES)\n");
}