attar 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. attar/__init__.py +11 -0
  2. attar/_slow_loop.py +58 -0
  3. attar/design.py +733 -0
  4. attar/evaluator.py +341 -0
  5. attar/facts.py +134 -0
  6. attar/hub.py +104 -0
  7. attar/io/__init__.py +1 -0
  8. attar/io/bookshelf.py +295 -0
  9. attar/io/deffile.py +498 -0
  10. attar/io/distill.py +316 -0
  11. attar/io/export.py +197 -0
  12. attar/io/fpformats.py +256 -0
  13. attar/io/lef.py +122 -0
  14. attar/io/liberty.py +350 -0
  15. attar/io/sdc.py +244 -0
  16. attar/io/st.py +41 -0
  17. attar/kernels.py +144 -0
  18. attar/metrics.py +101 -0
  19. attar/naive/__init__.py +19 -0
  20. attar/naive/bstar.py +183 -0
  21. attar/naive/floorplan.py +528 -0
  22. attar/naive/flow.py +75 -0
  23. attar/naive/gp.py +420 -0
  24. attar/naive/lg.py +812 -0
  25. attar/naive/macro_lp.py +222 -0
  26. attar/naive/rowops.py +100 -0
  27. attar/naive/space.py +182 -0
  28. attar/netlist.py +673 -0
  29. attar/paths.py +25 -0
  30. attar/rules/__init__.py +1 -0
  31. attar/rules/pdn.py +191 -0
  32. attar/rules/rails.py +159 -0
  33. attar/rules/routing.py +709 -0
  34. attar/status.py +183 -0
  35. attar/timing/__init__.py +1 -0
  36. attar/timing/csrc/pdtree.cpp +390 -0
  37. attar/timing/dmp.py +356 -0
  38. attar/timing/dmp_triton.py +623 -0
  39. attar/timing/ir.py +316 -0
  40. attar/timing/library.py +341 -0
  41. attar/timing/sizing.py +120 -0
  42. attar/timing/sta.py +1425 -0
  43. attar/timing/steiner.py +146 -0
  44. attar/timing/steiner_big.py +69 -0
  45. attar/timing/steiner_triton.py +350 -0
  46. attar/viz.py +492 -0
  47. attar-1.0.0.dist-info/LICENSE +21 -0
  48. attar-1.0.0.dist-info/METADATA +269 -0
  49. attar-1.0.0.dist-info/RECORD +51 -0
  50. attar-1.0.0.dist-info/WHEEL +5 -0
  51. attar-1.0.0.dist-info/top_level.txt +1 -0
attar/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ """Attar: a fast loop for physical design. Designs from any source become GPU tensors (Design), metrics evaluate
2
+ them (Evaluator), and a basic set of tensorized engines (attar.naive) makes them move. What a design can do follows
3
+ from the facts it has. See README.md."""
4
+ __version__ = '1.0.0'
5
+
6
+ from .design import Design, load, zoo
7
+ from .io.distill import distill
8
+ from .evaluator import Evaluator
9
+ from .hub import fetch
10
+
11
+ __all__ = ['Design', 'load', 'zoo', 'fetch', 'distill', 'Evaluator', '__version__']
attar/_slow_loop.py ADDED
@@ -0,0 +1,58 @@
1
+ """Internal: handing a design back to the slow loop it came from (ORFS), for Attar's own validation.
2
+
3
+ Not part of the user API. Users take the result out with Design.export (a DEF) into their own flow (OpenROAD,
4
+ Innovus, ICC2, ...). Attar keeps this only to check itself against ORFS: tools/orfs_roundtrip.py (a placement into an
5
+ ORFS run), tools/orfs_handoff.py (a floorplan into ORFS 2_1) and their tests use it.
6
+
7
+ The fact 'slow_loop' says that a design comes from an ORFS stage on a platform ORFS knows; an engine that changes the
8
+ floorplan after ORFS built tapcells and PDN around it drops the fact (Design._floorplan_changed).
9
+ """
10
+ import os
11
+
12
+ from .facts import MissingFacts
13
+
14
+ # what a hand-off needs, beyond what export needs
15
+ CAPABILITIES = {
16
+ 'orfs_handoff': {'cell_library', 'def_frame', 'slow_loop', 'floorplan.io', 'floorplan.macros', 'placement'},
17
+ 'orfs_floorplan_handoff': {'cell_library', 'def_frame', 'slow_loop', 'floorplan.io', 'floorplan.macros'}, # 2_1
18
+ }
19
+
20
+
21
+ def missing(d, capability='orfs_handoff'):
22
+ """The facts a hand-off still needs (sorted)."""
23
+ return sorted(CAPABILITIES[capability] - d.present)
24
+
25
+
26
+ def can(d, capability='orfs_handoff'):
27
+ return not missing(d, capability)
28
+
29
+
30
+ def tier(d):
31
+ """A: an ORFS hand-off is possible (given a placement); B: a cell library, so export onto a DEF; C: neither."""
32
+ if CAPABILITIES['orfs_handoff'] - {'placement'} <= set(d.facts):
33
+ return 'A'
34
+ return 'B' if 'cell_library' in d.facts else 'C'
35
+
36
+
37
+ def handoff_command(d, out_def, run_dir=None):
38
+ """The command that hands an exported DEF to an ORFS run of this design (run_dir: its WORK_HOME) and finishes the
39
+ flow there (spec 7.2). A floorplan (from ORFS 2_1) goes to ORFS only when it is legal (Design.floorplan_legal)."""
40
+ o = d.manifest.get('orfs')
41
+ fp = (o or {}).get('stage') == '2_1_floorplan'
42
+ cap = 'orfs_floorplan_handoff' if fp else 'orfs_handoff'
43
+ miss = missing(d, cap)
44
+ if miss:
45
+ raise MissingFacts(d.manifest.get('design', d.path), cap, miss)
46
+ if fp:
47
+ ok, issues = d.floorplan_legal()
48
+ if not ok:
49
+ raise ValueError('%s: the floorplan is not legal (%s); ORFS would not take it'
50
+ % (d.manifest.get('design'), '; '.join(issues)))
51
+ root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
52
+ key = o['design'] if o.get('platform', 'asap7') == 'asap7' else '%s/%s' % (o['platform'], o['design'])
53
+ run = run_dir or '<ORFS WORK_HOME of %s>' % key
54
+ if fp: # the floorplan goes to ORFS, which places and routes from there
55
+ return 'python3 %s %s %s %s' % (os.path.relpath(os.path.join(root, 'tools', 'orfs_handoff.py')), key, run,
56
+ out_def)
57
+ return 'python3 %s %s %s def=%s --stage %s' % (os.path.relpath(os.path.join(root, 'tools', 'orfs_roundtrip.py')),
58
+ key, run, out_def, o['stage'])