timing: Use new engine for HeAP

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-03-04 10:14:20 +00:00
parent bbf5a7d461
commit ebc2527368
3 changed files with 19 additions and 14 deletions

View File

@ -139,9 +139,11 @@ template <typename T> struct EquationSystem
class HeAPPlacer class HeAPPlacer
{ {
public: public:
HeAPPlacer(Context *ctx, PlacerHeapCfg cfg) : ctx(ctx), cfg(cfg), fast_bels(ctx, /*check_bel_available=*/true, -1) HeAPPlacer(Context *ctx, PlacerHeapCfg cfg)
: ctx(ctx), cfg(cfg), fast_bels(ctx, /*check_bel_available=*/true, -1), tmg(ctx)
{ {
Eigen::initParallel(); Eigen::initParallel();
tmg.setup();
} }
bool place() bool place()
@ -269,7 +271,7 @@ class HeAPPlacer
// Update timing weights // Update timing weights
if (cfg.timing_driven) if (cfg.timing_driven)
get_criticalities(ctx, &net_crit); tmg.run();
if (legal_hpwl < best_hpwl) { if (legal_hpwl < best_hpwl) {
best_hpwl = legal_hpwl; best_hpwl = legal_hpwl;
@ -355,6 +357,8 @@ class HeAPPlacer
FastBels fast_bels; FastBels fast_bels;
std::unordered_map<IdString, std::tuple<int, int>> bel_types; std::unordered_map<IdString, std::tuple<int, int>> bel_types;
TimingAnalyser tmg;
struct BoundingBox struct BoundingBox
{ {
// Actual bounding box // Actual bounding box
@ -392,8 +396,6 @@ class HeAPPlacer
// Performance counting // Performance counting
double solve_time = 0, cl_time = 0, sl_time = 0; double solve_time = 0, cl_time = 0, sl_time = 0;
NetCriticalityMap net_crit;
// Place cells with the BEL attribute set to constrain them // Place cells with the BEL attribute set to constrain them
void place_constraints() void place_constraints()
{ {
@ -736,11 +738,9 @@ class HeAPPlacer
std::max<double>(1, (yaxis ? cfg.hpwl_scale_y : cfg.hpwl_scale_x) * std::max<double>(1, (yaxis ? cfg.hpwl_scale_y : cfg.hpwl_scale_x) *
std::abs(o_pos - this_pos))); std::abs(o_pos - this_pos)));
if (user_idx != -1 && net_crit.count(ni->name)) { if (user_idx != -1) {
auto &nc = net_crit.at(ni->name); weight *= (1.0 + cfg.timingWeight * std::pow(tmg.get_criticality(CellPortKey(port)),
if (user_idx < int(nc.criticality.size())) cfg.criticalityExponent));
weight *= (1.0 + cfg.timingWeight *
std::pow(nc.criticality.at(user_idx), cfg.criticalityExponent));
} }
// If cell 0 is not fixed, it will stamp +w on its equation and -w on the other end's equation, // If cell 0 is not fixed, it will stamp +w on its equation and -w on the other end's equation,

View File

@ -34,16 +34,19 @@ void TimingAnalyser::setup()
{ {
init_ports(); init_ports();
get_cell_delays(); get_cell_delays();
get_route_delays();
topo_sort(); topo_sort();
setup_port_domains(); setup_port_domains();
run();
}
void TimingAnalyser::run()
{
reset_times(); reset_times();
get_route_delays();
walk_forward(); walk_forward();
walk_backward(); walk_backward();
compute_slack(); compute_slack();
compute_criticality(); compute_criticality();
print_fmax();
print_report();
} }
void TimingAnalyser::init_ports() void TimingAnalyser::init_ports()

View File

@ -127,6 +127,10 @@ struct TimingAnalyser
public: public:
TimingAnalyser(Context *ctx) : ctx(ctx){}; TimingAnalyser(Context *ctx) : ctx(ctx){};
void setup(); void setup();
void run();
void print_report();
float get_criticality(CellPortKey port) const { return ports.at(port).worst_crit; }
bool setup_only = false; bool setup_only = false;
@ -146,8 +150,6 @@ struct TimingAnalyser
void compute_criticality(); void compute_criticality();
void print_fmax(); void print_fmax();
void print_report();
// get the N most failing endpoints for a given domain pair // get the N most failing endpoints for a given domain pair
std::vector<CellPortKey> get_failing_eps(domain_id_t domain_pair, int count); std::vector<CellPortKey> get_failing_eps(domain_id_t domain_pair, int count);
// print the critical path for an endpoint and domain pair // print the critical path for an endpoint and domain pair