Support rest of parts
This commit is contained in:
parent
b45b375ff2
commit
32ddc94b4f
@ -83,8 +83,14 @@ void MainWindow::new_proj()
|
||||
arch.insert("Lattice LP1K", ArchArgs::LP1K);
|
||||
if (Arch::isAvailable(ArchArgs::HX1K))
|
||||
arch.insert("Lattice HX1K", ArchArgs::HX1K);
|
||||
if (Arch::isAvailable(ArchArgs::U1K))
|
||||
arch.insert("Lattice U1K", ArchArgs::U1K);
|
||||
if (Arch::isAvailable(ArchArgs::U2K))
|
||||
arch.insert("Lattice U2K", ArchArgs::U2K);
|
||||
if (Arch::isAvailable(ArchArgs::U4K))
|
||||
arch.insert("Lattice U4K", ArchArgs::U4K);
|
||||
if (Arch::isAvailable(ArchArgs::UP3K))
|
||||
arch.insert("Lattice UP3K", ArchArgs::UP3K);
|
||||
if (Arch::isAvailable(ArchArgs::UP5K))
|
||||
arch.insert("Lattice UP5K", ArchArgs::UP5K);
|
||||
if (Arch::isAvailable(ArchArgs::LP4K))
|
||||
|
@ -51,9 +51,9 @@ static const ChipInfoPOD *get_chip_info(ArchArgs::ArchArgsTypes chip)
|
||||
chipdb = "ice40/chipdb-384.bin";
|
||||
} else if (chip == ArchArgs::LP1K || chip == ArchArgs::HX1K) {
|
||||
chipdb = "ice40/chipdb-1k.bin";
|
||||
} else if (chip == ArchArgs::U4K) {
|
||||
} else if (chip == ArchArgs::U1K || chip == ArchArgs::U2K || chip == ArchArgs::U4K) {
|
||||
chipdb = "ice40/chipdb-u4k.bin";
|
||||
} else if (chip == ArchArgs::UP5K) {
|
||||
} else if (chip == ArchArgs::UP3K || chip == ArchArgs::UP5K) {
|
||||
chipdb = "ice40/chipdb-5k.bin";
|
||||
} else if (chip == ArchArgs::LP8K || chip == ArchArgs::HX8K || chip == ArchArgs::LP4K || chip == ArchArgs::HX4K) {
|
||||
chipdb = "ice40/chipdb-8k.bin";
|
||||
@ -75,10 +75,9 @@ 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::LP4K || chip == ArchArgs::HX4K)
|
||||
{
|
||||
if (chip == ArchArgs::LP4K || chip == ArchArgs::HX4K) {
|
||||
if (name.find(":4k") != std::string::npos)
|
||||
name = name.substr(0, name.size()-3);
|
||||
name = name.substr(0, name.size() - 3);
|
||||
else
|
||||
continue;
|
||||
}
|
||||
@ -128,8 +127,14 @@ std::string Arch::getChipName() const
|
||||
return "Lattice LP1K";
|
||||
} else if (args.type == ArchArgs::HX1K) {
|
||||
return "Lattice HX1K";
|
||||
} else if (args.type == ArchArgs::UP3K) {
|
||||
return "Lattice UP3K";
|
||||
} else if (args.type == ArchArgs::UP5K) {
|
||||
return "Lattice UP5K";
|
||||
} else if (args.type == ArchArgs::U1K) {
|
||||
return "Lattice U1K";
|
||||
} else if (args.type == ArchArgs::U2K) {
|
||||
return "Lattice U2K";
|
||||
} else if (args.type == ArchArgs::U4K) {
|
||||
return "Lattice U4K";
|
||||
} else if (args.type == ArchArgs::LP4K) {
|
||||
@ -155,8 +160,14 @@ IdString Arch::archArgsToId(ArchArgs args) const
|
||||
return id("lp1k");
|
||||
if (args.type == ArchArgs::HX1K)
|
||||
return id("hx1k");
|
||||
if (args.type == ArchArgs::UP3K)
|
||||
return id("up3k");
|
||||
if (args.type == ArchArgs::UP5K)
|
||||
return id("up5k");
|
||||
if (args.type == ArchArgs::U1K)
|
||||
return id("u1k");
|
||||
if (args.type == ArchArgs::U2K)
|
||||
return id("u2k");
|
||||
if (args.type == ArchArgs::U4K)
|
||||
return id("u4k");
|
||||
if (args.type == ArchArgs::LP4K)
|
||||
|
@ -390,7 +390,10 @@ struct ArchArgs
|
||||
HX1K,
|
||||
HX4K,
|
||||
HX8K,
|
||||
UP3K,
|
||||
UP5K,
|
||||
U1K,
|
||||
U2K,
|
||||
U4K
|
||||
} type = NONE;
|
||||
std::string package;
|
||||
|
@ -64,8 +64,14 @@ po::options_description Ice40CommandHandler::getArchOptions()
|
||||
specific.add_options()("hx4k", "set device type to iCE40HX4K");
|
||||
if (Arch::isAvailable(ArchArgs::HX4K))
|
||||
specific.add_options()("hx8k", "set device type to iCE40HX8K");
|
||||
if (Arch::isAvailable(ArchArgs::UP3K))
|
||||
specific.add_options()("up3k", "set device type to iCE40UP3K");
|
||||
if (Arch::isAvailable(ArchArgs::UP5K))
|
||||
specific.add_options()("up5k", "set device type to iCE40UP5K");
|
||||
if (Arch::isAvailable(ArchArgs::U1K))
|
||||
specific.add_options()("u1k", "set device type to iCE5LP1K");
|
||||
if (Arch::isAvailable(ArchArgs::U2K))
|
||||
specific.add_options()("u2k", "set device type to iCE5LP2K");
|
||||
if (Arch::isAvailable(ArchArgs::U4K))
|
||||
specific.add_options()("u4k", "set device type to iCE5LP4K");
|
||||
specific.add_options()("package", po::value<std::string>(), "set device package");
|
||||
@ -84,8 +90,9 @@ po::options_description Ice40CommandHandler::getArchOptions()
|
||||
void Ice40CommandHandler::validate()
|
||||
{
|
||||
conflicting_options(vm, "read", "json");
|
||||
if ((vm.count("lp384") + vm.count("lp1k") + vm.count("lp8k") + vm.count("hx1k") + vm.count("hx8k") +
|
||||
vm.count("up5k") + vm.count("u4k")) > 1)
|
||||
if ((vm.count("lp384") + vm.count("lp1k") + vm.count("lp4k") + vm.count("lp8k") + vm.count("hx1k") +
|
||||
vm.count("hx4k") + vm.count("hx8k") + vm.count("up3k") + vm.count("up5k") + vm.count("u1k") + vm.count("u2k") +
|
||||
vm.count("u4k")) > 1)
|
||||
log_error("Only one device type can be set\n");
|
||||
}
|
||||
|
||||
@ -161,11 +168,26 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s
|
||||
chipArgs.package = "ct256";
|
||||
}
|
||||
|
||||
if (vm.count("up3k")) {
|
||||
chipArgs.type = ArchArgs::UP3K;
|
||||
chipArgs.package = "sg48";
|
||||
}
|
||||
|
||||
if (vm.count("up5k")) {
|
||||
chipArgs.type = ArchArgs::UP5K;
|
||||
chipArgs.package = "sg48";
|
||||
}
|
||||
|
||||
if (vm.count("u1k")) {
|
||||
chipArgs.type = ArchArgs::U1K;
|
||||
chipArgs.package = "sg48";
|
||||
}
|
||||
|
||||
if (vm.count("u2k")) {
|
||||
chipArgs.type = ArchArgs::U2K;
|
||||
chipArgs.package = "sg48";
|
||||
}
|
||||
|
||||
if (vm.count("u4k")) {
|
||||
chipArgs.type = ArchArgs::U4K;
|
||||
chipArgs.package = "sg48";
|
||||
@ -208,9 +230,18 @@ std::unique_ptr<Context> Ice40CommandHandler::createContext(std::unordered_map<s
|
||||
if (arch_type == "hx8k") {
|
||||
chipArgs.type = ArchArgs::HX8K;
|
||||
}
|
||||
if (arch_type == "up3k") {
|
||||
chipArgs.type = ArchArgs::UP3K;
|
||||
}
|
||||
if (arch_type == "up5k") {
|
||||
chipArgs.type = ArchArgs::UP5K;
|
||||
}
|
||||
if (arch_type == "u1k") {
|
||||
chipArgs.type = ArchArgs::U1K;
|
||||
}
|
||||
if (arch_type == "u2k") {
|
||||
chipArgs.type = ArchArgs::U2K;
|
||||
}
|
||||
if (arch_type == "u4k") {
|
||||
chipArgs.type = ArchArgs::U4K;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user