Skip to content

Commit 629b039

Browse files
committed
Revert "vpr: Add support for tracing clock nets through general logic"
This reverts commit 5007035.
1 parent 0a4b0f2 commit 629b039

File tree

1 file changed

+10
-35
lines changed

1 file changed

+10
-35
lines changed

vpr/src/base/atom_netlist_utils.cpp

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ std::set<AtomNetId> find_netlist_physical_clock_nets(const AtomNetlist& netlist)
13551355
return clock_nets;
13561356
}
13571357

1358-
//Finds all logical clock drivers in the netlist (by back-tracing through logic)
1358+
//Finds all logical clock drivers in the netlist
13591359
std::set<AtomPinId> find_netlist_logical_clock_drivers(const AtomNetlist& netlist) {
13601360
auto clock_nets = find_netlist_physical_clock_nets(netlist);
13611361

@@ -1364,53 +1364,28 @@ std::set<AtomPinId> find_netlist_logical_clock_drivers(const AtomNetlist& netlis
13641364
//However, some of them may be the same logical clock (e.g. if there are
13651365
//buffers between them). Here we trace-back through any clock buffers
13661366
//to find the true source
1367-
size_t assumed_buffer_count = 0;
13681367
std::set<AtomNetId> prev_clock_nets;
13691368
while (prev_clock_nets != clock_nets) { //Still tracing back
13701369
prev_clock_nets = clock_nets;
13711370
clock_nets.clear();
13721371

13731372
for (auto clk_net : prev_clock_nets) {
1374-
AtomPinId driver_pin = netlist.net_driver(clk_net);
1375-
AtomPortId driver_port = netlist.pin_port(driver_pin);
1373+
auto driver_block = netlist.net_driver_block(clk_net);
13761374

1377-
std::vector<AtomPortId> upstream_ports = find_combinationally_connected_input_ports(netlist, driver_port);
1375+
if (is_buffer(netlist, driver_block)) {
1376+
//Driver is a buffer lut, use it's input net
1377+
auto input_pins = netlist.block_input_pins(driver_block);
1378+
VTR_ASSERT(input_pins.size() == 1);
1379+
auto input_pin = *input_pins.begin();
13781380

1379-
if (upstream_ports.empty()) {
1380-
//This net is a root net of a clock, keep it
1381-
clock_nets.insert(clk_net);
1381+
auto input_net = netlist.pin_net(input_pin);
1382+
clock_nets.insert(input_net);
13821383
} else {
1383-
//Trace the clock back through any combinational logic
1384-
//
1385-
// We are assuming that the combinational connections are independent and non-inverting.
1386-
// If this is not the case, it is up to the end-user to specify the clocks explicitly
1387-
// at the intermediate pins in the netlist.
1388-
for (AtomPortId upstream_port : upstream_ports) {
1389-
for (AtomPinId upstream_pin : netlist.port_pins(upstream_port)) {
1390-
AtomNetId upstream_net = netlist.pin_net(upstream_pin);
1391-
1392-
VTR_ASSERT(upstream_net);
1393-
1394-
AtomBlockId driver_blk = netlist.port_block(driver_port);
1395-
VTR_LOG_WARN("Assuming clocks may propagate through %s (%s) from pin %s to %s (assuming a non-inverting buffer).\n",
1396-
netlist.block_name(driver_blk).c_str(), netlist.block_model(driver_blk)->name,
1397-
netlist.pin_name(upstream_pin).c_str(), netlist.pin_name(driver_pin).c_str());
1398-
1399-
clock_nets.insert(upstream_net);
1400-
++assumed_buffer_count;
1401-
}
1402-
}
1384+
clock_nets.insert(clk_net);
14031385
}
14041386
}
14051387
}
14061388

1407-
if (assumed_buffer_count > 0) {
1408-
VTR_LOG_WARN(
1409-
"Assumed %zu netlist logic connections may be clock buffers. "
1410-
"To override this behaviour explicitly create clocks at the appropriate netlist pins.\n",
1411-
assumed_buffer_count);
1412-
}
1413-
14141389
//Extract the net drivers
14151390
std::set<AtomPinId> clock_drivers;
14161391
for (auto net : clock_nets) {

0 commit comments

Comments
 (0)