mirror of https://github.com/YosysHQ/nextpnr.git
gatemate: Override router2 cost function to account for low-delay pips
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
4d23515026
commit
3d71bf678c
|
|
@ -300,7 +300,9 @@ bool Arch::route()
|
|||
if (router == "router1") {
|
||||
result = router1(getCtx(), Router1Cfg(getCtx()));
|
||||
} else if (router == "router2") {
|
||||
router2(getCtx(), Router2Cfg(getCtx()));
|
||||
Router2Cfg cfg(getCtx());
|
||||
uarch->configureRouter2(cfg);
|
||||
router2(getCtx(), cfg);
|
||||
result = true;
|
||||
} else {
|
||||
log_error("Himbächel architecture does not support router '%s'\n", router.c_str());
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ struct Context;
|
|||
|
||||
struct PlacerHeapCfg;
|
||||
struct PlacerStaticCfg;
|
||||
struct Router2Cfg;
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
|
|
@ -149,6 +150,8 @@ struct HimbaechelAPI
|
|||
virtual void configurePlacerHeap(PlacerHeapCfg &cfg) {};
|
||||
virtual void configurePlacerStatic(PlacerStaticCfg &cfg);
|
||||
|
||||
virtual void configureRouter2(Router2Cfg &cfg) {};
|
||||
|
||||
virtual std::string getDefaultRouter() const { return "router1"; };
|
||||
|
||||
virtual ~HimbaechelAPI() {};
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "nextpnr_assertions.h"
|
||||
#include "placer_heap.h"
|
||||
#include "placer_static.h"
|
||||
#include "router2.h"
|
||||
|
||||
#define GEN_INIT_CONSTIDS
|
||||
#define HIMBAECHEL_CONSTIDS "uarch/gatemate/constids.inc"
|
||||
|
|
@ -1079,6 +1080,15 @@ void GateMateImpl::configurePlacerStatic(PlacerStaticCfg &cfg)
|
|||
}
|
||||
}
|
||||
|
||||
void GateMateImpl::configureRouter2(Router2Cfg &cfg) {
|
||||
cfg.get_base_cost = [](Context *ctx, WireId wire, PipId pip, float crit_weight) {
|
||||
float delay_cost = ctx->getDelayNS(ctx->getPipDelay(pip).maxDelay() + ctx->getWireDelay(wire).maxDelay() + ctx->getDelayEpsilon());
|
||||
const float rr_cost = 0.5f; // fundamental cost of using a routing resource
|
||||
return delay_cost + rr_cost * (1.0f - crit_weight);
|
||||
// return delay_cost;
|
||||
};
|
||||
}
|
||||
|
||||
int GateMateImpl::get_dff_config(CellInfo *dff) const
|
||||
{
|
||||
int val = 0;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ struct GateMateImpl : HimbaechelAPI
|
|||
|
||||
void configurePlacerHeap(PlacerHeapCfg &cfg) override;
|
||||
void configurePlacerStatic(PlacerStaticCfg &cfg) override;
|
||||
void configureRouter2(Router2Cfg &cfg) override;
|
||||
|
||||
bool isPipInverting(PipId pip) const override;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue