File size: 113,472 Bytes
23d354c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 | # OpenSTA, Static Timing Analyzer
# Copyright (c) 2026, Parallax Software, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# The origin of this software must not be misrepresented; you must not
# claim that you wrote the original software.
#
# Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# This notice may not be removed or altered from any source distribution.
################################################################
#
# SDC commands.
# Alphabetical within groups as in the SDC spec.
#
# Argument parsing and checking is done in TCL before calling a
# SWIG interface function.
#
################################################################
namespace eval sta {
define_cmd_args "read_sdc" {[-echo] [-mode mode_name] filename}
proc_redirect read_sdc {
parse_key_args "read_sdc" args keys {-mode} flags {-echo}
check_argc_eq1 "read_sdc" $args
set echo [info exists flags(-echo)]
set filename [file nativename [lindex $args 0]]
if { [info exists keys(-mode)] } {
set mode_name $keys(-mode)
set prev_mode [cmd_mode_name]
try {
set_cmd_mode $mode_name
include_file $filename $echo 0
} finally {
if { $prev_mode != "default" } {
set_cmd_mode $prev_mode
}
}
} else {
include_file $filename $echo 0
}
}
################################################################
define_cmd_args "write_sdc" \
{[-mode mode] [-map_hpins] [-digits digits] [-gzip] [-no_timestamp] filename}
proc write_sdc { args } {
parse_key_args "write_sdc" args keys {-mode -digits} \
flags {-map_hpins -compatible -gzip -no_timestamp}
check_argc_eq1 "write_sdc" $args
set mode [cmd_mode_name]
if { [info exists keys(-mode)] } {
set mode $keys(-mode)
}
set digits 4
if { [info exists keys(-digits)] } {
set digits $keys(-digits)
}
check_positive_integer "-digits" $digits
set filename [file nativename [lindex $args 0]]
set gzip [info exists flags(-gzip)]
set no_timestamp [info exists flags(-no_timestamp)]
set map_hpins [info exists flags(-map_hpins)]
set native [expr ![info exists flags(-compatible)]]
write_sdc_cmd $filename $mode $map_hpins $native $digits $gzip $no_timestamp
}
################################################################
#
# General Purpose Commands
#
################################################################
define_cmd_args "current_instance" {[instance]}
proc current_instance { {inst ""} } {
if { $inst == "" } {
set current_instance [top_instance]
} else {
set current_instance [get_instance_error "instance" $inst]
}
set cell [get_name [$current_instance cell]]
report_line "Current instance is $cell."
# Current instance state variable must be part of the sta state so
# the tcl interpreter can be shared by multiple sdc files.
set_current_instance $current_instance
}
################################################################
define_cmd_args "set_hierarchy_separator" { seperator }
set ::hierarchy_separator "/"
proc set_hierarchy_separator { separator } {
global hierarchy_separator
check_path_divider $separator
set_path_divider $separator
set hierarchy_separator $separator
}
proc check_path_divider { divider } {
set sdc_dividers "/@^#.|"
if { !([string length $divider] == 1
&& [string first $divider $sdc_dividers] != -1)} {
sta_error 342 "hierarchy separator must be one of '$sdc_dividers'."
}
}
################################################################
define_cmd_args "set_units" \
{[-time time_unit] [-capacitance cap_unit] [-resistance res_unit]\
[-voltage voltage_unit] [-current current_unit] [-power power_unit]\
[-distance distance_unit]}
# Note that the set_units command does NOT actually set the units.
# It merely checks that the current units are the same as the
# units in the set_units command.
proc set_units { args } {
parse_key_args "set_units" args \
keys {-capacitance -resistance -time -voltage -current -power -distance} \
flags {}
check_argc_eq0 "set_units" $args
check_unit "time" -time "s" keys
check_unit "capacitance" -capacitance "f" keys
check_unit "resistance" -resistance "ohm" keys
check_unit "voltage" -voltage "v" keys
check_unit "current" -current "A" keys
check_unit "power" -power "W" keys
check_unit "distance" -distance "m" keys
}
proc check_unit { unit key suffix key_var } {
upvar 1 $key_var keys
if { [info exists keys($key)] } {
set value $keys($key)
set suffix_length [string length $suffix]
set arg_suffix [string range $value end-[expr $suffix_length - 1] end]
if { [string match -nocase $arg_suffix $suffix] } {
set arg_prefix [string range $value 0 end-$suffix_length]
if { [regexp "^(10*\\\.?0*)?(\[Mkmunpf\])?$" $arg_prefix ignore mult prefix] } {
if { $mult == "" } {
set mult 1
}
set scale [unit_prefix_scale $unit $prefix]
check_unit_scale $unit [expr $scale * $mult]
} else {
sta_error 343 "unknown unit $unit prefix '${arg_prefix}'."
}
} else {
sta_error 501 "incorrect unit suffix '$arg_suffix'."
}
}
}
proc unit_prefix_scale { unit prefix } {
switch -exact -- $prefix {
"M" { return 1E+6 }
"k" { return 1E+3 }
"" { return 1E+0 }
"m" { return 1E-3 }
"u" { return 1E-6 }
"n" { return 1E-9 }
"p" { return 1E-12 }
"f" { return 1E-15 }
}
sta_error 344 "unknown $unit prefix '$prefix'."
}
proc check_unit_scale { unit scale } {
set unit_scale [unit_scale $unit]
if { ![fuzzy_equal $scale $unit_scale] } {
sta_warn 345 "$unit scale [format %.0e $scale] does not match library scale [format %.0e $unit_scale]."
}
}
################################################################
#
# Object Access Commands
#
################################################################
define_cmd_args "all_clocks" {}
proc all_clocks { } {
return [get_clocks -quiet *]
}
################################################################
define_cmd_args "all_inputs" {[-no_clocks]}
proc all_inputs { args } {
parse_key_args "all_inputs" args keys {} flags {-no_clocks}
set no_clks [info exists flags(-no_clocks)]
return [all_inputs_cmd $no_clks]
}
################################################################
define_cmd_args "all_outputs" {}
proc all_outputs { args } {
check_argc_eq0 "all_outputs" $args
return [all_outputs_cmd]
}
################################################################
define_cmd_args all_registers \
{[-clock clocks] [-rise_clock clocks] [-fall_clock clocks] [-cells] [-data_pins] [-clock_pins]\
[-async_pins] [-output_pins] [-level_sensitive] [-edge_triggered]}
proc all_registers { args } {
parse_key_args "all_registers" args keys {-clock -rise_clock -fall_clock} \
flags {-cells -data_pins -clock_pins -async_pins -output_pins -level_sensitive -edge_triggered}
check_argc_eq0 "all_registers" $args
set clks {}
set clk_rf "rise_fall"
if [info exists keys(-clock)] {
set clks [get_clocks_warn "clocks" $keys(-clock)]
}
if [info exists keys(-rise_clock)] {
set clks [get_clocks_warn "clocks" $keys(-rise_clock)]
set clk_rf "rise"
}
if [info exists keys(-fall_clock)] {
set clks [get_clocks_warn "clocks" $keys(-fall_clock)]
set clk_rf "fall"
}
if {[info exists flags(-edge_triggered)] \
&& ![info exists flags(-level_sensitive)]} {
set edge_triggered 1
set level_sensitive 0
} elseif {[info exists flags(-level_sensitive)] \
&& ![info exists flags(-edge_triggered)]} {
set level_sensitive 1
set edge_triggered 0
} else {
set edge_triggered 1
set level_sensitive 1
}
if { [expr [info exists flags(-cells)] \
+ [info exists flags(-data_pins)] \
+ [info exists flags(-clock_pins)] \
+ [info exists flags(-async_pins)] \
+ [info exists flags(-output_pins)]] > 1 } {
sta_error 346 "only one of -cells, -data_pins, -clock_pins, -async_pins, -output_pins are suppported."
}
if [info exists flags(-cells)] {
return [find_register_instances $clks $clk_rf \
$edge_triggered $level_sensitive]
} elseif [info exists flags(-data_pins)] {
return [find_register_data_pins $clks $clk_rf \
$edge_triggered $level_sensitive]
} elseif [info exists flags(-clock_pins)] {
return [find_register_clk_pins $clks $clk_rf \
$edge_triggered $level_sensitive]
} elseif [info exists flags(-async_pins)] {
return [find_register_async_pins $clks $clk_rf \
$edge_triggered $level_sensitive]
} elseif [info exists flags(-output_pins)] {
return [find_register_output_pins $clks $clk_rf \
$edge_triggered $level_sensitive]
} else {
# -cells is the default.
return [find_register_instances $clks $clk_rf \
$edge_triggered $level_sensitive]
}
}
################################################################
define_cmd_args "current_design" {[design]}
variable current_design_name ""
proc current_design { {design ""} } {
variable current_design_name
if { $design == "" } {
# top_instance errors if the network has not been linked.
set current_design_name [get_name [get_object_property [top_instance] cell]]
} elseif { ![network_is_linked] } {
set current_design_name $design
return $design
} elseif { [network_is_linked] && $design == [get_name [get_object_property [top_instance] cell]] } {
set current_design_name $design
return $design
} else {
sta_warn 347 "current_design for other than top cell not supported."
set current_design_name $design
return $design
}
}
################################################################
define_cmd_args "get_cells" \
{[-hierarchical] [-hsc separator] [-filter expr]\
[-regexp] [-nocase] [-quiet] [-of_objects objects] [patterns]}
define_cmd_alias "get_cell" "get_cells"
# Really get_instances, but SDC calls instances "cells".
proc get_cells { args } {
global hierarchy_separator
parse_key_args "get_cells" args keys {-hsc -filter -of_objects} \
flags {-hierarchical -regexp -nocase -quiet}
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set hierarchical [info exists flags(-hierarchical)]
set quiet [info exists flags(-quiet)]
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
set divider $hierarchy_separator
if [info exists keys(-hsc)] {
set divider $keys(-hsc)
check_path_divider $divider
}
set insts {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 348 "patterns argument not supported with -of_objects."
}
parse_port_pin_net_arg $keys(-of_objects) pins nets
foreach pin $pins {
if { [$pin is_top_level_port] } {
set net [get_nets [get_name $pin]]
if { $net != "NULL" } {
lappend nets $net
}
} else {
lappend insts [$pin instance]
}
}
foreach net $nets {
set pin_iter [$net pin_iterator]
while { [$pin_iter has_next] } {
set pin [$pin_iter next]
lappend insts [$pin instance]
}
$pin_iter finish
}
} else {
check_argc_eq0or1 "get_cells" $args
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "Instance" } {
sta_error 326 "object '$pattern' is not an instance."
}
set insts [concat $insts $pattern]
} else {
if { $divider != $hierarchy_separator } {
regsub $divider $pattern $hierarchy_separator pattern
}
if { $hierarchical } {
set matches [find_instances_hier_matching $pattern $regexp $nocase]
} else {
set matches [find_instances_matching $pattern $regexp $nocase]
}
if { $matches == {} && !$quiet} {
sta_warn 349 "instance '$pattern' not found."
}
set insts [concat $insts $matches]
}
}
}
if [info exists keys(-filter)] {
set insts [filter_insts $keys(-filter) $insts]
}
return $insts
}
################################################################
define_cmd_args "get_clocks" {[-regexp] [-nocase] [-quiet] [-filter expr] [patterns]}
define_cmd_alias "get_clock" "get_clocks"
proc get_clocks { args } {
parse_key_args "get_clocks" args keys {-filter} flags {-regexp -nocase -quiet}
check_argc_eq0or1 "get_clocks" $args
check_nocase_flag flags
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set clocks {}
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "Clock" } {
sta_error 327 "object '$pattern' is not an clock."
}
set clocks [concat $clocks $pattern]
} else {
set matches [find_clocks_matching $pattern $regexp $nocase]
if { $matches != {} } {
set clocks [concat $clocks $matches]
} else {
if {![info exists flags(-quiet)]} {
sta_warn 351 "clock '$pattern' not found."
}
}
}
}
if [info exists keys(-filter)] {
set clocks [filter_clocks $keys(-filter) $clocks]
}
return $clocks
}
################################################################
define_cmd_args "get_lib_cells" \
{[-hsc separator] [-regexp] [-nocase] [-quiet] [-filter expr]\
[-of_objects objects] [patterns]}
define_cmd_alias "get_lib_cell" "get_lib_cells"
proc get_lib_cells { args } {
global hierarchy_separator
parse_key_args "get_lib_cells" args keys {-hsc -of_objects -filter} \
flags {-regexp -nocase -quiet}
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set cells {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 352 "positional arguments not supported with -of_objects."
}
set insts [get_instances_error "objects" $keys(-of_objects)]
foreach inst $insts {
lappend cells [$inst liberty_cell]
}
} else {
check_argc_eq0or1 "get_lib_cells" $args
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
# Parse library_name/pattern.
set divider $hierarchy_separator
if [info exists keys(-hsc)] {
set divider $keys(-hsc)
check_path_divider $divider
}
set cell_regexp [cell_regexp_hsc $divider]
set quiet [info exists flags(-quiet)]
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "LibertyCell" } {
sta_error 328 "object '$pattern' is not a liberty cell."
}
set cells [concat $cells $pattern]
} else {
if { ![regexp $cell_regexp $pattern ignore lib_name cell_pattern]} {
set lib_name "*"
set cell_pattern $pattern
}
# Allow wildcards in the library name (incompatible).
set libs [get_libs -quiet $lib_name]
if { $libs == {} } {
if {!$quiet} {
sta_warn 353 "library '$lib_name' not found."
}
} else {
foreach lib $libs {
set matches [$lib find_liberty_cells_matching $cell_pattern \
$regexp $nocase]
if {$matches != {}} {
set cells [concat $cells $matches]
}
}
if { $cells == {} } {
if {!$quiet} {
sta_warn 354 "cell '$cell_pattern' not found."
}
}
}
}
}
}
if [info exists keys(-filter)] {
set cells [filter_lib_cells $keys(-filter) $cells]
}
return $cells
}
################################################################
define_cmd_args "get_lib_pins" \
{[-hsc separator] [-regexp] [-nocase] [-quiet] [-filter expr]\
[-of_objects objects] [patterns]}
define_cmd_alias "get_lib_pin" "get_lib_pins"
# "get_lib_ports" in sta terminology.
proc get_lib_pins { args } {
global hierarchy_separator
parse_key_args "get_lib_pins" args keys {-hsc -of_objects -filter} \
flags {-regexp -nocase -quiet}
check_argc_eq0or1 "get_lib_pins" $args
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set quiet [info exists flags(-quiet)]
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*/*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
# Parse library_name/cell_name/pattern.
set divider $hierarchy_separator
if [info exists keys(-hsc)] {
set divider $keys(-hsc)
check_path_divider $divider
}
set port_regexp1 [port_regexp_hsc $divider]
set port_regexp2 [cell_regexp_hsc $divider]
set ports {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 335 "positional arguments not supported with -of_objects."
}
set libcells [get_libcells_error "objects" $keys(-of_objects)]
foreach libcell $libcells {
foreach port [$libcell find_liberty_ports_matching * 0 1] {
# Filter pg ports.
if { ![$port is_pwr_gnd] } {
lappend ports $port
}
}
}
} else {
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "LibertyPort" } {
sta_error 329 "object '$pattern' is not a liberty pin."
}
set ports [concat $ports $pattern]
} else {
# match library/cell/port
set libs {}
if { [regexp $port_regexp1 $pattern ignore lib_name cell_name port_pattern] } {
set libs [get_libs -quiet $lib_name]
# match cell/port
} elseif { [regexp $port_regexp2 $pattern ignore cell_name port_pattern] } {
set libs [get_libs *]
} else {
if { !$quiet } {
sta_warn 355 "library/cell/port '$pattern' not found."
}
return {}
}
if { $libs != {} } {
set found_match 0
set cells {}
foreach lib $libs {
set cells [$lib find_liberty_cells_matching $cell_name $regexp $nocase]
foreach cell $cells {
set matches [$cell find_liberty_ports_matching $port_pattern \
$regexp $nocase]
foreach match $matches {
# Filter pg ports.
if { ![$match is_pwr_gnd] } {
lappend ports $match
set found_match 1
}
}
}
}
if { !$found_match } {
if { !$quiet } {
sta_warn 356 "port '$port_pattern' not found."
}
}
} else {
if { !$quiet } {
sta_warn 357 "library '$lib_name' not found."
}
}
}
}
}
if [info exists keys(-filter)] {
set ports [filter_lib_pins $keys(-filter) $ports]
}
return $ports
}
proc check_nocase_flag { flags_var } {
upvar 1 $flags_var flags
if { [info exists flags(-nocase)] && ![info exists flags(-regexp)] } {
sta_warn 358 "-nocase ignored without -regexp."
}
}
################################################################
define_cmd_args "get_libs" {[-regexp] [-nocase] [-quiet] [-filter expr] [patterns]}
define_cmd_alias "get_lib" "get_libs"
proc get_libs { args } {
parse_key_args "get_libs" args keys {-filter} flags {-regexp -nocase -quiet}
check_argc_eq0or1 "get_libs" $args
check_nocase_flag flags
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set libs {}
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "LibertyLibrary" } {
sta_error 330 "object '$pattern' is not a liberty library."
}
set libs [concat $libs $pattern]
} else {
set matches [find_liberty_libraries_matching $pattern $regexp $nocase]
if {$matches != {}} {
set libs [concat $libs $matches]
} else {
if {![info exists flags(-quiet)]} {
sta_warn 359 "library '$pattern' not found."
}
}
}
}
if [info exists keys(-filter)] {
set libs [filter_liberty_libraries $keys(-filter) $libs]
}
return $libs
}
proc find_liberty_libraries_matching { pattern regexp nocase } {
# Remove "lib.db:" reference from the library name.
set ix [string last ".db:" $pattern]
if { $ix != -1 } {
set pattern2 [string range $pattern [expr $ix + 4] end]
} else {
set pattern2 $pattern
}
if { $regexp } {
# Anchor the regexp pattern.
set pattern2 "^${pattern}$"
}
set lib_iter [liberty_library_iterator]
set matches {}
while { [$lib_iter has_next] } {
set lib [$lib_iter next]
set lib_name [get_name $lib]
if { (!$regexp && [string match $pattern2 $lib_name]) \
|| ($regexp && $nocase && [regexp -nocase $pattern2 $lib_name]) \
|| ($regexp && !$nocase && [regexp $pattern2 $lib_name]) } {
lappend matches $lib
}
}
$lib_iter finish
return $matches
}
################################################################
define_cmd_args "get_nets" \
{[-hierarchical] [-hsc separator] [-regexp] [-nocase] [-quiet] [-filter expr]\
[-of_objects objects] [patterns]}
define_cmd_alias "get_net" "get_nets"
proc get_nets { args } {
global hierarchy_separator
parse_key_args get_nets args keys {-hsc -of_objects -filter} \
flags {-hierarchical -regexp -nocase -quiet}
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set hierarchical [info exists flags(-hierarchical)]
set quiet [info exists flags(-quiet)]
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
if [info exists keys(-hsc)] {
set divider $keys(-hsc)
check_path_divider $divider
set patterns [string map "$divider $hierarchy_separator" $patterns]
}
set nets {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 360 "patterns argument not supported with -of_objects."
}
parse_inst_pin_arg $keys(-of_objects) insts pins
foreach inst $insts {
set pin_iter [$inst pin_iterator]
while { [$pin_iter has_next] } {
set pin [$pin_iter next]
lappend nets [$pin net]
}
$pin_iter finish
}
foreach pin $pins {
lappend nets [$pin net]
}
} else {
check_argc_eq0or1 "get_nets" $args
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "Net" } {
sta_error 331 "object '$pattern' is not a net."
}
set nets [concat $nets $pattern]
} else {
if { $hierarchical } {
set matches [find_nets_hier_matching $pattern $regexp $nocase]
} else {
set matches [find_nets_matching $pattern $regexp $nocase]
}
set nets [concat $nets $matches]
if { $matches == {} && !$quiet } {
sta_warn 361 "net '$pattern' not found."
}
}
}
}
if [info exists keys(-filter)] {
set nets [filter_nets $keys(-filter) $nets]
}
return $nets
}
################################################################
define_cmd_args "get_pins" \
{[-hierarchical] [-hsc separator] [-quiet] [-filter expr]\
[-regexp] [-nocase] [-of_objects objects] [patterns]}
define_cmd_alias "get_pin" "get_pins"
proc get_pins { args } {
global hierarchy_separator
parse_key_args "get_pins" args keys {-hsc -of_objects -filter} \
flags {-hierarchical -regexp -nocase -quiet}
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
set hierarchical [info exists flags(-hierarchical)]
set quiet [info exists flags(-quiet)]
set pins {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 362 "patterns argument not supported with -of_objects."
}
parse_inst_net_arg $keys(-of_objects) insts nets
foreach inst $insts {
set pin_iter [$inst pin_iterator]
while { [$pin_iter has_next] } {
set pin [$pin_iter next]
# Filter pg ports.
if { ![$pin is_pwr_gnd] } {
lappend pins $pin
}
}
$pin_iter finish
}
foreach net $nets {
set pin_iter [$net pin_iterator]
while { [$pin_iter has_next] } {
set pin [$pin_iter next]
# Filter pg ports.
if { ![$pin is_pwr_gnd] } {
lappend pins $pin
}
}
$pin_iter finish
}
} else {
check_argc_eq0or1 "get_pins" $args
if { $args == {} } {
set patterns "*"
} else {
set patterns [lindex $args 0]
}
if [info exists keys(-hsc)] {
set divider $keys(-hsc)
check_path_divider $divider
set patterns [string map "$divider $hierarchy_separator" $patterns]
}
# Copy backslashes that will be removed by foreach.
set patterns [string map {\\ \\\\} $patterns]
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "Pin" } {
sta_error 332 "object '$pattern' is not a pin."
}
set pins [concat $pins $pattern]
} else {
if { $hierarchical } {
set matches [find_pins_hier_matching $pattern $regexp $nocase]
} else {
set matches [find_pins_matching $pattern $regexp $nocase]
}
foreach match $matches {
# Filter pg ports.
if { ![$match is_pwr_gnd] } {
lappend pins $match
}
}
if { $matches == {} && !$quiet } {
sta_warn 363 "pin '$pattern' not found."
}
}
}
}
if [info exists keys(-filter)] {
set pins [filter_pins $keys(-filter) $pins]
}
return $pins
}
################################################################
define_cmd_args "get_ports" \
{[-quiet] [-filter expr] [-regexp] [-nocase] [-of_objects objects] [patterns]}
define_cmd_alias "get_port" "get_ports"
# Find top level design ports matching pattern.
proc get_ports { args } {
parse_key_args "get_ports" args keys {-of_objects -filter} \
flags {-regexp -nocase -quiet}
check_nocase_flag flags
set regexp [info exists flags(-regexp)]
set nocase [info exists flags(-nocase)]
# Copy backslashes that will be removed by foreach.
if { $args == {} } {
set patterns "*"
} else {
set patterns [string map {\\ \\\\} [lindex $args 0]]
}
set ports {}
if [info exists keys(-of_objects)] {
if { $args != {} } {
sta_warn 365 "patterns argument not supported with -of_objects."
}
set nets [get_nets_arg "objects" $keys(-of_objects)]
foreach net $nets {
set ports [concat $ports [$net ports]]
}
} else {
check_argc_eq0or1 "get_ports" $args
foreach pattern $patterns {
if { [is_object $pattern] } {
if { [object_type $pattern] != "Port" } {
sta_error 333 "object '$pattern' is not a port."
}
set ports [concat $ports $pattern]
} else {
set matches [find_ports_matching $pattern $regexp $nocase]
if { $matches != {} } {
set ports [concat $ports $matches]
} else {
if {![info exists flags(-quiet)]} {
sta_warn 366 "port '$pattern' not found."
}
}
}
}
}
if [info exists keys(-filter)] {
set ports [filter_ports $keys(-filter) $ports]
}
return $ports
}
################################################################
#
# Timing Constraints
#
################################################################
define_cmd_args "create_clock" \
{[-name name] [-period period] [-waveform waveform] [-add]\
[-comment comment] [pins]}
proc create_clock { args } {
parse_key_args "create_clock" args \
keys {-name -period -waveform -comment} \
flags {-add}
check_argc_eq0or1 "create_clock" $args
set argc [llength $args]
if { $argc == 0 } {
set pins {}
} elseif { $argc == 1 } {
set pins [get_port_pins_error "pins" [lindex $args 0]]
}
set add [info exists flags(-add)]
if [info exists keys(-name)] {
set name $keys(-name)
} elseif { $pins != {} } {
if { $add } {
sta_error 368 "-add requires -name."
}
# Default clock name is the first pin name.
set name [get_full_name [lindex $pins 0]]
} else {
sta_error 369 "-name or port_pin_list must be specified."
}
if [info exists keys(-period)] {
set period $keys(-period)
check_positive_float "period" $period
set period [time_ui_sta $period]
} else {
sta_error 370 "missing -period argument."
}
if [info exists keys(-waveform)] {
set wave_arg $keys(-waveform)
if { [expr [llength $wave_arg] % 2] != 0 } {
sta_error 371 "-waveform edge_list must have an even number of edge times."
}
set first_edge 1
set prev_edge 0
set waveform {}
foreach edge $wave_arg {
check_float "-waveform edge" $edge
set edge [time_ui_sta $edge]
if { !$first_edge && $edge < $prev_edge } {
sta_error 372 "non-increasing clock -waveform edge times."
}
if { $edge > [expr $period * 2] } {
sta_error 373 "-waveform time greater than two periods."
}
lappend waveform $edge
set prev_edge $edge
set first_edge 0
}
} else {
set waveform [list 0 [expr $period / 2.0]]
}
set comment [parse_comment_key keys]
make_clock $name $pins $add $period $waveform $comment
}
################################################################
define_cmd_args "delete_clock" {[-all] clocks}
proc delete_clock { args } {
parse_key_args "delete_clock" args keys {} flags {-all}
if { [info exists flags(-all)] } {
check_argc_eq0 "delete_clock" $args
set clks [all_clocks]
} else {
check_argc_eq1 "delete_clock" $args
set clks [get_clocks_warn "clocks" [lindex $args 0]]
}
foreach clk $clks {
remove_clock_cmd $clk
}
}
################################################################
define_cmd_args "create_generated_clock" \
{[-name clock_name] -source master_pin [-master_clock clock]\
[-divide_by divisor | -multiply_by multiplier]\
[-duty_cycle duty_cycle] [-invert] [-edges edge_list]\
[-edge_shift edge_shift_list] [-combinational] [-add]\
[-comment comment] port_pin_list}
proc create_generated_clock { args } {
parse_key_args "create_generated_clock" args keys \
{-name -source -master_clock -divide_by -multiply_by \
-duty_cycle -edges -edge_shift -comment} \
flags {-invert -combinational -add}
check_argc_eq1 "create_generated_clock" $args
parse_port_pin_net_arg [lindex $args 0] pins nets
# Convert net args to net driver pin.
foreach net $nets {
set drivers [net_driver_pins $net]
if { $drivers != {} } {
lappend pins [lindex $drivers 0]
}
}
if { $pins == {} } {
sta_error 374 "empty ports/pins/nets argument."
}
set add [info exists flags(-add)]
if [info exists keys(-name)] {
set name $keys(-name)
} elseif { $pins != {} } {
if { $add } {
sta_error 375 "-add requires -name."
}
# Default clock name is the first pin name.
set name [get_full_name [lindex $pins 0]]
} else {
sta_error 376 "name or port_pin_list must be specified."
}
if [info exists keys(-source)] {
set source $keys(-source)
set source_pin [get_port_pin_error "master_pin" $source]
} else {
sta_error 377 "missing -source argument."
}
set master_clk "NULL"
set divide_by 0
set multiply_by 0
set duty_cycle 0
set edges {}
set edge_shifts {}
set combinational [info exists flags(-combinational)]
if {[info exists keys(-master_clock)]} {
set master_clk [get_clock_error "-master_clk" $keys(-master_clock)]
if { $master_clk == "NULL" } {
sta_error 378 "-master_clock argument empty."
}
} elseif { $add } {
sta_error 379 "-add requireds -master_clock."
}
if {[info exists keys(-divide_by)] && [info exists keys(-multiply_by)]} {
sta_error 380 "-multiply_by and -divide_by options are exclusive."
} elseif {[info exists keys(-divide_by)]} {
set divide_by $keys(-divide_by)
if {![string is integer $divide_by] || $divide_by < 1} {
sta_error 381 "-divide_by is not an integer greater than one."
}
if {$combinational && $divide_by != 1} {
sta_error 382 "-combinational implies -divide_by 1."
}
} elseif {[info exists keys(-multiply_by)]} {
set multiply_by $keys(-multiply_by)
if {![string is integer $multiply_by] || $multiply_by < 1} {
sta_error 383 "-multiply_by is not an integer greater than one."
}
if {[info exists keys(-duty_cycle)]} {
set duty_cycle $keys(-duty_cycle)
if {![string is double $duty_cycle] \
|| $duty_cycle < 0.0 || $duty_cycle > 100.0} {
sta_error 384 "-duty_cycle is not a float between 0 and 100."
}
}
} elseif {[info exists keys(-edges)]} {
set edges $keys(-edges)
if { [llength $edges] != 3 } {
sta_error 385 "-edges only supported for three edges."
}
set prev_edge [expr [lindex $edges 0] - 1]
foreach edge $edges {
check_cardinal "-edges" $edge
if { $edge <= $prev_edge } {
sta_error 386 "edges times are not monotonically increasing."
}
}
if [info exists keys(-edge_shift)] {
foreach shift $keys(-edge_shift) {
check_float "-edge_shift" $shift
lappend edge_shifts [time_ui_sta $shift]
}
if { [llength $edge_shifts] != [llength $edges] } {
sta_error 387 "-edge_shift length does not match -edges length."
}
}
} elseif { $combinational } {
set divide_by 1
} else {
sta_error 388 "missing -multiply_by, -divide_by, -combinational or -edges argument."
}
set invert 0
if {[info exists flags(-invert)]} {
if {!([info exists keys(-divide_by)] \
|| [info exists keys(-multiply_by)] \
|| [info exists flags(-combinational)])} {
sta_error 389 "cannot specify -invert without -multiply_by, -divide_by or -combinational."
}
set invert 1
}
if {[info exists keys(-duty_cycle)] && ![info exists keys(-multiply_by)]} {
sta_error 390 "-duty_cycle requires -multiply_by value."
}
set comment [parse_comment_key keys]
make_generated_clock $name $pins $add $source_pin $master_clk \
$divide_by $multiply_by $duty_cycle $invert $combinational \
$edges $edge_shifts $comment
}
################################################################
define_cmd_args "delete_generated_clock" {[-all] clocks}
proc delete_generated_clock { args } {
remove_gclk_cmd "delete_generated_clock" $args
}
proc remove_gclk_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args keys {} flags {-all}
if { [info exists flags(-all)] } {
check_argc_eq0 $cmd $cmd_args
set clks [all_clocks]
} else {
check_argc_eq1 $cmd $cmd_args
set clks [get_clocks_warn "clocks" [lindex $cmd_args 0]]
}
foreach clk $clks {
if { [$clk is_generated] } {
remove_clock_cmd $clk
}
}
}
################################################################
define_cmd_args "group_path" \
{-name group_name [-weight weight] [-critical_range range]\
[-default] [-comment comment]\
[-from from_list] [-rise_from from_list] [-fall_from from_list]\
[-through through_list] [-rise_through through_list]\
[-fall_through through_list] [-to to_list] [-rise_to to_list]\
[-fall_to to_list]}
# The -weight and -critical_range arguments are ignored.
proc group_path { args } {
parse_key_args "group_path" args \
keys {-name -weight -critical_range \
-from -rise_from -fall_from \
-to -rise_to -fall_to -comment} \
flags {-default} 0
set cmd "group_path"
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg args arg_error]
set to [parse_to_arg1 keys "rise_fall" arg_error]
check_exception_pins $from $to
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
sta_error 391 "group_path command failed."
return 0
}
check_for_key_args $cmd args
if { $args != {} } {
delete_from_thrus_to $from $thrus $to
sta_error 392 "positional arguments not supported."
}
if { ($from == "NULL" && $thrus == "" && $to == "NULL") } {
delete_from_thrus_to $from $thrus $to
sta_error 393 "-from, -through or -to required."
}
set default [info exists flags(-default)]
set name_exists [info exists keys(-name)]
if { $default && $name_exists } {
sta_error 394 "-name and -default are mutually exclusive."
} elseif { !$name_exists && !$default } {
sta_error 395 "-name or -default option is required."
} elseif { $default } {
set name ""
} else {
set name $keys(-name)
}
set comment [parse_comment_key keys]
make_group_path $name $default $from $thrus $to $comment
}
proc check_exception_pins { from to } {
set file [sdc_filename]
set line [sdc_file_line]
check_exception_from_pins $from $file $line
check_exception_to_pins $to $file $line
}
################################################################
define_cmd_args "set_clock_gating_check" \
{[-setup setup_time] [-hold hold_time] [-rise] [-fall]\
[-low] [-high] [objects]}
proc set_clock_gating_check { args } {
parse_key_args "set_clock_gating_check" args keys {-setup -hold } \
flags {-rise -fall -high -low}
check_argc_eq0or1 "set_clock_gating_check" $args
set rf [parse_rise_fall_flags flags]
set active_value ""
if {[info exists flags(-high)] && [info exists flags(-low)]} {
sta_error 396 "cannot specify both -high and -low."
} elseif [info exists flags(-low)] {
set active_value "0"
} elseif [info exists flags(-high)] {
set active_value "1"
}
if { !([info exists keys(-hold)] || [info exists keys(-setup)]) } {
sta_error 397 "missing -setup or -hold argument."
}
if [info exists keys(-hold)] {
set_clock_gating_check1 $args $rf "min" $keys(-hold) $active_value
}
if [info exists keys(-setup)] {
set_clock_gating_check1 $args $rf "max" $keys(-setup) $active_value
}
}
proc set_clock_gating_check1 { args rf setup_hold margin active_value } {
set margin [time_ui_sta $margin]
if { [llength $args] == 0 } {
if { $active_value != "" } {
sta_error 398 "-high and -low only permitted for pins and instances."
}
set_clock_gating_check_cmd $rf $setup_hold $margin
} elseif { [llength $args] == 1 } {
parse_clk_inst_port_pin_arg [lindex $args 0] clks insts pins
if { $clks != {} && $active_value != "" } {
sta_error 399 "-high and -low only permitted for pins and instances."
}
foreach clk $clks {
set_clock_gating_check_clk_cmd $clk $rf $setup_hold $margin
}
if { $active_value == "" } {
set active_value "X"
}
foreach pin $pins {
set_clock_gating_check_pin_cmd $pin $rf $setup_hold \
$margin $active_value
}
foreach inst $insts {
set_clock_gating_check_instance_cmd $inst $rf $setup_hold \
$margin $active_value
}
}
}
################################################################
define_cmd_args "set_clock_groups" \
{[-name name] [-logically_exclusive] [-physically_exclusive]\
[-asynchronous] [-allow_paths] [-comment comment] -group clocks}
proc set_clock_groups { args } {
parse_key_args "set_clock_groups" args \
keys {-name -comment} \
flags {-logically_exclusive -physically_exclusive \
-asynchronous -allow_paths} 0
if {[info exists keys(-name)]} {
set name $keys(-name)
} else {
set name ""
}
set logically_exclusive [info exists flags(-logically_exclusive)]
set physically_exclusive [info exists flags(-physically_exclusive)]
set asynchronous [info exists flags(-asynchronous)]
set allow_paths [info exists flags(-allow_paths)]
if { ($logically_exclusive+$physically_exclusive+$asynchronous) == 0 } {
sta_error 400 "one of -logically_exclusive, -physically_exclusive or -asynchronous is required."
}
if { ($logically_exclusive+$physically_exclusive+$asynchronous) > 1 } {
sta_error 401 "the keywords -logically_exclusive, -physically_exclusive and -asynchronous are mutually exclusive."
}
set comment [parse_comment_key keys]
set clk_groups [make_clock_groups $name $logically_exclusive \
$physically_exclusive $asynchronous $allow_paths \
$comment]
while { $args != "" } {
set arg [lindex $args 0]
if {[string match $arg "-group"]} {
set group_clks [get_clocks_warn "clocks" [lindex $args 1]]
if { $group_clks != {} } {
clock_groups_make_group $clk_groups $group_clks
}
set args [lrange $args 2 end]
} else {
if {[is_keyword_arg $arg]} {
sta_warn 402 "unknown keyword argument $arg."
} else {
sta_warn 403 "extra positional argument $arg."
}
set args [lrange $args 1 end]
}
}
}
################################################################
define_cmd_args "unset_clock_groups" \
{[-logically_exclusive] [-physically_exclusive]\
[-asynchronous] [-name names] [-all]}
proc unset_clock_groups { args } {
unset_clk_groups_cmd "unset_clock_groups" $args
}
proc unset_clk_groups_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args \
keys {-name} \
flags {-logically_exclusive -physically_exclusive -asynchronous -all}
set all [info exists flags(-all)]
set names {}
if {[info exists keys(-name)]} {
set names $keys(-name)
}
if { $all && $names != {} } {
sta_error 404 "the -all and -name options are mutually exclusive."
}
if { !$all && $names == {} } {
sta_error 405 "either -all or -name options must be specified."
}
set logically_exclusive [info exists flags(-logically_exclusive)]
set physically_exclusive [info exists flags(-physically_exclusive)]
set asynchronous [info exists flags(-asynchronous)]
if { ($logically_exclusive+$physically_exclusive+$asynchronous) == 0 } {
sta_error 406 "one of -logically_exclusive, -physically_exclusive or -asynchronous is required."
}
if { ($logically_exclusive+$physically_exclusive+$asynchronous) > 1 } {
sta_error 407 "the keywords -logically_exclusive, -physically_exclusive and -asynchronous are mutually exclusive."
}
if { $all } {
if { $logically_exclusive } {
unset_clock_groups_logically_exclusive_all
} elseif { $physically_exclusive } {
unset_clock_groups_physically_exclusive_all
} elseif { $asynchronous } {
unset_clock_groups_asynchronous_all
}
} else {
foreach name $names {
if { $logically_exclusive } {
unset_clock_groups_logically_exclusive $name
} elseif { $physically_exclusive } {
unset_clock_groups_physically_exclusive $name
} elseif { $asynchronous } {
unset_clock_groups_asynchronous $name
}
}
}
}
################################################################
define_cmd_args "set_clock_latency" \
{[-source] [-clock clock] [-rise] [-fall] [-min] [-max]\
[-early] [-late] delay objects}
proc set_clock_latency { args } {
parse_key_args "set_clock_latency" args keys {-clock} \
flags {-rise -fall -min -max -source -late -early}
check_argc_eq2 "set_clock_latency" $args
set delay [lindex $args 0]
check_float "delay" $delay
set delay [time_ui_sta $delay]
set objects [lindex $args 1]
parse_clk_port_pin_arg $objects clks pins
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
set pin_clk "NULL"
if { [info exists keys(-clock)] } {
set pin_clk [get_clock_warn "clock" $keys(-clock)]
if { $clks != {} } {
sta_warn 408 "-clock ignored for clock objects."
}
}
if {[info exists flags(-source)]} {
# Insertion delay (source latency).
set early_late [parse_early_late_all_flags flags]
foreach clk $clks {
set_clock_insertion_cmd $clk "NULL" $rf $min_max $early_late $delay
}
foreach pin $pins {
# Source only allowed on clocks and clock pins.
if { ![is_clock_src $pin] } {
sta_error 409 "-source '[get_full_name $pin]' is not a clock pin."
}
set_clock_insertion_cmd $pin_clk $pin $rf $min_max $early_late $delay
}
} else {
# Latency.
if {[info exists flags(-early)] || [info exists flags(-late)]} {
sta_error 410 "-early/-late is only allowed with -source."
}
foreach clk $clks {
set_clock_latency_cmd $clk "NULL" $rf $min_max $delay
}
foreach pin $pins {
set_clock_latency_cmd $pin_clk $pin $rf $min_max $delay
}
}
}
################################################################
define_cmd_args "unset_clock_latency" {[-source] [-clock clock] objects}
proc unset_clock_latency { args } {
unset_clk_latency_cmd "unset_clock_latency" $args
}
proc unset_clk_latency_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args keys {-clock} flags {-source}
check_argc_eq1 $cmd $cmd_args
set objects [lindex $cmd_args 0]
parse_clk_port_pin_arg $objects clks pins
set pin_clk "NULL"
if { [info exists keys(-clock)] } {
set pin_clk [get_clock_warn "clock" $keys(-clock)]
if { $clks != {} } {
sta_warn 411 "-clock ignored for clock objects."
}
}
if {[info exists flags(-source)]} {
# Source latency.
foreach clk $clks {
unset_clock_insertion_cmd $clk "NULL"
}
foreach pin $pins {
# Source only allowed on clocks and clock pins.
if { ![is_clock_pin $pin] } {
sta_error 412 "-source '[$pin path_name]' is not a clock pin."
}
unset_clock_insertion_cmd $pin_clk $pin
}
} else {
# Latency.
foreach clk $clks {
unset_clock_latency_cmd $clk "NULL"
}
foreach pin $pins {
unset_clock_latency_cmd $pin_clk $pin
}
}
}
################################################################
define_cmd_args "set_sense" \
{[-type clock|data] [-positive] [-negative] [-pulse pulse_type]\
[-stop_propagation] [-clocks clocks] pins}
proc set_sense { args } {
parse_key_args "set_sense" args keys {-type} flags {} 0
set type "clock"
if { [info exists keys(-type)] } {
set type $keys(-type)
if { $type == "data" } {
sta_warn 413 "set_sense -type data not supported."
} elseif { $type == "clock" } {
set_clock_sense_cmd1 "set_sense" $args
} else {
sta_error 414 "set_sense -type clock|data"
}
}
}
# deprecated in SDC 2.1
define_cmd_args "set_clock_sense" \
{[-positive] [-negative] [-pulse pulse_type] [-stop_propagation] \
[-clock clocks] pins}
proc set_clock_sense { args } {
sta_warn 415 "set_clock_sense is deprecated as of SDC 2.1. Use set_sense -type clock."
set_clock_sense_cmd1 "set_clock_sense" $args
}
proc set_clock_sense_cmd1 { cmd cmd_args } {
# SDC uses -clock, OT, OC use -clocks
parse_key_args $cmd cmd_args keys {-clock -clocks -pulse} \
flags {-positive -negative -stop_propagation} 0
check_argc_eq1 $cmd $cmd_args
set pulse [info exists keys(-pulse)]
if { $pulse } {
sta_warn 416 "-pulse argument not supported."
}
set positive [info exists flags(-positive)]
set negative [info exists flags(-negative)]
set stop_propagation [info exists flags(-stop_propagation)]
if { ($positive && ($negative || $stop_propagation || $pulse)) \
|| ($negative && ($positive || $stop_propagation || $pulse)) \
|| ($stop_propagation && ($positive || $negative || $pulse))
|| ($pulse && ($positive || $negative || $stop_propagation)) } {
sta_warn 417 "-positive, -negative, -stop_propagation and -pulse are mutually exclusive."
}
set pins [get_port_pins_error "pins" [lindex $cmd_args 0]]
set clks {}
if {[info exists keys(-clock)]} {
set clks [get_clocks_warn "clock" $keys(-clock)]
}
if {[info exists keys(-clocks)]} {
set clks [get_clocks_warn "clocks" $keys(-clocks)]
}
foreach pin $pins {
if {[$pin is_hierarchical]} {
sta_warn 418 "hierarchical pin '[get_full_name $pin]' not supported."
}
}
set_clock_sense_cmd $pins $clks $positive $negative $stop_propagation
}
################################################################
define_cmd_args "set_clock_transition" \
{[-rise] [-fall] [-min] [-max] transition clocks}
proc set_clock_transition { args } {
parse_key_args "set_clock_transition" args keys {} \
flags {-rise -fall -max -min}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
check_argc_eq2 "set_clock_transition" $args
set slew [lindex $args 0]
set clks [get_clocks_warn "clocks" [lindex $args 1]]
foreach clk $clks {
if { [$clk is_virtual] } {
sta_warn 419 "transition time can not be specified for virtual clocks."
} else {
set_clock_slew_cmd $clk $rf $min_max [time_ui_sta $slew]
}
}
}
################################################################
define_cmd_args "unset_clock_transition" {clocks}
proc unset_clock_transition { args } {
check_argc_eq1 "unset_clock_transition" $args
set clks [get_clocks_warn "clocks" [lindex $args 0]]
foreach clk $clks {
unset_clock_slew_cmd $clk
}
}
################################################################
# -rise/-fall are obsolete.
define_cmd_args "set_clock_uncertainty" \
{[-from|-rise_from|-fall_from from_clock]\
[-to|-rise_to|-fall_to to_clock] [-rise] [-fall]\
[-setup] [-hold] uncertainty [objects]}
proc set_clock_uncertainty { args } {
parse_key_args "set_clock_uncertainty" args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to} \
flags {-rise -fall -setup -hold}
if { [llength $args] == 0 } {
sta_error 420 "missing uncertainty value."
}
set uncertainty [lindex $args 0]
check_float "uncertainty" $uncertainty
set uncertainty [time_ui_sta $uncertainty]
set min_max "min_max"
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set min_max "max"
}
if { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set min_max "min"
}
if { [info exists keys(-from)] } {
set from_key "-from"
set from_rf "rise_fall"
} elseif { [info exists keys(-rise_from)] } {
set from_key "-rise_from"
set from_rf "rise"
} elseif { [info exists keys(-fall_from)] } {
set from_key "-fall_from"
set from_rf "fall"
} else {
set from_key "none"
}
if { [info exists keys(-to)] } {
set to_key "-to"
if { [info exists flags(-rise)] } {
set to_rf "rise"
} elseif { [info exists flags(-fall)] } {
set to_rf "fall"
} else {
set to_rf "rise_fall"
}
} elseif { [info exists keys(-rise_to)] } {
set to_key "-rise_to"
set to_rf "rise"
} elseif { [info exists keys(-fall_to)] } {
set to_key "-fall_to"
set to_rf "fall"
} else {
set to_key "none"
}
if { $from_key != "none" && $to_key == "none" \
|| $from_key == "none" && $to_key != "none" } {
sta_error 421 "-from/-to must be used together."
} elseif { $from_key != "none" && $to_key != "none" } {
# Inter-clock uncertainty.
check_argc_eq1 "-from/-to" $args
# -from/-to can be lists.
set from_clks [get_clocks_warn "from_clocks" $keys($from_key)]
set to_clks [get_clocks_warn "to_clocks" $keys($to_key)]
foreach from_clk $from_clks {
foreach to_clk $to_clks {
set_inter_clock_uncertainty $from_clk $from_rf \
$to_clk $to_rf $min_max $uncertainty
}
}
} else {
# Single clock uncertainty.
check_argc_eq2 "set_clock_uncertainty" $args
if { [info exists flags(-rise)] \
|| [info exists flags(-fall)] } {
sta_error 422 "-rise, -fall options not allowed for single clock uncertainty."
}
set objects [lindex $args 1]
parse_clk_port_pin_arg $objects clks pins
foreach clk $clks {
set_clock_uncertainty_clk $clk $min_max $uncertainty
}
foreach pin $pins {
set_clock_uncertainty_pin $pin $min_max $uncertainty
}
}
}
################################################################
define_cmd_args "unset_clock_uncertainty" \
{[-from|-rise_from|-fall_from from_clock]\
[-to|-rise_to|-fall_to to_clock] [-rise] [-fall]\
[-setup] [-hold] [objects]}
proc unset_clock_uncertainty { args } {
unset_clk_uncertainty_cmd "unset_clock_uncertainty" $args
}
proc unset_clk_uncertainty_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to} \
flags {-rise -fall -setup -hold}
set min_max "min_max"
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set min_max "max"
}
if { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set min_max "min"
}
if { [info exists keys(-from)] } {
set from_key "-from"
set from_rf "rise_fall"
} elseif { [info exists keys(-rise_from)] } {
set from_key "-rise_from"
set from_rf "rise"
} elseif { [info exists keys(-fall_from)] } {
set from_key "-fall_from"
set from_rf "fall"
} else {
set from_key "none"
}
if { [info exists keys(-to)] } {
set to_key "-to"
set to_rf "rise_fall"
} elseif { [info exists keys(-rise_to)] } {
set to_key "-rise_to"
set to_rf "rise"
} elseif { [info exists keys(-fall_to)] } {
set to_key "-fall_to"
set to_rf "fall"
} else {
set to_key "none"
}
if { $from_key != "none" && $to_key == "none" \
|| $from_key == "none" && $to_key != "none" } {
sta_error 423 "-from/-to must be used together."
} elseif { $from_key != "none" && $to_key != "none" } {
# Inter-clock uncertainty.
check_argc_eq0 "unset_clock_uncertainty" $cmd_args
# -from/-to can be lists.
set from_clks [get_clocks_warn "from_clocks" $keys($from_key)]
set to_clks [get_clocks_warn "to_clocks" $keys($to_key)]
foreach from_clk $from_clks {
foreach to_clk $to_clks {
unset_inter_clock_uncertainty $from_clk $from_rf \
$to_clk $to_rf $min_max
}
}
} else {
# Single clock uncertainty.
check_argc_eq1 $cmd $cmd_args
if { [info exists keys(-rise)] \
|| [info exists keys(-fall)] } {
sta_error 424 "-rise, -fall options not allowed for single clock uncertainty."
}
set objects [lindex $cmd_args 0]
parse_clk_port_pin_arg $objects clks pins
foreach clk $clks {
unset_clock_uncertainty_clk $clk $min_max
}
foreach pin $pins {
unset_clock_uncertainty_pin $pin $min_max
}
}
}
################################################################
define_cmd_args "set_data_check" \
{[-from from_pin] [-rise_from from_pin] [-fall_from from_pin]\
[-to to_pin] [-rise_to to_pin] [-fall_to to_pin]\
[-setup | -hold] [-clock clock] margin}
proc set_data_check { args } {
parse_key_args "set_data_check" args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -clock} \
flags {-setup -hold}
check_argc_eq1 "set_data_check" $args
set margin [time_ui_sta $args]
set from_rf "rise_fall"
set to_rf "rise_fall"
set clk "NULL"
if [info exists keys(-from)] {
set from [get_port_pin_error "from_pin" $keys(-from)]
} elseif [info exists keys(-rise_from)] {
set from [get_port_pin_error "from_pin" $keys(-rise_from)]
set from_rf "rise"
} elseif [info exists keys(-fall_from)] {
set from [get_port_pin_error "from_pin" $keys(-fall_from)]
set from_rf "fall"
} else {
sta_error 425 "missing -from, -rise_from or -fall_from argument."
}
if [info exists keys(-to)] {
set to [get_port_pin_error "to_pin" $keys(-to)]
} elseif [info exists keys(-rise_to)] {
set to [get_port_pin_error "to_pin" $keys(-rise_to)]
set to_rf "rise"
} elseif [info exists keys(-fall_to)] {
set to [get_port_pin_error "to_pin" $keys(-fall_to)]
set to_rf "fall"
} else {
sta_error 426 "missing -to, -rise_to or -fall_to argument."
}
if [info exists keys(-clock)] {
set clk [get_clock_warn "clock" $keys(-clock)]
}
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set setup_hold "setup"
} elseif { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set setup_hold "hold"
} else {
set setup_hold "setup_hold"
}
set_data_check_cmd $from $from_rf $to $to_rf $clk $setup_hold $margin
}
################################################################
define_cmd_args "unset_data_check" \
{[-from from_pin] [-rise_from from_pin] [-fall_from from_pin]\
[-to to_pin] [-rise_to to_pin] [-fall_to to_pin]\
[-setup | -hold] [-clock clock]}
proc unset_data_check { args } {
unset_data_checks_cmd "unset_data_check" $args
}
proc unset_data_checks_cmd { cmd cmd_args } {
parse_key_args cmd cmd_args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -clock} \
flags {-setup -hold}
check_argc_eq0 $cmd $cmd_args
set from_rf "rise_fall"
set to_rf "rise_fall"
set clk "NULL"
set setup_hold "max"
if [info exists keys(-from)] {
set from [get_port_pin_error "from_pin" $keys(-from)]
} elseif [info exists keys(-rise_from)] {
set from [get_port_pin_error "from_pin" $keys(-rise_from)]
set from_rf "rise"
} elseif [info exists keys(-fall_from)] {
set from [get_port_pin_error "from_pin" $keys(-fall_from)]
set from_rf "fall"
} else {
sta_error 427 "missing -from, -rise_from or -fall_from argument."
}
if [info exists keys(-to)] {
set to [get_port_pin_error "to_pin" $keys(-to)]
} elseif [info exists keys(-rise_to)] {
set to [get_port_pin_error "to_pin" $keys(-rise_to)]
set to_rf "rise"
} elseif [info exists keys(-fall_to)] {
set to [get_port_pin_error "to_pin" $keys(-fall_to)]
set to_rf "fall"
} else {
sta_error 428 "missing -to, -rise_to or -fall_to argument."
}
if [info exists keys(-clock)] {
set clk [get_clock_warn "clock" $keys(-clock)]
}
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set setup_hold "setup"
} elseif { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set setup_hold "hold"
} else {
set setup_hold "setup_hold"
}
unset_data_check_cmd $from $from_rf $to $to_rf $clk $setup_hold
}
################################################################
define_cmd_args "set_disable_timing" \
{[-from from_port] [-to to_port] objects}
# Parallax supports -from or -to alone.
# OT requires both -from and -to args.
proc set_disable_timing { args } {
parse_key_args "set_disable_timing" args keys {-from -to} flags {}
check_argc_eq1 "set_disable_timing" $args
set from {}
if { [info exists keys(-from)] } {
set from $keys(-from)
}
set to {}
if { [info exists keys(-to)] } {
set to $keys(-to)
}
parse_libcell_libport_inst_port_pin_edge_timing_arc_set_arg $args \
libcells libports insts ports pins edges timing_arc_sets
if { ([info exists keys(-from)] || [info exists keys(-to)]) \
&& ($libports != {} || $pins != {} || $ports != {}) } {
sta_warn 429 "-from/-to keywords ignored for lib_pin, port and pin arguments."
}
foreach libcell $libcells {
set_disable_timing_cell $libcell $from $to
}
foreach libport $libports {
disable_lib_port $libport
}
foreach inst $insts {
set_disable_timing_instance $inst $from $to
}
foreach pin $pins {
disable_pin $pin
}
foreach port $ports {
disable_port $port
}
foreach edge $edges {
disable_edge $edge
}
foreach timing_arc_set $timing_arc_sets {
disable_timing_arc_set $timing_arc_set
}
}
proc set_disable_timing_instance { inst from to } {
set from_ports [parse_disable_inst_ports $inst $from]
set to_ports [parse_disable_inst_ports $inst $to]
if { ![$inst is_leaf] } {
sta_error 430 "-from/-to hierarchical instance not supported."
}
if { $from_ports == "NULL" && $to_ports == "NULL" } {
disable_instance $inst "NULL" "NULL"
} elseif { $from_ports == "NULL" } {
foreach to_port $to_ports {
disable_instance $inst "NULL" $to_port
}
} elseif { $to_ports == "NULL" } {
foreach from_port $from_ports {
disable_instance $inst $from_port "NULL"
}
} else {
foreach from_port $from_ports {
foreach to_port $to_ports {
disable_instance $inst $from_port $to_port
}
}
}
}
# Find ports in inst's cell that have pins.
# Bus ports are expanded into a list.
proc parse_disable_inst_ports { inst port_name } {
global hierarchy_separator
if { $port_name == "" } {
set ports "NULL"
} else {
set cell [instance_property $inst cell]
set port [$cell find_port $port_name]
if { $port == "NULL" } {
sta_error 431 "pin '[get_full_name $inst]${hierarchy_separator}${port_name}' not found."
} else {
set lib_port [get_property $port liberty_port]
set ports [port_members $lib_port]
}
}
return $ports
}
proc port_members { port } {
if [$port is_bus] {
# Expand bus ports.
set ports {}
set member_iter [$port member_iterator]
while {[$member_iter has_next]} {
set bit_port [$member_iter next]
lappend ports $bit_port
}
$member_iter finish
return $ports
} else {
return $port
}
}
proc set_disable_timing_cell { cell from to } {
set from_ports [parse_disable_cell_ports $cell $from]
set to_ports [parse_disable_cell_ports $cell $to]
if { $from_ports == "NULL" && $to_ports == "NULL" } {
disable_cell $cell "NULL" "NULL"
} elseif { $from_ports == "NULL" } {
foreach to_port $to_ports {
disable_cell $cell "NULL" $to_port
}
} elseif { $to_ports == "NULL" } {
foreach from_port $from_ports {
disable_cell $cell $from_port "NULL"
}
} else {
foreach from_port $from_ports {
foreach to_port $to_ports {
disable_cell $cell $from_port $to_port
}
}
}
}
# Find cell ports.
# Bus ports are expanded into a list.
proc parse_disable_cell_ports { cell port_name } {
global hierarchy_separator
if { $port_name == "" } {
set ports "NULL"
} else {
set port [$cell find_liberty_port $port_name]
if { $port == "NULL" } {
sta_error 432 "pin '[get_name $cell]${hierarchy_separator}${port_name}' not found."
} else {
set ports [port_members $port]
}
}
return $ports
}
################################################################
define_cmd_args "unset_disable_timing" \
{[-from from_port] [-to to_port] objects}
proc unset_disable_timing { args } {
unset_disable_cmd "unset_disable_timing" $args
}
proc unset_disable_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args keys {-from -to} flags {}
check_argc_eq1 $cmd $cmd_args
set from ""
if { [info exists keys(-from)] } {
set from $keys(-from)
}
set to ""
if { [info exists keys(-to)] } {
set to $keys(-to)
}
parse_libcell_libport_inst_port_pin_edge_timing_arc_set_arg $cmd_args \
libcells libports insts ports pins edges timing_arc_sets
if { ([info exists keys(-from)] || [info exists keys(-to)]) \
&& ($libports != {} || $pins != {} || $ports != {}) } {
sta_warn 434 "-from/-to keywords ignored for lib_pin, port and pin arguments."
}
foreach libcell $libcells {
unset_disable_timing_cell $libcell $from $to
}
foreach libport $libports {
unset_disable_lib_port $libport
}
foreach inst $insts {
unset_disable_timing_instance $inst $from $to
}
foreach pin $pins {
unset_disable_pin $pin
}
foreach port $ports {
unset_disable_port $port
}
foreach edge $edges {
unset_disable_edge $edge
}
foreach timing_arc_set $timing_arc_sets {
unset_disable_timing_arc_set $timing_arc_set
}
}
proc unset_disable_timing_cell { cell from to } {
set from_ports [parse_disable_cell_ports $cell $from]
set to_ports [parse_disable_cell_ports $cell $to]
if { $from_ports == "NULL" && $to_ports == "NULL" } {
unset_disable_cell $cell "NULL" "NULL"
} elseif { $from_ports == "NULL" } {
foreach to_port $to_ports {
unset_disable_cell $cell "NULL" $to_port
}
} elseif { $to_ports == "NULL" } {
foreach from_port $from_ports {
unset_disable_cell $cell $from_port "NULL"
}
} else {
foreach from_port $from_ports {
foreach to_port $to_ports {
unset_disable_cell $cell $from_port $to_port
}
}
}
}
proc unset_disable_timing_instance { inst from to } {
set from_ports [parse_disable_inst_ports $inst $from]
set to_ports [parse_disable_inst_ports $inst $to]
if { ![$inst is_leaf] } {
sta_error 435 "-from/-to hierarchical instance not supported."
}
if { $from_ports == "NULL" && $to_ports == "NULL" } {
unset_disable_instance $inst "NULL" "NULL"
} elseif { $from_ports == "NULL" } {
foreach to_port $to_ports {
unset_disable_instance $inst "NULL" $to_port
}
} elseif { $to_ports == "NULL" } {
foreach from_port $from_ports {
unset_disable_instance $inst $from_port "NULL"
}
} else {
foreach from_port $from_ports {
foreach to_port $to_ports {
unset_disable_instance $inst $from_port $to_port
}
}
}
}
################################################################
define_cmd_args "set_false_path" \
{[-setup] [-hold] [-rise] [-fall] [-reset_path] [-comment comment]\
[-from from_list] [-rise_from from_list] [-fall_from from_list]\
[-through through_list] [-rise_through through_list]\
[-fall_through through_list] [-to to_list] [-rise_to to_list]\
[-fall_to to_list]}
proc set_false_path { args } {
parse_key_args "set_false_path" args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -comment} \
flags {-setup -hold -rise -fall -reset_path} 0
set min_max "min_max"
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set min_max "max"
}
if { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set min_max "min"
}
set cmd "set_false_path"
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg args arg_error]
set to [parse_to_arg keys flags arg_error]
check_exception_pins $from $to
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
} else {
check_for_key_args $cmd args
if { $args != {} } {
sta_warn 436 "'$args' ignored."
}
if { ($from == "NULL" && $thrus == "" && $to == "NULL") } {
delete_from_thrus_to $from $thrus $to
sta_warn 437 "-from, -through or -to required."
} else {
if [info exists flags(-reset_path)] {
reset_path_cmd $from $thrus $to $min_max
}
set comment [parse_comment_key keys]
make_false_path $from $thrus $to $min_max $comment
}
}
}
################################################################
define_cmd_args "set_ideal_latency" \
{[-rise] [-fall] [-min] [-max] delay objects}
proc set_ideal_latency { args } {
# ignored
}
################################################################
# Specifies net has zero weight for placement.
define_cmd_args "set_ideal_net" { nets }
################################################################
define_cmd_args "set_ideal_network" {[-no_propagation] objects}
proc set_ideal_network { args } {
# ignored
}
################################################################
define_cmd_args "set_ideal_transition" \
{[-rise] [-fall] [-min] [-max] transition_time objects}
proc set_ideal_transition { args } {
# ignored
}
################################################################
define_cmd_args "set_input_delay" \
{[-rise] [-fall] [-max] [-min]\
[-clock clock] [-clock_fall]\
[-reference_pin ref_pin]\
[-source_latency_included] [-network_latency_included]\
[-add_delay] delay port_pin_list}
proc set_input_delay { args } {
set_port_delay "set_input_delay" "set_input_delay_cmd" $args \
{"input" "bidirect"}
}
proc set_port_delay { cmd sta_cmd cmd_args port_dirs } {
parse_key_args $cmd cmd_args \
keys {-clock -reference_pin} \
flags {-rise -fall -max -min -clock_fall -add_delay \
-source_latency_included -network_latency_included}
check_argc_eq2 $cmd $cmd_args
set delay_arg [lindex $cmd_args 0]
check_float "delay" $delay_arg
set delay [time_ui_sta $delay_arg]
set pins [get_port_pins_error "pins" [lindex $cmd_args 1]]
set clk "NULL"
if [info exists keys(-clock)] {
set clk [get_clock_warn "clock" $keys(-clock)]
}
set ref_pin "NULL"
if [info exists keys(-reference_pin)] {
set ref_pin [get_port_pin_error "ref_pin" $keys(-reference_pin)]
if { [info exists flags(-source_latency_included)] } {
sta_warn 438 "-source_latency_included ignored with -reference_pin."
}
if { [info exists flags(-network_latency_included)] } {
sta_warn 439 "-network_latency_included ignored with -reference_pin."
}
}
if [info exists flags(-clock_fall)] {
set clk_rf "fall"
} else {
set clk_rf "rise"
}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
set add [info exists flags(-add_delay)]
set source_latency_included [info exists flags(-source_latency_included)]
set network_latency_included [info exists flags(-network_latency_included)]
foreach pin $pins {
if { [$pin is_top_level_port] \
&& [lsearch $port_dirs [pin_direction $pin]] == -1 } {
sta_warn 440 "$cmd not allowed on [pin_direction $pin] port '[get_full_name $pin]'."
} elseif { $clk != "NULL" && [lsearch [$clk sources] $pin] != -1 } {
sta_warn 441 "$cmd relative to a clock defined on the same port/pin not allowed."
} else {
$sta_cmd $pin $rf $clk $clk_rf $ref_pin\
$source_latency_included $network_latency_included \
$min_max $add $delay
}
}
}
################################################################
define_cmd_args "unset_input_delay" \
{[-rise] [-fall] [-max] [-min]\
[-clock clock] [-clock_fall]\
port_pin_list}
proc unset_input_delay { args } {
unset_port_delay "unset_input_delay" "unset_input_delay_cmd" $args
}
################################################################
define_cmd_args "set_max_delay" \
{[-rise] [-fall] [-ignore_clock_latency] [-reset_path]\
[-probe] [-comment comment]\
[-from from_list] [-rise_from from_list] [-fall_from from_list]\
[-through through_list] [-rise_through through_list]\
[-fall_through through_list]\
[-to to_list] [-rise_to to_list] [-fall_to to_list] delay}
proc set_max_delay { args } {
set_path_delay "set_max_delay" $args max
}
proc set_path_delay { cmd args min_max } {
parse_key_args $cmd args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -comment} \
flags {-rise -fall -ignore_clock_latency -reset_path -probe} 0
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg args arg_error]
set to [parse_to_arg keys flags arg_error]
check_exception_pins $from $to
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
} else {
check_for_key_args $cmd args
if { [llength $args] == 0 } {
delete_from_thrus_to $from $thrus $to
sta_error 442 "missing delay argument."
} elseif { [llength $args] == 1 } {
set delay $args
check_float "$cmd delay" $delay
set delay [time_ui_sta $delay]
} else {
sta_warn 443 "'$args' ignored."
}
set ignore_clk_latency [info exists flags(-ignore_clock_latency)]
set break_path [expr {![info exists flags(-probe)]}]
if [info exists flags(-reset_path)] {
reset_path_cmd $from $thrus $to "all"
}
set comment [parse_comment_key keys]
make_path_delay $from $thrus $to $min_max \
$ignore_clk_latency $break_path $delay $comment
}
}
################################################################
define_cmd_args "set_max_time_borrow" {limit objects}
proc set_max_time_borrow { limit objects } {
check_positive_float "borrow_limit" $limit
set limit [time_ui_sta $limit]
parse_clk_inst_pin_arg $objects clks insts pins
foreach pin $pins {
set_latch_borrow_limit_pin $pin $limit
}
foreach inst $insts {
set_latch_borrow_limit_inst $inst $limit
}
foreach clk $clks {
set_latch_borrow_limit_clk $clk $limit
}
}
################################################################
define_cmd_args "set_min_delay" \
{[-rise] [-fall] [-ignore_clock_latency] [-reset_path]\
[-probe] [-comment comment]\
[-from from_list] [-rise_from from_list] [-fall_from from_list]\
[-through through_list] [-rise_through through_list]\
[-fall_through through_list]\
[-to to_list] [-rise_to to_list] [-fall_to to_list] delay}
proc set_min_delay { args } {
set_path_delay "set_min_delay" $args min
}
################################################################
define_cmd_args "set_path_margin" \
{[-setup] [-hold] [-rise] [-fall] [-comment comment]\
[-from from_list] [-rise_from from_list] [-fall_from from_list]\
[-through|-thr|-th through_list] [-rise_through|-rise_thr|-rise_th through_list]\
[-fall_through|-fall_thr|-fall_th through_list]\
[-to to_list] [-rise_to to_list] [-fall_to to_list] margin}
proc set_path_margin { args } {
parse_key_args "set_path_margin" args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -comment} \
flags {-rise -fall -setup -hold} 0
# Applies to setup, hold, or both.
set min_max "min_max"
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set min_max "max"
} elseif { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set min_max "min"
}
# Validate arguments.
set cmd "set_path_margin"
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg args arg_error]
set to [parse_to_arg keys flags arg_error]
check_exception_pins $from $to
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
return
}
# Validate margin value count and argument type.
check_for_key_args $cmd args
if { [llength $args] == 0 } {
delete_from_thrus_to $from $thrus $to
sta_error 1800 "missing margin argument."
} elseif { [llength $args] > 1 } {
sta_warn 1801 "'$args' ignored."
}
if { $from == "NULL" && $thrus == "" && $to == "NULL" } {
delete_from_thrus_to $from $thrus $to
sta_error 1802 "-from, -through or -to required."
}
# Parse margin value.
set margin [lindex $args 0]
check_float "set_path_margin margin" $margin
set margin [time_ui_sta $margin]
set comment [parse_comment_key keys]
make_path_margin $from $thrus $to $min_max $margin $comment
}
################################################################
define_cmd_args "set_min_pulse_width" {[-low] [-high] value [objects]}
proc set_min_pulse_width { args } {
parse_key_args "set_min_pulse_width" args keys {} flags {-low -high}
check_argc_eq1or2 "set_min_pulse_width" $args
if { [info exists flags(-low)] } {
set hi_low "fall"
} elseif { [info exists flags(-high)] } {
set hi_low "rise"
} else {
set hi_low "rise_fall"
}
set min_width [lindex $args 0]
check_positive_float "min pulse width" $min_width
set min_width [time_ui_sta $min_width]
if { [llength $args] == 2 } {
set objects [lindex $args 1]
parse_clk_inst_pin_arg $objects clks insts pins
foreach pin $pins {
set_min_pulse_width_pin $pin $hi_low $min_width
}
foreach inst $insts {
set_min_pulse_width_inst $inst $hi_low $min_width
}
foreach clk $clks {
set_min_pulse_width_clk $clk $hi_low $min_width
}
} else {
set_min_pulse_width_global $hi_low $min_width
}
}
################################################################
define_cmd_args "set_multicycle_path" \
{[-setup] [-hold] [-rise] [-fall] [-start] [-end]\
[-reset_path] [-comment comment]\
[-from from_list] [-rise_from from_list]\
[-fall_from from_list] [-through through_list]\
[-rise_through through_list] [-fall_through through_list]\
[-to to_list] [-rise_to to_list] [-fall_to to_list] path_multiplier}
proc set_multicycle_path { args } {
parse_key_args "set_multicycle_path" args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to -comment} \
flags {-setup -hold -rise -fall -start -end -reset_path} 0
set min_max "min_max"
set use_end_clk 1
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
# -setup
set min_max "max"
set use_end_clk 1
}
if { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
# -hold
set min_max "min"
set use_end_clk 0
}
set cmd "set_multicycle_path"
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg args arg_error]
set to [parse_to_arg keys flags arg_error]
check_exception_pins $from $to
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
} else {
check_for_key_args $cmd args
if { [llength $args] == 0 } {
delete_from_thrus_to $from $thrus $to
sta_error 444 "missing path multiplier argument."
} elseif { [llength $args] == 1 } {
set path_multiplier $args
check_integer "path multiplier" $path_multiplier
} else {
sta_warn 445 "'$args' ignored."
}
set start [info exists flags(-start)]
set end [info exists flags(-end)]
if { $start && $end } {
delete_from_thrus_to $from $thrus $to
sta_error 446 "cannot use -start with -end."
} elseif { $start } {
set use_end_clk 0
} elseif { $end } {
set use_end_clk 1
}
if [info exists flags(-reset_path)] {
reset_path_cmd $from $thrus $to $min_max
}
set comment [parse_comment_key keys]
make_multicycle_path $from $thrus $to $min_max $use_end_clk \
$path_multiplier $comment
}
}
################################################################
define_cmd_args "unset_path_exceptions" \
{[-setup] [-hold] [-rise] [-fall] [-from from_list]\
[-rise_from from_list] [-fall_from from_list]\
[-through through_list] [-rise_through through_list]\
[-fall_through through_list] [-to to_list] [-rise_to to_list]\
[-fall_to to_list]}
proc unset_path_exceptions { args } {
unset_path_exceptions_cmd "unset_path_exceptions" $args
}
proc unset_path_exceptions_cmd { cmd cmd_args } {
parse_key_args $cmd cmd_args \
keys {-from -rise_from -fall_from -to -rise_to -fall_to} \
flags {-setup -hold -rise -fall} 0
set min_max "min_max"
if { [info exists flags(-setup)] && ![info exists flags(-hold)] } {
set min_max "max"
}
if { [info exists flags(-hold)] && ![info exists flags(-setup)] } {
set min_max "min"
}
set arg_error 0
set from [parse_from_arg keys arg_error]
set thrus [parse_thrus_arg cmd_args arg_error]
set to [parse_to_arg keys flags arg_error]
if { $arg_error } {
delete_from_thrus_to $from $thrus $to
sta_error 447 "$cmd command failed."
return 0
}
check_for_key_args $cmd cmd_args
if { $cmd_args != {} } {
delete_from_thrus_to $from $thrus $to
sta_error 448 "positional arguments not supported."
}
if { ($from == "NULL" && $thrus == "" && $to == "NULL") } {
delete_from_thrus_to $from $thrus $to
sta_error 449 "-from, -through or -to required."
}
reset_path_cmd $from $thrus $to $min_max
delete_from_thrus_to $from $thrus $to
}
################################################################
define_cmd_args "set_output_delay" \
{[-rise] [-fall] [-max] [-min]\
[-clock clock] [-clock_fall]\
[-reference_pin ref_pin]\
[-source_latency_included] [-network_latency_included]\
[-add_delay] delay port_pin_list}
proc set_output_delay { args } {
set_port_delay "set_output_delay" "set_output_delay_cmd" $args \
{"output" "tristate" "bidirect"}
}
################################################################
define_cmd_args "unset_output_delay" \
{[-rise] [-fall] [-max] [-min]\
[-clock clock] [-clock_fall]\
port_pin_list}
proc unset_output_delay { args } {
unset_port_delay "unset_output_delay" "unset_output_delay_cmd" $args
}
proc unset_port_delay { cmd swig_cmd cmd_args } {
parse_key_args $cmd cmd_args \
keys {-clock -reference_pin} \
flags {-rise -fall -max -min -clock_fall }
check_argc_eq1 $cmd $cmd_args
set pins [get_port_pins_error "pins" [lindex $cmd_args 0]]
set clk "NULL"
if [info exists keys(-clock)] {
set clk [get_clock_warn "clock" $keys(-clock)]
}
if [info exists flags(-clock_fall)] {
set clk_rf "fall"
} else {
set clk_rf "rise"
}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
foreach pin $pins {
$swig_cmd $pin $rf $clk $clk_rf $min_max
}
}
################################################################
define_cmd_args "set_propagated_clock" {objects}
proc set_propagated_clock { objects } {
parse_clk_port_pin_arg $objects clks pins
foreach clk $clks {
if { [$clk is_virtual] } {
sta_warn 450 "virtual clock [get_name $clk] can not be propagated."
} else {
set_propagated_clock_cmd $clk
}
}
foreach pin $pins {
set_propagated_clock_pin_cmd $pin
}
}
################################################################
define_cmd_args "unset_propagated_clock" {objects}
proc unset_propagated_clock { objects } {
parse_clk_port_pin_arg $objects clks pins
foreach clk $clks {
unset_propagated_clock_cmd $clk
}
foreach pin $pins {
unset_propagated_clock_pin_cmd $pin
}
}
################################################################
#
# Environment Commands
#
################################################################
define_cmd_args "set_case_analysis" \
{0|1|zero|one|rise|rising|fall|falling pins}
proc set_case_analysis { value pins } {
if { !($value == "0" \
|| $value == "1" \
|| $value == "zero" \
|| $value == "one" \
|| $value == "rise" \
|| $value == "rising" \
|| $value == "fall" \
|| $value == "falling") } {
sta_error 451 "value must be 0, zero, 1, one, rise, rising, fall, or falling."
}
set pins1 [get_port_pins_error "pins" $pins]
foreach pin $pins1 {
set_case_analysis_cmd $pin $value
}
}
################################################################
define_cmd_args "unset_case_analysis" {pins}
proc unset_case_analysis { pins } {
set pins1 [get_port_pins_error "pins" $pins]
foreach pin $pins1 {
unset_case_analysis_cmd $pin
}
}
################################################################
define_cmd_args "set_drive" {[-rise] [-fall] [-min] [-max] \
resistance ports}
proc set_drive { args } {
parse_key_args "set_drive" args keys {} flags {-rise -fall -min -max}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_check_flags flags]
check_argc_eq2 "set_drive" $args
set res [lindex $args 0]
check_positive_float "resistance" $res
set res [resistance_ui_sta $res]
set ports [get_ports_error "ports" [lindex $args 1]]
foreach port $ports {
set_drive_resistance_cmd $port $rf $min_max $res
}
}
################################################################
define_cmd_args "set_driving_cell" \
{[-lib_cell cell] [-library library]\
[-rise] [-fall] [-min] [-max]\
[-pin pin] [-from_pin from_pin]\
[-input_transition_rise trans_rise] [-input_transition_fall trans_fall]\
[-multiply_by factor] [-dont_scale] [-no_design_rule] ports}
proc set_driving_cell { args } {
parse_key_args "set_driving_cell" args \
keys {-lib_cell -cell -library -pin -from_pin -multiply_by \
-input_transition_rise -input_transition_fall} \
flags {-rise -fall -min -max -dont_scale -no_design_rule}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
# -cell is an undocumented non-sdc alias for -lib_cell.
if { [info exists keys(-cell)] } {
set keys(-lib_cell) $keys(-cell)
}
if { [info exists keys(-lib_cell)] } {
set cell_name $keys(-lib_cell)
if { [info exists keys(-library)] } {
set library [get_liberty_error "library" $keys(-library)]
set cell [$library find_liberty_cell $cell_name]
if { $cell == "NULL" } {
sta_error 452 "cell '$lib_name:$cell_name' not found."
}
} else {
set library "NULL"
if { [is_object $cell_name] } {
if { [object_type $cell_name] != "LibertyCell" } {
sta_error 334 "object '$cell_name' is not a liberty cell."
}
set cell $cell_name
} else {
set cell [find_liberty_cell $cell_name]
}
if { $cell == "NULL" } {
sta_error 453 "'$cell_name' not found."
}
}
} else {
sta_error 454 "missing -lib_cell argument."
}
set to_port "NULL"
if [info exists keys(-pin)] {
set to_port_name $keys(-pin)
set to_port [$cell find_liberty_port $to_port_name]
if { $to_port == "NULL" } {
sta_error 455 "port '$to_port_name' not found."
}
} else {
set port_iter [$cell liberty_port_iterator]
set output_count 0
while {[$port_iter has_next]} {
set port [$port_iter next]
set dir [liberty_port_direction $port]
if { [port_direction_any_output $dir] } {
incr output_count
if { $output_count > 1 } {
$port_iter finish
sta_error 456 "-pin argument required for cells with multiple outputs."
}
set to_port $port
# No break. Keep looking for output ports to make sure there
# is only one.
}
}
$port_iter finish
}
set from_port "NULL"
if [info exists keys(-from_pin)] {
set from_port_name $keys(-from_pin)
set from_port [$cell find_liberty_port $from_port_name]
if { $from_port == "NULL" } {
sta_error 457 "port '$from_port_name' not found."
}
}
set from_slew_rise 0
if [info exists keys(-input_transition_rise)] {
set from_slew_rise $keys(-input_transition_rise)
check_positive_float "-input_transition_rise" $from_slew_rise
set from_slew_rise [time_ui_sta $from_slew_rise]
}
set from_slew_fall 0
if [info exists keys(-input_transition_fall)] {
set from_slew_fall $keys(-input_transition_fall)
check_positive_float "-input_transition_fall" $from_slew_fall
set from_slew_fall [time_ui_sta $from_slew_fall]
}
if [info exists keys(-multiply_by)] {
sta_warn 458 "-multiply_by ignored."
}
if [info exists flags(-dont_scale)] {
sta_warn 459 "-dont_scale ignored."
}
if [info exists flags(-no_design_rule)] {
sta_warn 460 "-no_design_rule ignored."
}
check_argc_eq1 "set_driving_cell" $args
set ports [get_ports_error "ports" [lindex $args 0]]
foreach port $ports {
set_drive_cell_cmd $library $cell $port $from_port \
$from_slew_rise $from_slew_fall $to_port $rf $min_max
}
}
proc port_direction_any_output { dir } {
return [expr { $dir == "output" \
|| $dir == "bidirect" \
|| $dir == "tristate" } ]
}
################################################################
define_cmd_args "set_fanout_load" {fanout ports}
proc set_fanout_load { fanout port_list } {
sta_warn 461 "set_fanout_load not supported."
}
################################################################
define_cmd_args "set_input_transition" \
{[-rise] [-fall] [-min] [-max] transition ports}
proc set_input_transition { args } {
parse_key_args "set_input_transition" args keys {-clock} \
flags {-rise -fall -max -min -clock_fall}
set rf [parse_rise_fall_flags flags]
set min_max [parse_min_max_all_flags flags]
check_argc_eq2 "set_input_transition" $args
set slew [lindex $args 0]
check_positive_float "transition" $slew
set slew [time_ui_sta $slew]
set ports [get_ports_error "ports" [lindex $args 1]]
if [info exists keys(-clock)] {
sta_warn 462 "-clock not supported."
}
if [info exists flags(-clock_fall)] {
sta_warn 463 "-clock_fall not supported."
}
foreach port $ports {
set_input_slew_cmd $port $rf $min_max $slew
}
}
################################################################
# set_load -wire_load port external wire load
# set_load -pin_load port external pin load
# set_load port same as -pin_load
# set_load net overrides parasitics
define_cmd_args "set_load" \
{[-rise] [-fall] [-max] [-min] [-subtract_pin_load]\
[-pin_load] [-wire_load] capacitance objects}
proc set_load { args } {
parse_key_args "set_load" args keys {} \
flags {-rise -fall -min -max -subtract_pin_load -pin_load -wire_load}\
check_argc_eq2 "set_load" $args
set pin_load [info exists flags(-pin_load)]
set wire_load [info exists flags(-wire_load)]
set subtract_pin_load [info exists flags(-subtract_pin_load)]
set min_max [parse_min_max_all_check_flags flags]
set rf [parse_rise_fall_flags flags]
set cap [lindex $args 0]
check_positive_float "capacitance" $cap
set cap [capacitance_ui_sta $cap]
parse_port_net_args [lindex $args 1] ports nets
if { $ports != {} } {
if { $subtract_pin_load } {
sta_warn 486 "-subtract_pin_load not allowed for port objects."
}
# -pin_load is the default.
if { $pin_load || (!$pin_load && !$wire_load) } {
foreach port $ports {
set_port_ext_pin_cap $port $rf $min_max $cap
}
} elseif { $wire_load } {
foreach port $ports {
set_port_ext_wire_cap $port $rf $min_max $cap
}
}
}
if { $nets != {} } {
if { $pin_load } {
sta_warn 464 "-pin_load not allowed for net objects."
}
if { $wire_load } {
sta_warn 465 "-wire_load not allowed for net objects."
}
if { $rf != "rise_fall" } {
sta_warn 466 "-rise/-fall not allowed for net objects."
}
foreach net $nets {
set_net_wire_cap $net $subtract_pin_load $min_max $cap
}
}
}
################################################################
define_cmd_args "set_logic_dc" {port_list}
proc set_logic_dc { port_list } {
set_logic_value $port_list "X"
}
# OT supports set_logic cmds on pins.
# OC only supports them on ports.
proc set_logic_value { port_list value } {
set pins [get_port_pins_error "pins" $port_list]
foreach pin $pins {
set_logic_value_cmd $pin $value
}
}
################################################################
define_cmd_args "set_logic_one" {port_list}
proc set_logic_one { port_list } {
set_logic_value $port_list "1"
}
################################################################
define_cmd_args "set_logic_zero" {port_list}
proc set_logic_zero { port_list } {
set_logic_value $port_list "0"
}
################################################################
define_cmd_args "set_max_area" {area}
proc set_max_area { area } {
check_positive_float "area" $area
set_max_area_cmd $area
}
################################################################
define_cmd_args "set_max_capacitance" {cap objects}
proc set_max_capacitance { cap objects } {
set_capacitance_limit $cap "max" $objects
}
proc set_capacitance_limit { cap min_max objects } {
parse_cell_port_pin_args $objects cells ports pins
check_positive_float "limit" $cap
set cap [capacitance_ui_sta $cap]
foreach cell $cells {
set_cell_capacitance_limit $cell $min_max $cap
}
foreach port $ports {
set_port_capacitance_limit $port $min_max $cap
}
foreach pin $pins {
set_pin_capacitance_limit $pin $min_max $cap
}
}
################################################################
define_cmd_args "set_max_fanout" {fanout objects}
proc set_max_fanout { fanout objects } {
set_fanout_limit $fanout "max" $objects
}
proc set_fanout_limit { fanout min_max objects } {
check_positive_float "limit" $fanout
parse_cell_port_args $objects cells ports
foreach port $ports {
set dir [port_direction $port]
if { !($dir == "input" || $dir == "bidirect") } {
sta_error 467 "port '[get_name $port]' is not an input."
}
set_port_fanout_limit $port $min_max $fanout
}
foreach cell $cells {
set_cell_fanout_limit $cell $min_max $fanout
}
}
################################################################
define_cmd_args "set_max_transition" \
{[-clock_path] [-data_path] [-rise] [-fall] slew objects}
proc set_max_transition { args } {
parse_key_args "set_max_transition" args keys {} \
flags {-clock_path -data_path -rise -fall}
check_argc_eq2 "set_max_transition" $args
set slew [lindex $args 0]
check_positive_float "transition" $slew
set slew [time_ui_sta $slew]
set objects [lindex $args 1]
parse_clk_cell_port_args $objects clks cells ports
set rf [parse_rise_fall_flags flags]
set path_types {}
if { ![info exists flags(-clock_path)] \
&& ![info exists flags(-data_path)] } {
# Derate clk and data if neither -clock_path or -data_path.
set path_types {"clk" "data"}
}
if { [info exists flags(-clock_path)] } {
lappend path_types "clk"
}
if { [info exists flags(-data_path)] } {
lappend path_types "data"
}
if { ($ports != {} || $cells != {}) \
&& ([info exists flags(-clock_path)] \
|| [info exists flags(-data_path)]
|| [info exists flags(-rise)]
|| [info exists flags(-fall)]) } {
sta_warn 468 "-data_path, -clock_path, -rise, -fall ignored for ports and designs."
}
# -clock_path/-data_path and transition only apply to clock objects.
foreach path_type $path_types {
foreach clk $clks {
set_slew_limit_clk $clk $rf $path_type "max" $slew
}
}
foreach cell $cells {
set_slew_limit_cell $cell "max" $slew
}
foreach port $ports {
set_slew_limit_port $port "max" $slew
}
}
################################################################
define_cmd_args "set_port_fanout_number" \
{[-max] [-min] fanout ports}
proc set_port_fanout_number { args } {
parse_key_args "set_port_fanout_number" args keys {} flags {-max -min}
set min_max [parse_min_max_all_check_flags flags]
check_argc_eq2 "set_port_fanout_number" $args
set fanout [lindex $args 0]
check_positive_integer "fanout" $fanout
set ports [get_ports_error "ports" [lindex $args 1]]
foreach port $ports {
set_port_ext_fanout_cmd $port $fanout $min_max
}
}
################################################################
define_cmd_args "set_resistance" {[-min] [-max] resistance nets}
proc set_resistance { args } {
parse_key_args "set_resistance" args keys {} flags {-max -min}
set min_max [parse_min_max_all_check_flags flags]
check_argc_eq2 "set_resistance" $args
set res [lindex $args 0]
check_positive_float "resistance" $res
set res [resistance_ui_sta $res]
set nets [get_nets_arg "nets" [lindex $args 1]]
foreach net $nets {
set_net_resistance $net $min_max $res
}
}
################################################################
define_cmd_args "set_timing_derate" \
{-early|-late [-rise] [-fall] [-clock] [-data] \
[-net_delay] [-cell_delay] [-cell_check] derate [objects]}
proc set_timing_derate { args } {
parse_key_args "set_timing_derate" args keys {} \
flags {-rise -fall -early -late -clock -data \
-net_delay -cell_delay -cell_check}
check_argc_eq1or2 "set_timing_derate" $args
set derate [lindex $args 0]
check_float "derate" $derate
if { $derate > 2.0 } {
sta_warn 469 "derating factor greater than 2.0."
}
set rf [parse_rise_fall_flags flags]
set early_late [parse_early_late_flags flags]
set path_types {}
if { ![info exists flags(-clock)] \
&& ![info exists flags(-data)] } {
# Derate clk and data if neither -clock or -data.
lappend path_types "clk"
lappend path_types "data"
}
if { [info exists flags(-clock)] } {
lappend path_types "clk"
}
if { [info exists flags(-data)] } {
lappend path_types "data"
}
set derate_types {}
if { [info exists flags(-net_delay)] } {
lappend derate_types "net_delay"
}
if { [info exists flags(-cell_delay)] } {
lappend derate_types "cell_delay"
}
if { [info exists flags(-cell_check)] } {
lappend derate_types "cell_check"
}
if { [llength $args] == 2 } {
set objects [lindex $args 1]
parse_libcell_inst_net_arg $objects libcells insts nets
if { $nets != {} } {
if { [info exists flags(-cell_delay)] \
|| [info exists flags(-cell_check)] } {
sta_warn 470 "-cell_delay and -cell_check flags ignored for net objects."
}
foreach net $nets {
foreach path_type $path_types {
set_timing_derate_net_cmd $net $path_type $rf $early_late $derate
}
}
}
if { ![info exists flags(-cell_delay)] \
&& ![info exists flags(-cell_check)] } {
# Cell checks are not derated if no flags are specified.
set derate_types {cell_delay}
}
foreach derate_type $derate_types {
foreach path_type $path_types {
foreach inst $insts {
set_timing_derate_inst_cmd $inst $derate_type $path_type \
$rf $early_late $derate
}
foreach libcell $libcells {
set_timing_derate_cell_cmd $libcell $derate_type $path_type \
$rf $early_late $derate
}
}
}
} else {
if { ![info exists flags(-net_delay)] \
&& ![info exists flags(-cell_delay)] \
&& ![info exists flags(-cell_check)] } {
# Cell checks are not derated if no flags are specified.
set derate_types {net_delay cell_delay}
}
foreach derate_type $derate_types {
foreach path_type $path_types {
set_timing_derate_cmd $derate_type $path_type $rf $early_late $derate
}
}
}
}
################################################################
define_cmd_args "unset_timing_derate" {}
proc unset_timing_derate { args } {
check_argc_eq0 "unset_timing_derate" $args
unset_timing_derate_cmd
}
################################################################
proc parse_from_arg { keys_var arg_error_var } {
upvar 1 $keys_var keys
if [info exists keys(-from)] {
set key "-from"
set rf "rise_fall"
} elseif [info exists keys(-rise_from)] {
set key "-rise_from"
set rf "rise"
} elseif [info exists keys(-fall_from)] {
set key "-fall_from"
set rf "fall"
} else {
return "NULL"
}
parse_clk_inst_port_pin_arg $keys($key) from_clks from_insts from_pins
if {$from_pins == {} && $from_insts == {} && $from_clks == {}} {
upvar 1 $arg_error_var arg_error
set arg_error 1
sta_warn 471 "no valid objects specified for $key."
return "NULL"
}
return [make_exception_from $from_pins $from_clks $from_insts $rf]
}
# "arg_error" is set to notify the caller to cleanup and post error.
proc parse_thrus_arg { args_var arg_error_var } {
upvar 1 $args_var args
set thrus {}
set args_rtn {}
while { $args != {} } {
set arg [lindex $args 0]
set rf ""
if { $arg == "-through" } {
set rf "rise_fall"
set key "-through"
} elseif { $arg == "-rise_through" } {
set rf "rise"
set key "-rise_through"
} elseif { $arg == "-fall_through" } {
set rf "fall"
set key "-fall_through"
}
if { $rf != "" } {
if { [llength $args] > 1 } {
set args [lrange $args 1 end]
set arg [lindex $args 0]
parse_inst_port_pin_net_arg $arg insts pins nets
if {$pins == {} && $insts == {} && $nets == {}} {
upvar 1 $arg_error_var arg_error
set arg_error 1
sta_warn 472 "no valid objects specified for $key"
} else {
lappend thrus [make_exception_thru $pins $nets $insts $rf]
}
}
} else {
lappend args_rtn $arg
}
set args [lrange $args 1 end]
}
set args $args_rtn
return $thrus
}
# Parse -to|-rise_to|-fall_to keywords.
proc parse_to_arg { keys_var flags_var arg_error_var } {
upvar 1 $keys_var keys
upvar 1 $flags_var flags
upvar 1 $arg_error_var arg_error
set end_rf [parse_rise_fall_flags flags]
return [parse_to_arg1 keys $end_rf arg_error]
}
proc parse_to_arg1 { keys_var end_rf arg_error_var } {
upvar 1 $keys_var keys
upvar 1 $arg_error_var arg_error
if [info exists keys(-to)] {
set key "-to"
set to_rf "rise_fall"
} elseif [info exists keys(-rise_to)] {
set key "-rise_to"
set to_rf "rise"
} elseif [info exists keys(-fall_to)] {
set key "-fall_to"
set to_rf "fall"
} else {
# -rise/-fall without -to/-rise_to/-fall_to (no objects).
if { $end_rf != "rise_fall" } {
return [make_exception_to {} {} {} "rise_fall" $end_rf]
} else {
return "NULL"
}
}
parse_clk_inst_port_pin_arg $keys($key) to_clks to_insts to_pins
if {$to_pins == {} && $to_insts == {} && $to_clks == {}} {
upvar 1 $arg_error_var arg_error
set arg_error 1
sta_warn 473 "no valid objects specified for $key."
return "NULL"
}
return [make_exception_to $to_pins $to_clks $to_insts $to_rf $end_rf]
}
proc delete_from_thrus_to { from thrus to } {
if { $from != "NULL" } {
delete_exception_from $from
}
if { $thrus != {} } {
foreach thru $thrus {
delete_exception_thru $thru
}
}
if { $to != "NULL" } {
delete_exception_to $to
}
}
proc parse_comment_key { keys_var } {
upvar 1 $keys_var keys
set comment ""
if { [info exists keys(-comment)] } {
set comment $keys(-comment)
}
return $comment
}
################################################################
define_cmd_args "set_min_capacitance" {cap objects}
proc set_min_capacitance { cap objects } {
set_capacitance_limit $cap "min" $objects
}
################################################################
define_cmd_args "set_operating_conditions" \
{[-analysis_type single|bc_wc|on_chip_variation] [-library lib]\
[condition] [-min min_condition] [-max max_condition]\
[-min_library min_lib] [-max_library max_lib]}
proc set_operating_conditions { args } {
parse_key_args "set_operating_conditions" args \
keys {-analysis_type -library -min -max -min_library -max_library} flags {}
parse_op_cond_analysis_type keys
check_argc_eq0or1 set_operating_conditions $args
if { [llength $args] == 1 } {
set op_cond_name $args
parse_op_cond $op_cond_name "-library" "all" keys
}
if [info exists keys(-min)] {
parse_op_cond $keys(-min) "-min_library" "min" keys
}
if [info exists keys(-max)] {
parse_op_cond $keys(-max) "-max_library" "max" keys
}
}
proc parse_op_cond { op_cond_name lib_key min_max key_var } {
upvar 1 $key_var keys
if [info exists keys($lib_key)] {
set liberty [get_liberty_error $lib_key $keys($lib_key)]
set op_cond [$liberty find_operating_conditions $op_cond_name]
if { $op_cond == "NULL" } {
sta_error 474 "operating condition '$op_cond_name' not found."
} else {
set_operating_conditions_cmd $op_cond $min_max
}
} else {
set found 0
set lib_iter [liberty_library_iterator]
while {[$lib_iter has_next]} {
set lib [$lib_iter next]
set op_cond [$lib find_operating_conditions $op_cond_name]
if { $op_cond != "NULL" } {
set_operating_conditions_cmd $op_cond $min_max
set found 1
break
}
}
$lib_iter finish
if { !$found } {
sta_error 475 "operating condition '$op_cond_name' not found."
}
}
}
proc parse_op_cond_analysis_type { key_var } {
upvar 1 $key_var keys
if [info exists keys(-analysis_type)] {
set analysis_type $keys(-analysis_type)
if { $analysis_type == "single" \
|| $analysis_type == "bc_wc" \
|| $analysis_type == "on_chip_variation" } {
set_analysis_type_cmd $analysis_type
} else {
sta_error 476 "-analysis_type must be single, bc_wc or on_chip_variation."
}
} elseif { [info exists keys(-min)] && [info exists keys(-max)] } {
set_analysis_type_cmd "bc_wc"
}
}
################################################################
define_cmd_args "set_wire_load_min_block_size" {block_size}
proc set_wire_load_min_block_size { block_size } {
sta_warn 477 "set_wire_load_min_block_size not supported."
}
################################################################
define_cmd_args "set_wire_load_mode" "top|enclosed|segmented"
proc set_wire_load_mode { mode } {
if { $mode == "top" \
|| $mode == "enclosed" \
|| $mode == "segmented" } {
set_wire_load_mode_cmd $mode
} else {
sta_error 478 "mode must be top, enclosed or segmented."
}
}
################################################################
define_cmd_args "set_wire_load_model" \
{-name model_name [-library lib_name] [-min] [-max] [objects]}
proc set_wire_load_model { args } {
parse_key_args "set_wire_load_model" args keys {-name -library} \
flags {-min -max}
check_argc_eq0or1 "set_wire_load_model" $args
if { ![info exists keys(-name)] } {
sta_error 479 "no wire load model specified."
}
set model_name $keys(-name)
set min_max [parse_min_max_all_check_flags flags]
set wireload "NULL"
if [info exists keys(-library)] {
set library [get_liberty_error "library" $keys(-library)]
set wireload [$library find_wireload $model_name]
} else {
set lib_iter [liberty_library_iterator]
while {[$lib_iter has_next]} {
set lib [$lib_iter next]
set wireload [$lib find_wireload $model_name]
if {$wireload != "NULL"} {
break;
}
}
$lib_iter finish
}
if {$wireload == "NULL"} {
sta_error 480 "wire load model '$model_name' not found."
}
set objects $args
set_wire_load_cmd $wireload $min_max
}
################################################################
define_cmd_args "set_wire_load_selection_group" \
{[-library lib] [-min] [-max] group_name [objects]}
proc set_wire_load_selection_group { args } {
parse_key_args "set_wire_load_selection_group" args keys {-library} \
flags {-min -max}
set argc [llength $args]
check_argc_eq1or2 "wire_load_selection_group" $args
set selection_name [lindex $args 0]
set objects [lindex $args 1]
set min_max [parse_min_max_all_check_flags flags]
set selection "NULL"
if [info exists keys(-library)] {
set library [get_liberty_error "library" $keys(-library)]
set selection [$library find_wireload_selection $selection_name]
} else {
set lib_iter [liberty_library_iterator]
while {[$lib_iter has_next]} {
set lib [$lib_iter next]
set selection [$lib find_wireload_selection $selection_name]
if {$selection != "NULL"} {
break;
}
}
$lib_iter finish
}
if {$selection == "NULL"} {
sta_error 481 "wire load selection group '$selection_name' not found."
}
set_wire_load_selection_group_cmd $selection $min_max
}
################################################################
#
# Multivoltage and Power Optimization Commands
#
################################################################
define_cmd_args "set_voltage" \
{[-min min_case_value] [-object_list power_nets] max_case_voltage}
proc set_voltage { args } {
parse_key_args "set_voltage" args keys {-min -object_list} flags {}
check_argc_eq1 "set_voltage" $args
set max_case_voltage [lindex $args 0]
check_float "max_case_voltage" $max_case_voltage
set nets {}
if { [info exists keys(-object_list)] } {
set nets [get_nets_arg "-object_list" $keys(-object_list)]
}
set_voltage_global "max" $max_case_voltage
foreach net $nets {
set_voltage_net $net "max" $max_case_voltage
}
if { [info exists keys(-min)] } {
set min_case_voltage $keys(-min)
check_float "-min" $min_case_voltage
set_voltage_global "min" $min_case_voltage
foreach net $nets {
set_voltage_net $net "min" $min_case_voltage
}
}
}
define_cmd_args "create_voltage_area" \
{[-name name] [-coordinate coordinates] [-guard_band_x guard_x]\
[-guard_band_y guard_y] cells }
proc create_voltage_area { args } {
# ignored
}
################################################################
define_cmd_args "set_level_shifter_strategy" {[-rule rule_type]}
proc set_level_shifter_strategy { args } {
# ignored
}
################################################################
define_cmd_args "set_level_shifter_threshold" {[-voltage volt]}
proc set_level_shifter_threshold { args } {
# ignored
}
################################################################
define_cmd_args "set_max_dynamic_power" {power [unit]}
proc set_max_dynamic_power { power {unit {}} } {
check_positive_float "power" $power
# Optional SDC unit argument is accepted but ignored; use set_units.
set_max_dynamic_power_cmd $power
}
################################################################
define_cmd_args "set_max_leakage_power" {power [unit]}
proc set_max_leakage_power { power {unit {}} } {
check_positive_float "power" $power
# Optional SDC unit argument is accepted but ignored; use set_units.
set_max_leakage_power_cmd $power
}
################################################################
#
# Non-SDC commands
#
################################################################
define_cmd_args "set_pvt"\
{insts [-min] [-max] [-process process] [-voltage voltage]\
[-temperature temperature]}
proc set_pvt { args } {
parse_key_args "set_pvt" args \
keys {-process -voltage -temperature} flags {-min -max}
set min_max [parse_min_max_all_flags flags]
check_argc_eq1 "set_pvt" $args
set insts [get_instances_error "instances" [lindex $args 0]]
if { $min_max == "min_max" } {
set_pvt_min_max $insts "min" keys
set_pvt_min_max $insts "max" keys
} else {
set_pvt_min_max $insts $min_max keys
}
}
proc set_pvt_min_max { insts min_max keys_var } {
upvar 1 $keys_var keys
set op_cond [operating_conditions $min_max]
if { $op_cond == "NULL" } {
set op_cond [default_operating_conditions]
}
if [info exists keys(-process)] {
set process $keys(-process)
check_float "-process" $process
} else {
set process [$op_cond process]
}
if [info exists keys(-voltage)] {
set voltage $keys(-voltage)
check_float "-voltage" $voltage
} else {
set voltage [$op_cond voltage]
}
if [info exists keys(-temperature)] {
set temperature $keys(-temperature)
check_float "-temperature" $temperature
} else {
set temperature [$op_cond temperature]
}
foreach inst $insts {
set_instance_pvt $inst $min_max $process $voltage $temperature
}
}
proc default_operating_conditions {} {
set found 0
set lib_iter [liberty_library_iterator]
while {[$lib_iter has_next]} {
set lib [$lib_iter next]
set op_cond [$lib default_operating_conditions]
if { $op_cond != "NULL" } {
set found 1
break
}
}
$lib_iter finish
if { !$found } {
sta_error 500 "no default operating conditions found."
}
return $op_cond
}
################################################################
proc cell_regexp {} {
global hierarchy_separator
return [cell_regexp_hsc $hierarchy_separator]
}
proc cell_regexp_hsc { hsc } {
return "^(\[^${hsc}\]+)${hsc}(\[^${hsc}\]+)$"
}
proc port_regexp {} {
global hierarchy_separator
return [port_regexp_hsc $hierarchy_separator]
}
proc port_regexp_hsc { hsc } {
return "^(\[^${hsc}\]+)${hsc}(\[^${hsc}\]+)${hsc}(\[^${hsc}\]+)$"
}
# sta namespace end.
}
|