File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments