@@ -645,7 +645,7 @@ class BlackBoxInst : public Instance {
645
645
std::vector<Arc> timing_arcs, // /<Combinational timing arcs
646
646
std::map<std::string, sequential_port_delay_pair> ports_tsu, // /<Port setup checks
647
647
std::map<std::string, sequential_port_delay_pair> ports_thld, // /<Port hold checks
648
- std::map<std::string, sequential_port_delay_pair> ports_tcq , // /<Port clock-to-q delays
648
+ std::vector<Arc> cq_timing_arcs , // /<Port clock-to-q timing arcs
649
649
struct t_analysis_opts opts)
650
650
: type_name_(type_name)
651
651
, inst_name_(inst_name)
@@ -656,7 +656,7 @@ class BlackBoxInst : public Instance {
656
656
, timing_arcs_(timing_arcs)
657
657
, ports_tsu_(ports_tsu)
658
658
, ports_thld_(ports_thld)
659
- , ports_tcq_(ports_tcq )
659
+ , cq_timing_arcs_(cq_timing_arcs )
660
660
, opts_(opts) {}
661
661
662
662
void print_blif (std::ostream& os, size_t & unconn_count, int depth = 0 ) override {
@@ -763,17 +763,17 @@ class BlackBoxInst : public Instance {
763
763
}
764
764
765
765
void print_sdf (std::ostream& os, int depth = 0 ) override {
766
- if (!timing_arcs_.empty () || !ports_tcq_ .empty () || !ports_tsu_.empty () || !ports_thld_.empty ()) {
766
+ if (!timing_arcs_.empty () || !cq_timing_arcs_ .empty () || !ports_tsu_.empty () || !ports_thld_.empty ()) {
767
767
os << indent (depth) << " (CELL\n " ;
768
768
os << indent (depth + 1 ) << " (CELLTYPE \" " << type_name_ << " \" )\n " ;
769
769
os << indent (depth + 1 ) << " (INSTANCE " << escape_sdf_identifier (inst_name_) << " )\n " ;
770
770
os << indent (depth + 1 ) << " (DELAY\n " ;
771
771
772
- if (!timing_arcs_.empty () || !ports_tcq_ .empty ()) {
772
+ if (!timing_arcs_.empty () || !cq_timing_arcs_ .empty ()) {
773
773
os << indent (depth + 2 ) << " (ABSOLUTE\n " ;
774
774
775
775
// Combinational paths
776
- for (const auto & arc : timing_arcs_) {
776
+ for (const Arc & arc : timing_arcs_) {
777
777
// Note that we explicitly do not escape the last array indexing so an SDF
778
778
// reader will treat the ports as multi-bit
779
779
//
@@ -794,9 +794,20 @@ class BlackBoxInst : public Instance {
794
794
}
795
795
796
796
// Clock-to-Q delays
797
- for (auto kv : ports_tcq_) {
798
- DelayTriple delay_triple = kv.second .first ;
799
- os << indent (depth + 3 ) << " (IOPATH (posedge " << escape_sdf_identifier (kv.second .second ) << " ) " << escape_sdf_identifier (kv.first ) << " " << delay_triple.str () << " " << delay_triple.str () << " )\n " ;
797
+ for (const Arc& cq_arc : cq_timing_arcs_) {
798
+ os << indent (depth + 3 ) << " (IOPATH (posedge " ;
799
+ os << escape_sdf_identifier (cq_arc.source_name ());
800
+ if (find_port_size (cq_arc.source_name ()) > 1 ) {
801
+ os << " [" << cq_arc.source_ipin () << " ]" ;
802
+ }
803
+ os << " ) " ;
804
+ os << escape_sdf_identifier (cq_arc.sink_name ());
805
+ if (find_port_size (cq_arc.sink_name ()) > 1 ) {
806
+ os << " [" << cq_arc.sink_ipin () << " ]" ;
807
+ }
808
+ os << " " ;
809
+ os << cq_arc.delay ().str ();
810
+ os << " )\n " ;
800
811
}
801
812
os << indent (depth + 2 ) << " )\n " ; // ABSOLUTE
802
813
}
@@ -845,7 +856,7 @@ class BlackBoxInst : public Instance {
845
856
std::vector<Arc> timing_arcs_;
846
857
std::map<std::string, sequential_port_delay_pair> ports_tsu_;
847
858
std::map<std::string, sequential_port_delay_pair> ports_thld_;
848
- std::map<std::string, sequential_port_delay_pair> ports_tcq_ ;
859
+ std::vector<Arc> cq_timing_arcs_ ;
849
860
struct t_analysis_opts opts_;
850
861
};
851
862
@@ -1419,7 +1430,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1419
1430
std::vector<Arc> timing_arcs;
1420
1431
std::map<std::string, sequential_port_delay_pair> ports_tsu;
1421
1432
std::map<std::string, sequential_port_delay_pair> ports_thld;
1422
- std::map<std::string, sequential_port_delay_pair> ports_tcq ;
1433
+ std::vector<Arc> cq_timing_arcs ;
1423
1434
1424
1435
params[" ADDR_WIDTH" ] = " 0" ;
1425
1436
params[" DATA_WIDTH" ] = " 0" ;
@@ -1513,7 +1524,11 @@ class NetlistWriterVisitor : public NetlistVisitor {
1513
1524
}
1514
1525
output_port_conns[port_name].push_back (net);
1515
1526
DelayTriple delay_triple = get_pin_tco_delay_triple (*pin);
1516
- ports_tcq[port_name] = std::make_pair (delay_triple, pin->associated_clock_pin ->port ->name );
1527
+ cq_timing_arcs.emplace_back (pin->associated_clock_pin ->port ->name ,
1528
+ pin->associated_clock_pin ->pin_number ,
1529
+ port_name,
1530
+ ipin,
1531
+ delay_triple);
1517
1532
}
1518
1533
}
1519
1534
@@ -1544,7 +1559,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1544
1559
}
1545
1560
}
1546
1561
1547
- return std::make_shared<BlackBoxInst>(type, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, ports_tcq , opts_);
1562
+ return std::make_shared<BlackBoxInst>(type, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, cq_timing_arcs , opts_);
1548
1563
}
1549
1564
1550
1565
// /@brief Returns an Instance object representing a Multiplier
@@ -1564,7 +1579,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1564
1579
std::vector<Arc> timing_arcs;
1565
1580
std::map<std::string, sequential_port_delay_pair> ports_tsu;
1566
1581
std::map<std::string, sequential_port_delay_pair> ports_thld;
1567
- std::map<std::string, sequential_port_delay_pair> ports_tcq ;
1582
+ std::vector<Arc> cq_timing_arcs ;
1568
1583
1569
1584
params[" WIDTH" ] = " 0" ;
1570
1585
@@ -1639,7 +1654,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1639
1654
1640
1655
VTR_ASSERT (pb_graph_node->num_clock_ports == 0 ); // No clocks
1641
1656
1642
- return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, ports_tcq , opts_);
1657
+ return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, cq_timing_arcs , opts_);
1643
1658
}
1644
1659
1645
1660
// /@brief Returns an Instance object representing an Adder
@@ -1659,7 +1674,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1659
1674
std::vector<Arc> timing_arcs;
1660
1675
std::map<std::string, sequential_port_delay_pair> ports_tsu;
1661
1676
std::map<std::string, sequential_port_delay_pair> ports_thld;
1662
- std::map<std::string, sequential_port_delay_pair> ports_tcq ;
1677
+ std::vector<Arc> cq_timing_arcs ;
1663
1678
1664
1679
params[" WIDTH" ] = " 0" ;
1665
1680
@@ -1738,7 +1753,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1738
1753
}
1739
1754
}
1740
1755
1741
- return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, ports_tcq , opts_);
1756
+ return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, cq_timing_arcs , opts_);
1742
1757
}
1743
1758
1744
1759
std::shared_ptr<Instance> make_blackbox_instance (const t_pb* atom) {
@@ -1764,7 +1779,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1764
1779
// tcq : Clock-to-Q
1765
1780
std::map<std::string, sequential_port_delay_pair> ports_tsu;
1766
1781
std::map<std::string, sequential_port_delay_pair> ports_thld;
1767
- std::map<std::string, sequential_port_delay_pair> ports_tcq ;
1782
+ std::vector<Arc> cq_timing_arcs ;
1768
1783
1769
1784
// Delay matrix[sink_tnode] -> tuple of source_port_name, pin index, delay
1770
1785
std::map<tatum::NodeId, std::vector<std::tuple<std::string, int , DelayTriple>>> tnode_delay_matrix;
@@ -1844,7 +1859,11 @@ class NetlistWriterVisitor : public NetlistVisitor {
1844
1859
output_port_conns[port->name ].push_back (net);
1845
1860
if (pin->type == PB_PIN_SEQUENTIAL && !std::isnan (pin->tco_max )) {
1846
1861
DelayTriple delay_triple = get_pin_tco_delay_triple (*pin);
1847
- ports_tcq[port->name ] = std::make_pair (delay_triple, pin->associated_clock_pin ->port ->name );
1862
+ cq_timing_arcs.emplace_back (pin->associated_clock_pin ->port ->name ,
1863
+ pin->associated_clock_pin ->pin_number ,
1864
+ port->name ,
1865
+ ipin,
1866
+ delay_triple);
1848
1867
}
1849
1868
}
1850
1869
}
@@ -1884,7 +1903,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
1884
1903
attrs[attr.first ] = attr.second ;
1885
1904
}
1886
1905
1887
- return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, ports_tcq , opts_);
1906
+ return std::make_shared<BlackBoxInst>(type_name, inst_name, params, attrs, input_port_conns, output_port_conns, timing_arcs, ports_tsu, ports_thld, cq_timing_arcs , opts_);
1888
1907
}
1889
1908
1890
1909
// /@brief Returns the top level pb_route associated with the given pb
0 commit comments