Skip to content

Commit 566880e

Browse files
Merge branch 'master' into temp_chanx_place_cost_fac
2 parents b7561cc + a06f326 commit 566880e

37 files changed

+2341
-101
lines changed

libs/librrgraph/src/base/rr_graph_utils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ vtr::vector<RRNodeId, std::vector<RREdgeId>> get_fan_in_list(const RRGraphView&
139139

140140
//Walk the graph and increment fanin on all dwnstream nodes
141141
rr_graph.rr_nodes().for_each_edge(
142-
[&](RREdgeId edge, __attribute__((unused)) RRNodeId src, RRNodeId sink) {
142+
[&](RREdgeId edge, RRNodeId src, RRNodeId sink) -> void {
143+
(void) src;
143144
node_fan_in_list[sink].push_back(edge);
144145
});
145146

@@ -258,4 +259,4 @@ bool inter_layer_connections_limited_to_opin(const RRGraphView& rr_graph) {
258259
}
259260

260261
return limited_to_opin;
261-
}
262+
}

libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,15 @@ inline void write_rr_graph_xml(T &in, Context &context, std::ostream &os){
202202
}
203203

204204

205+
#if defined(_MSC_VER)
206+
typedef const uint32_t __declspec(align(1)) triehash_uu32;
207+
typedef const uint64_t __declspec(align(1)) triehash_uu64;
208+
#else
205209
typedef const uint32_t __attribute__((aligned(1))) triehash_uu32;
206210
typedef const uint64_t __attribute__((aligned(1))) triehash_uu64;
207211
static_assert(alignof(triehash_uu32) == 1, "Unaligned 32-bit access not found.");
208212
static_assert(alignof(triehash_uu64) == 1, "Unaligned 64-bit access not found.");
213+
#endif
209214
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
210215
#define onechar(c, s, l) (((uint64_t)(c)) << (s))
211216
#else

vpr/src/analytical_place/analytical_placement_flow.cpp

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
#include "analytical_placement_flow.h"
99
#include "ap_netlist.h"
1010
#include "atom_netlist.h"
11+
#include "full_legalizer.h"
1112
#include "gen_ap_netlist_from_atoms.h"
1213
#include "globals.h"
14+
#include "partial_placement.h"
1315
#include "prepack.h"
1416
#include "user_place_constraints.h"
1517
#include "vpr_context.h"
16-
#include "vpr_error.h"
1718
#include "vpr_types.h"
19+
#include "vtr_assert.h"
1820
#include "vtr_time.h"
1921

2022
void run_analytical_placement_flow(t_vpr_setup& vpr_setup) {
2123
(void)vpr_setup;
2224
// Start an overall timer for the Analytical Placement flow.
23-
vtr::ScopedStartFinishTimer timer("Analytical Placement Flow");
25+
vtr::ScopedStartFinishTimer timer("Analytical Placement");
2426

2527
// The global state used/modified by this flow.
2628
const AtomNetlist& atom_nlist = g_vpr_ctx.atom().nlist;
@@ -37,9 +39,38 @@ void run_analytical_placement_flow(t_vpr_setup& vpr_setup) {
3739
prepacker,
3840
constraints);
3941

40-
// AP is currently under-construction. Fail gracefully just in case this
41-
// is somehow being called.
42-
VPR_FATAL_ERROR(VPR_ERROR_AP,
43-
"Analytical Placement flow not implemented yet");
42+
// Run the Global Placer
43+
// For now, just put all the moveable blocks at the center of the device
44+
// grid. This will be replaced later. This is just for testing.
45+
PartialPlacement p_placement(ap_netlist);
46+
const size_t device_width = device_ctx.grid.width();
47+
const size_t device_height = device_ctx.grid.height();
48+
double device_center_x = static_cast<double>(device_width) / 2.0;
49+
double device_center_y = static_cast<double>(device_height) / 2.0;
50+
for (APBlockId ap_blk_id : ap_netlist.blocks()) {
51+
if (ap_netlist.block_mobility(ap_blk_id) != APBlockMobility::MOVEABLE)
52+
continue;
53+
// If the APBlock is moveable, put it on the center for the device.
54+
p_placement.block_x_locs[ap_blk_id] = device_center_x;
55+
p_placement.block_y_locs[ap_blk_id] = device_center_y;
56+
}
57+
VTR_ASSERT(p_placement.verify(ap_netlist,
58+
device_width,
59+
device_height,
60+
device_ctx.grid.get_num_layers()));
61+
62+
// Run the Full Legalizer.
63+
FullLegalizer full_legalizer(ap_netlist,
64+
vpr_setup,
65+
device_ctx.grid,
66+
device_ctx.arch,
67+
atom_nlist,
68+
prepacker,
69+
device_ctx.logical_block_types,
70+
vpr_setup.PackerRRGraph,
71+
device_ctx.arch->models,
72+
device_ctx.arch->model_library,
73+
vpr_setup.PackerOpts);
74+
full_legalizer.legalize(p_placement);
4475
}
4576

0 commit comments

Comments
 (0)