diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-10 18:25:23 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-10 18:25:23 +0200 |
commit | 67227847e5771f7b99d4f6959634012b4b03f2e5 (patch) | |
tree | 408cf2646dab2dd89d46044f61f3b70d951a05ef /ice40 | |
parent | d3f1112580b1920cae8684d95e0c5eb65c785efe (diff) | |
download | nextpnr-67227847e5771f7b99d4f6959634012b4b03f2e5.tar.gz nextpnr-67227847e5771f7b99d4f6959634012b4b03f2e5.tar.bz2 nextpnr-67227847e5771f7b99d4f6959634012b4b03f2e5.zip |
Pass design to gui, display chip name
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(); |