aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-03-13 11:22:11 +0000
committerDavid Shah <dave@ds0.me>2020-03-13 11:22:11 +0000
commit3b49c20f4345f05bb92e6fc0a8dfa4c87c9cfa46 (patch)
tree14e047f4eb96cb23ede63dc21be62654fac5bf43
parentbb7358020928d0a26ab7becd123ccdc15b0206cb (diff)
downloadnextpnr-3b49c20f4345f05bb92e6fc0a8dfa4c87c9cfa46.tar.gz
nextpnr-3b49c20f4345f05bb92e6fc0a8dfa4c87c9cfa46.tar.bz2
nextpnr-3b49c20f4345f05bb92e6fc0a8dfa4c87c9cfa46.zip
ecp5: Proper support for '12k' device
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--ecp5/arch.cc9
-rw-r--r--ecp5/arch.h1
-rw-r--r--ecp5/bitstream.cc12
-rw-r--r--ecp5/main.cc6
4 files changed, 21 insertions, 7 deletions
diff --git a/ecp5/arch.cc b/ecp5/arch.cc
index 0a44e020..3aed3ad4 100644
--- a/ecp5/arch.cc
+++ b/ecp5/arch.cc
@@ -106,7 +106,8 @@ Arch::Arch(ArchArgs args) : args(args)
log_error("Unsupported ECP5 chip type.\n");
}
#else
- if (args.type == ArchArgs::LFE5U_25F || args.type == ArchArgs::LFE5UM_25F || args.type == ArchArgs::LFE5UM5G_25F) {
+ if (args.type == ArchArgs::LFE5U_12F || args.type == ArchArgs::LFE5U_25F || args.type == ArchArgs::LFE5UM_25F ||
+ args.type == ArchArgs::LFE5UM5G_25F) {
chip_info = get_chip_info(reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_25k));
} else if (args.type == ArchArgs::LFE5U_45F || args.type == ArchArgs::LFE5UM_45F ||
args.type == ArchArgs::LFE5UM5G_45F) {
@@ -139,7 +140,9 @@ Arch::Arch(ArchArgs args) : args(args)
std::string Arch::getChipName() const
{
- if (args.type == ArchArgs::LFE5U_25F) {
+ if (args.type == ArchArgs::LFE5U_12F) {
+ return "LFE5U-12F";
+ } else if (args.type == ArchArgs::LFE5U_25F) {
return "LFE5U-25F";
} else if (args.type == ArchArgs::LFE5U_45F) {
return "LFE5U-45F";
@@ -186,6 +189,8 @@ std::string Arch::getFullChipName() const
IdString Arch::archArgsToId(ArchArgs args) const
{
+ if (args.type == ArchArgs::LFE5U_12F)
+ return id("lfe5u_12f");
if (args.type == ArchArgs::LFE5U_25F)
return id("lfe5u_25f");
if (args.type == ArchArgs::LFE5U_45F)
diff --git a/ecp5/arch.h b/ecp5/arch.h
index 55494b1f..d57b5bc0 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -431,6 +431,7 @@ struct ArchArgs
enum ArchArgsTypes
{
NONE,
+ LFE5U_12F,
LFE5U_25F,
LFE5U_45F,
LFE5U_85F,
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index 1bdb4188..fd3de4ab 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -438,8 +438,8 @@ std::vector<std::string> get_pll_tiles(Context *ctx, BelId bel)
void fix_tile_names(Context *ctx, ChipConfig &cc)
{
// Remove the V prefix/suffix on certain tiles if device is a SERDES variant
- if (ctx->args.type == ArchArgs::LFE5U_25F || ctx->args.type == ArchArgs::LFE5U_45F ||
- ctx->args.type == ArchArgs::LFE5U_85F) {
+ if (ctx->args.type == ArchArgs::LFE5U_12F || ctx->args.type == ArchArgs::LFE5U_25F ||
+ ctx->args.type == ArchArgs::LFE5U_45F || ctx->args.type == ArchArgs::LFE5U_85F) {
std::map<std::string, std::string> tiletype_xform;
for (const auto &tile : cc.tiles) {
std::string newname = tile.first;
@@ -580,6 +580,10 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
config_file >> cc;
} else {
switch (ctx->args.type) {
+ case ArchArgs::LFE5U_12F:
+ BaseConfigs::config_empty_lfe5u_25f(cc);
+ cc.chip_name = "LFE5U-12F";
+ break;
case ArchArgs::LFE5U_25F:
BaseConfigs::config_empty_lfe5u_25f(cc);
break;
@@ -1429,8 +1433,8 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
Loc loc = ctx->getBelLocation(ci->bel);
bool u = loc.y<15, r = loc.x> 15;
std::string tiletype = fmt_str("DDRDLL_" << (u ? 'U' : 'L') << (r ? 'R' : 'L'));
- if ((ctx->args.type == ArchArgs::LFE5U_25F || ctx->args.type == ArchArgs::LFE5UM_25F ||
- ctx->args.type == ArchArgs::LFE5UM5G_25F) &&
+ if ((ctx->args.type == ArchArgs::LFE5U_12F || ctx->args.type == ArchArgs::LFE5U_25F ||
+ ctx->args.type == ArchArgs::LFE5UM_25F || ctx->args.type == ArchArgs::LFE5UM5G_25F) &&
u)
tiletype += "A";
std::string tile = ctx->getTileByType(tiletype);
diff --git a/ecp5/main.cc b/ecp5/main.cc
index 24a98df4..a24011db 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -49,6 +49,7 @@ ECP5CommandHandler::ECP5CommandHandler(int argc, char **argv) : CommandHandler(a
po::options_description ECP5CommandHandler::getArchOptions()
{
po::options_description specific("Architecture specific options");
+ specific.add_options()("12k", "set device type to LFE5U-12F");
specific.add_options()("25k", "set device type to LFE5U-25F");
specific.add_options()("45k", "set device type to LFE5U-45F");
specific.add_options()("85k", "set device type to LFE5U-85F");
@@ -125,7 +126,8 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st
{
ArchArgs chipArgs;
chipArgs.type = ArchArgs::NONE;
-
+ if (vm.count("12k"))
+ chipArgs.type = ArchArgs::LFE5U_12F;
if (vm.count("25k"))
chipArgs.type = ArchArgs::LFE5U_25F;
if (vm.count("45k"))
@@ -179,6 +181,8 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st
if (chipArgs.type != ArchArgs::NONE)
log_error("Overriding architecture is unsuported.\n");
+ if (arch_type == "lfe5u_12f")
+ chipArgs.type = ArchArgs::LFE5U_12F;
if (arch_type == "lfe5u_25f")
chipArgs.type = ArchArgs::LFE5U_25F;
if (arch_type == "lfe5u_45f")