diff options
-rw-r--r-- | gui/ice40/mainwindow.cc | 2 | ||||
-rw-r--r-- | ice40/arch.cc | 10 | ||||
-rw-r--r-- | ice40/arch.h | 1 | ||||
-rw-r--r-- | ice40/main.cc | 8 |
4 files changed, 18 insertions, 3 deletions
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index b08e5435..bb5b6ab5 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -87,6 +87,8 @@ void MainWindow::new_proj() arch.insert("Lattice U4K", ArchArgs::U4K);
if (Arch::isAvailable(ArchArgs::UP5K))
arch.insert("Lattice UP5K", ArchArgs::UP5K);
+ if (Arch::isAvailable(ArchArgs::LP4K))
+ arch.insert("Lattice LP4K", ArchArgs::LP4K);
if (Arch::isAvailable(ArchArgs::LP8K))
arch.insert("Lattice LP8K", ArchArgs::LP8K);
if (Arch::isAvailable(ArchArgs::HX4K))
diff --git a/ice40/arch.cc b/ice40/arch.cc index b20245fc..a94d40c8 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -55,7 +55,7 @@ static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip) chipdb = "ice40/chipdb-u4k.bin"; } else if (chip == ArchArgs::UP5K) { chipdb = "ice40/chipdb-5k.bin"; - } else if (chip == ArchArgs::LP8K || chip == ArchArgs::HX8K || chip == ArchArgs::HX4K) { + } else if (chip == ArchArgs::LP8K || chip == ArchArgs::HX8K || chip == ArchArgs::LP4K || chip == ArchArgs::HX4K) { chipdb = "ice40/chipdb-8k.bin"; } else { log_error("Unknown chip\n"); @@ -75,7 +75,7 @@ std::vector<std::string> Arch::getSupportedPackages(ArchArgs::ArchArgsTypes chip std::vector<std::string> packages; for (int i = 0; i < chip_info->num_packages; i++) { std::string name = chip_info->packages_data[i].name.get(); - if (chip == ArchArgs::HX4K) + if (chip == ArchArgs::LP4K || chip == ArchArgs::HX4K) { if (name.find(":4k") != std::string::npos) name = name.substr(0, name.size()-3); @@ -99,7 +99,7 @@ Arch::Arch(ArchArgs args) : args(args) package_info = nullptr; std::string package_name = args.package; - if (args.type == ArchArgs::HX4K) + if (args.type == ArchArgs::LP4K || args.type == ArchArgs::HX4K) package_name += ":4k"; for (int i = 0; i < chip_info->num_packages; i++) { @@ -132,6 +132,8 @@ std::string Arch::getChipName() const return "Lattice UP5K"; } else if (args.type == ArchArgs::U4K) { return "Lattice U4K"; + } else if (args.type == ArchArgs::LP4K) { + return "Lattice LP4K"; } else if (args.type == ArchArgs::LP8K) { return "Lattice LP8K"; } else if (args.type == ArchArgs::HX4K) { @@ -157,6 +159,8 @@ IdString Arch::archArgsToId(ArchArgs args) const return id("up5k"); if (args.type == ArchArgs::U4K) return id("u4k"); + if (args.type == ArchArgs::LP4K) + return id("lp4k"); if (args.type == ArchArgs::LP8K) return id("lp8k"); if (args.type == ArchArgs::HX4K) diff --git a/ice40/arch.h b/ice40/arch.h index 9197dcd2..6c79f349 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -385,6 +385,7 @@ struct ArchArgs NONE, LP384, LP1K, + LP4K, LP8K, HX1K, HX4K, diff --git a/ice40/main.cc b/ice40/main.cc index fedd0918..bfbe3b8c 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -134,6 +134,11 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s chipArgs.package = "tq144"; } + if (vm.count("lp4k")) { + chipArgs.type = ArchArgs::LP4K; + chipArgs.package = "tq144"; + } + if (vm.count("lp8k")) { chipArgs.type = ArchArgs::LP8K; chipArgs.package = "ct256"; @@ -186,6 +191,9 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s if (arch_type == "lp1k") { chipArgs.type = ArchArgs::LP1K; } + if (arch_type == "lp4k") { + chipArgs.type = ArchArgs::LP4K; + } if (arch_type == "lp8k") { chipArgs.type = ArchArgs::LP8K; } |