ecp5: Allow disabling of global promotion (#1367)
This commit is contained in:
parent
50bd8d09b0
commit
2627d4e0ad
@ -48,7 +48,7 @@ static std::string get_quad_name(GlobalQuadrant quad)
|
|||||||
class Ecp5GlobalRouter
|
class Ecp5GlobalRouter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Ecp5GlobalRouter(Context *ctx) : ctx(ctx){};
|
Ecp5GlobalRouter(Context *ctx) : ctx(ctx) {};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool is_clock_port(const PortRef &user)
|
bool is_clock_port(const PortRef &user)
|
||||||
@ -512,11 +512,12 @@ class Ecp5GlobalRouter
|
|||||||
public:
|
public:
|
||||||
void promote_globals()
|
void promote_globals()
|
||||||
{
|
{
|
||||||
|
bool disable_promotion = bool_or_default(ctx->settings, ctx->id("arch.no-promote-globals"));
|
||||||
bool is_ooc = bool_or_default(ctx->settings, ctx->id("arch.ooc"));
|
bool is_ooc = bool_or_default(ctx->settings, ctx->id("arch.ooc"));
|
||||||
log_info("Promoting globals...\n");
|
log_info("Promoting globals...\n");
|
||||||
auto clocks = get_clocks();
|
auto clocks = get_clocks();
|
||||||
for (auto clock : clocks) {
|
for (auto clock : clocks) {
|
||||||
bool is_noglobal = bool_or_default(clock->attrs, id_noglobal, false) ||
|
bool is_noglobal = disable_promotion || bool_or_default(clock->attrs, id_noglobal, false) ||
|
||||||
bool_or_default(clock->attrs, id_ECP5_IS_GLOBAL, false);
|
bool_or_default(clock->attrs, id_ECP5_IS_GLOBAL, false);
|
||||||
if (is_noglobal)
|
if (is_noglobal)
|
||||||
continue;
|
continue;
|
||||||
|
@ -33,9 +33,9 @@ class ECP5CommandHandler : public CommandHandler
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ECP5CommandHandler(int argc, char **argv);
|
ECP5CommandHandler(int argc, char **argv);
|
||||||
virtual ~ECP5CommandHandler(){};
|
virtual ~ECP5CommandHandler() {};
|
||||||
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
|
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
|
||||||
void setupArchContext(Context *ctx) override{};
|
void setupArchContext(Context *ctx) override {};
|
||||||
void customAfterLoad(Context *ctx) override;
|
void customAfterLoad(Context *ctx) override;
|
||||||
void validate() override;
|
void validate() override;
|
||||||
void customBitstream(Context *ctx) override;
|
void customBitstream(Context *ctx) override;
|
||||||
@ -82,6 +82,7 @@ po::options_description ECP5CommandHandler::getArchOptions()
|
|||||||
specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
|
specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
|
||||||
specific.add_options()("lpf-allow-unconstrained", "don't require LPF file(s) to constrain all IO");
|
specific.add_options()("lpf-allow-unconstrained", "don't require LPF file(s) to constrain all IO");
|
||||||
|
|
||||||
|
specific.add_options()("no-promote-globals", "disable all global promotion");
|
||||||
specific.add_options()(
|
specific.add_options()(
|
||||||
"out-of-context",
|
"out-of-context",
|
||||||
"disable IO buffer insertion and global promotion/routing, for building pre-routed blocks (experimental)");
|
"disable IO buffer insertion and global promotion/routing, for building pre-routed blocks (experimental)");
|
||||||
@ -253,6 +254,8 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(dict<std::string, Pro
|
|||||||
ctx->settings[ctx->id(val.first)] = val.second;
|
ctx->settings[ctx->id(val.first)] = val.second;
|
||||||
ctx->settings[ctx->id("arch.package")] = ctx->archArgs().package;
|
ctx->settings[ctx->id("arch.package")] = ctx->archArgs().package;
|
||||||
ctx->settings[ctx->id("arch.speed")] = speedString(ctx->archArgs().speed);
|
ctx->settings[ctx->id("arch.speed")] = speedString(ctx->archArgs().speed);
|
||||||
|
if (vm.count("no-promote-globals"))
|
||||||
|
ctx->settings[ctx->id("arch.no-promote-globals")] = 1;
|
||||||
if (vm.count("out-of-context"))
|
if (vm.count("out-of-context"))
|
||||||
ctx->settings[ctx->id("arch.ooc")] = 1;
|
ctx->settings[ctx->id("arch.ooc")] = 1;
|
||||||
if (vm.count("disable-router-lutperm"))
|
if (vm.count("disable-router-lutperm"))
|
||||||
|
Loading…
Reference in New Issue
Block a user