Skip to content

Commit 3510bd8

Browse files
committed
vpr: changes to conform to c++17 standard
1 parent 6155ea7 commit 3510bd8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vpr/src/route/clock_connection_builders.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
4949
// Initialize random seed
5050
// Must be done during every call in order for restored rr_graphs after a binary
5151
// search to be consistent
52-
std::srand(seed);
52+
std::mt19937 rand_generator;
53+
rand_generator.seed(seed);
5354

5455
auto& device_ctx = g_vpr_ctx.device();
5556
const auto& node_lookup = device_ctx.rr_graph.node_lookup();
@@ -68,8 +69,8 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
6869

6970
for (auto clock_index : clock_indices) {
7071
// Select wires to connect to at random
71-
std::random_shuffle(x_wire_indices.begin(), x_wire_indices.end());
72-
std::random_shuffle(y_wire_indices.begin(), y_wire_indices.end());
72+
std::shuffle(x_wire_indices.begin(), x_wire_indices.end(), rand_generator);
73+
std::shuffle(y_wire_indices.begin(), y_wire_indices.end(), rand_generator);
7374

7475
// Connect to x-channel wires
7576
unsigned num_wires_x = x_wire_indices.size() * fc;

0 commit comments

Comments
 (0)