diff options
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/chip.cc | 29 | ||||
-rw-r--r-- | ice40/chip.h | 2 | ||||
-rw-r--r-- | ice40/main.cc | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/ice40/chip.cc b/ice40/chip.cc index b2601e2a..e6116287 100644 --- a/ice40/chip.cc +++ b/ice40/chip.cc @@ -106,6 +106,35 @@ Chip::Chip(ChipArgs args) : args(args) // ----------------------------------------------------------------------- +std::string Chip::getChipName() +{ +#ifdef ICE40_HX1K_ONLY + if (args.type == ChipArgs::HX1K) { + return "Lattice LP1K"; + } else { + log_error("Unsupported iCE40 chip type.\n"); + } +#else + if (args.type == ChipArgs::LP384) { + return "Lattice LP384"; + } else if (args.type == ChipArgs::LP1K) { + return "Lattice LP1K"; + } else if (args.type == ChipArgs::HX1K) { + return "Lattice HX1K"; + } else if (args.type == ChipArgs::UP5K) { + return "Lattice UP5K"; + } else if (args.type == ChipArgs::LP8K) { + return "Lattice LP8K"; + } else if (args.type == ChipArgs::HX8K) { + return "Lattice HX8K"; + } else { + log_error("Unknown chip\n"); + } +#endif +} + +// ----------------------------------------------------------------------- + BelId Chip::getBelByName(IdString name) const { BelId ret; diff --git a/ice40/chip.h b/ice40/chip.h index 760ef3b1..252cf303 100644 --- a/ice40/chip.h +++ b/ice40/chip.h @@ -419,6 +419,8 @@ struct Chip ChipArgs args; // ------------------------------------------------- + std::string getChipName(); + BelId getBelByName(IdString name) const; IdString getBelName(BelId bel) const diff --git a/ice40/main.cc b/ice40/main.cc index b4f61108..3b5ffd53 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) if (vm.count("gui")) { QApplication a(argc, argv); - MainWindow w; + MainWindow w(&design); w.show(); rc = a.exec(); |