Skip to content

Commit 7ef8c39

Browse files
move delay_model directory from place/timing to under place/
1 parent 5be891c commit 7ef8c39

14 files changed

+2038
-3
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
3+
#include "PlacementDelayModelCreator.h"
4+
5+
#include "place_delay_model.h"
6+
#include "simple_delay_model.h"
7+
#include "delta_delay_model.h"
8+
#include "override_delay_model.h"
9+
10+
#include "vtr_time.h"
11+
#include "physical_types.h"
12+
#include "place_and_route.h"
13+
14+
static int get_longest_segment_length(std::vector<t_segment_inf>& segment_inf) {
15+
int length = 0;
16+
17+
for (const t_segment_inf& seg_info : segment_inf) {
18+
if (seg_info.length > length) {
19+
length = seg_info.length;
20+
}
21+
}
22+
23+
return length;
24+
}
25+
26+
std::unique_ptr<PlaceDelayModel>
27+
PlacementDelayModelCreator::create_delay_model(const t_placer_opts& placer_opts,
28+
const t_router_opts& router_opts,
29+
const Netlist<>& net_list,
30+
t_det_routing_arch* det_routing_arch,
31+
std::vector<t_segment_inf>& segment_inf,
32+
t_chan_width_dist chan_width_dist,
33+
const std::vector<t_direct_inf>& directs,
34+
bool is_flat) {
35+
vtr::ScopedStartFinishTimer timer("Computing placement delta delay look-up");
36+
37+
t_chan_width chan_width = setup_chan_width(router_opts, chan_width_dist);
38+
39+
alloc_routing_structs(chan_width, router_opts, det_routing_arch, segment_inf, directs, is_flat);
40+
41+
const RouterLookahead* router_lookahead = get_cached_router_lookahead(*det_routing_arch,
42+
router_opts.lookahead_type,
43+
router_opts.write_router_lookahead,
44+
router_opts.read_router_lookahead,
45+
segment_inf,
46+
is_flat);
47+
48+
RouterDelayProfiler route_profiler(net_list, router_lookahead, is_flat);
49+
50+
int longest_length = get_longest_segment_length(segment_inf);
51+
52+
// now setup and compute the actual arrays
53+
std::unique_ptr<PlaceDelayModel> place_delay_model;
54+
float min_cross_layer_delay = get_min_cross_layer_delay();
55+
56+
if (placer_opts.delay_model_type == PlaceDelayModelType::SIMPLE) {
57+
place_delay_model = std::make_unique<SimpleDelayModel>();
58+
} else if (placer_opts.delay_model_type == PlaceDelayModelType::DELTA) {
59+
place_delay_model = std::make_unique<DeltaDelayModel>(min_cross_layer_delay, is_flat);
60+
} else if (placer_opts.delay_model_type == PlaceDelayModelType::DELTA_OVERRIDE) {
61+
place_delay_model = std::make_unique<OverrideDelayModel>(min_cross_layer_delay, is_flat);
62+
} else {
63+
VTR_ASSERT_MSG(false, "Invalid placer delay model");
64+
}
65+
66+
if (placer_opts.read_placement_delay_lookup.empty()) {
67+
place_delay_model->compute(route_profiler, placer_opts, router_opts, longest_length);
68+
} else {
69+
place_delay_model->read(placer_opts.read_placement_delay_lookup);
70+
}
71+
72+
if (!placer_opts.write_placement_delay_lookup.empty()) {
73+
place_delay_model->write(placer_opts.write_placement_delay_lookup);
74+
}
75+
76+
// free all data structures that are no longer needed
77+
free_routing_structs();
78+
79+
return place_delay_model;
80+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
#pragma once
3+
4+
#include <memory>
5+
#include <vector>
6+
7+
#include "netlist.h"
8+
9+
class PlaceDelayModel;
10+
struct t_placer_opts;
11+
struct t_router_opts;
12+
struct t_det_routing_arch;
13+
struct t_segment_inf;
14+
struct t_chan_width_dist;
15+
struct t_direct_inf;
16+
17+
class PlacementDelayModelCreator {
18+
public:
19+
// nothing to do in the constructor
20+
PlacementDelayModelCreator() = delete;
21+
22+
static std::unique_ptr<PlaceDelayModel> create_delay_model(const t_placer_opts& placer_opts,
23+
const t_router_opts& router_opts,
24+
const Netlist<>& net_list,
25+
t_det_routing_arch* det_routing_arch,
26+
std::vector<t_segment_inf>& segment_inf,
27+
t_chan_width_dist chan_width_dist,
28+
const std::vector<t_direct_inf>& directs,
29+
bool is_flat);
30+
};

0 commit comments

Comments
 (0)