Merge pull request #228 from YosysHQ/ecp5_embed_base

ecp5: Embed baseconfigs in nextpnr
This commit is contained in:
David Shah 2019-02-14 12:20:41 +00:00 committed by GitHub
commit 9026ab8886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2683 additions and 4 deletions

2630
ecp5/baseconfigs.cc Normal file

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,18 @@
NEXTPNR_NAMESPACE_BEGIN
namespace BaseConfigs {
void config_empty_lfe5u_25f(ChipConfig &cc);
void config_empty_lfe5u_45f(ChipConfig &cc);
void config_empty_lfe5u_85f(ChipConfig &cc);
void config_empty_lfe5um_25f(ChipConfig &cc);
void config_empty_lfe5um_45f(ChipConfig &cc);
void config_empty_lfe5um_85f(ChipConfig &cc);
void config_empty_lfe5um5g_25f(ChipConfig &cc);
void config_empty_lfe5um5g_45f(ChipConfig &cc);
void config_empty_lfe5um5g_85f(ChipConfig &cc);
} // namespace BaseConfigs
// Convert an absolute wire name to a relative Trellis one
static std::string get_trellis_wirename(Context *ctx, Location loc, WireId wire)
{
@ -538,8 +550,36 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
}
config_file >> cc;
} else {
cc.chip_name = ctx->getChipName();
// TODO: .bit metadata
switch (ctx->args.type) {
case ArchArgs::LFE5U_25F:
BaseConfigs::config_empty_lfe5u_25f(cc);
break;
case ArchArgs::LFE5U_45F:
BaseConfigs::config_empty_lfe5u_45f(cc);
break;
case ArchArgs::LFE5U_85F:
BaseConfigs::config_empty_lfe5u_85f(cc);
break;
case ArchArgs::LFE5UM_25F:
BaseConfigs::config_empty_lfe5um_25f(cc);
break;
case ArchArgs::LFE5UM_45F:
BaseConfigs::config_empty_lfe5um_45f(cc);
break;
case ArchArgs::LFE5UM_85F:
BaseConfigs::config_empty_lfe5um_85f(cc);
break;
case ArchArgs::LFE5UM5G_25F:
BaseConfigs::config_empty_lfe5um5g_25f(cc);
break;
case ArchArgs::LFE5UM5G_45F:
BaseConfigs::config_empty_lfe5um5g_45f(cc);
break;
case ArchArgs::LFE5UM5G_85F:
BaseConfigs::config_empty_lfe5um5g_85f(cc);
default:
NPNR_ASSERT_FALSE("Unsupported device type");
}
}
// Clear out DCU tieoffs in base config if DCU used

View File

@ -61,7 +61,10 @@ po::options_description ECP5CommandHandler::getArchOptions()
specific.add_options()("package", po::value<std::string>(), "select device package (defaults to CABGA381)");
specific.add_options()("speed", po::value<int>(), "select device speedgrade (6, 7 or 8)");
specific.add_options()("basecfg", po::value<std::string>(), "base chip configuration in Trellis text format");
specific.add_options()("basecfg", po::value<std::string>(),
"base chip configuration in Trellis text format (deprecated)");
specific.add_options()("override-basecfg", po::value<std::string>(),
"base chip configuration in Trellis text format");
specific.add_options()("textcfg", po::value<std::string>(), "textual configuration in Trellis format to write");
specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
@ -77,8 +80,14 @@ void ECP5CommandHandler::validate()
void ECP5CommandHandler::customBitstream(Context *ctx)
{
std::string basecfg;
if (vm.count("basecfg"))
if (vm.count("basecfg")) {
log_warning("--basecfg is deprecated.\nIf you are using a default baseconfig (from prjtrellis/misc/basecfgs), "
"these are now embedded in nextpnr - please remove --basecfg.\nIf you are using a non-standard "
"baseconfig in a special application, switch to using --override-basecfg.\n");
basecfg = vm["basecfg"].as<std::string>();
} else if (vm.count("override-basecfg")) {
basecfg = vm["basecfg"].as<std::string>();
}
std::string textcfg;
if (vm.count("textcfg"))