5.2. Hammer APIs

Hammer has a growing collection of APIs that use objects defined by the technology plugin, such as stackups and special cells. They expose useful extracted information from Hammer IR to other methods, such as in tool plugins that will implement this information in a tool-compatible manner.

For syntax details about the Hammer IR needed to use these APIs, refer to the defaults.yml.

5.2.1. Power Specification

Simple power specs are specified using the Hammer IR key vlsi.inputs.supplies, which is then translated into a a Supply object. hammer_vlsi_impl exposes the Supply objects to other APIs (e.g. power straps) and can generate the CPF/UPF files depending on which specification the tools support. Multi-mode multi-corner (MMMC) setups are also available by setting vlsi.inputs.mmmc_corners and manual power spec definitions are supported by setting the relevant vlsi.inputs.power_spec... keys.

5.2.2. Timing Constraints

Clock and pin timing constraints are specified using the Hammer IR keys vlsi.inputs.clocks/output_loads/delays. These objects can be turned into SDC-style constraints by hammer_vlsi_impl for consumption by supported tools.

5.2.3. Floorplan & Placement

Placement constraints are specified using the Hammer IR key vlsi.inputs.placement_constraints. These constraints are very flexible and have varying inputs based on the type of object the constraint applies to, such as hierarchical modules, hard macros, or obstructions. At minimum, an (x, y) coordinate corresponding to the lower left corner must be given, and additional parameters such as width/height, margins, layers, or orientation are needed depending on the type of constraint. Place-and-route tool plugins will take this information and emit the appropriate commands during floorplanning. Additional work is planned to ensure that floorplans are always legal (i.e. on grid, non-overlapping, etc.).

All Hammer tool instances have access to a method that can produce graphical visualization of the floorplan as an SVG file, viewable in a web browser. To use it, call the generate_visualization() method from any custom hook (see Extending Hammer with Hooks). The options for the visualization tool are in the Hammer IR key vlsi.inputs.visualization.

5.2.4. Bumps

Bump constraints are specified using the Hammer IR key vlsi.inputs.bumps. Rectangular-gridded bumps are supported, although bumps at fractional coordinates in the grid and deleted bumps are allowed. The place-and-route tool plugin translates the list of bump assignments into the appropriate commands to place them in the floorplan and enable flip-chip routing. The bumps API is also used by the PCB plugin to emit the collateral needed by PCB layout tools such as Altium Designer. This API ensures that the bumps are always in correspondence between the chip and PCB.

The visualization tool mentioned above can also display bump placement and assignments. There are options to view the bumps from the perspective of the ASIC designer or the PCB designer. The views are distinguishable by a reference dot displayed in the left and right corners for the ASIC and PCB perspectives, respectively.

5.2.5. Pins

Pin constraints are specified using the Hammer IR key vlsi.inputs.pin. PinAssignments objects are generated and passed to the place-and-route tool to place pins along specified block edges on specified metal layers. Preplaced (e.g. hard macros in hierarchical blocks) pins are also supported so that they are not routed. Additional work is planned to use this API in conjunction with the placement constraints API to allow for abutment of hierarchical blocks, which requires pins to be aligned on abutting edges.

5.2.6. Power Straps

Power strap constraints are specified using multiple Hammer IR keys in the par namespace.You can find the keys in <tech>/defaults.yml under the tech plugin directory. An example from asap7 is as follows:

ASAP7 default power straps setting
 1par.power_straps_mode: generate # Power straps (most DRC-clean)
 2par.generate_power_straps_method: by_tracks
 3par.generate_power_straps_options:
 4  by_tracks:
 5    strap_layers:
 6      - M3
 7      - M4
 8      - M5
 9      - M6
10      - M7
11      - M8
12      - M9
13    pin_layers:
14      - M9
15    track_width: 7 # minimum allowed for M2 & M3
16    track_spacing: 0
17    track_spacing_M3: 28 # space straps apart evenly, in conjunction w/ track_utilization_M3
18    track_start: 10
19    power_utilization: 0.25
20    power_utilization_M3: 0.6 # together with track_spacing_M3 results in approx. 0.25 eff. utilization
21    power_utilization_M8: 1.0
22    power_utilization_M9: 1.0

The default keys for all hammer configs are defined in the defaults.yml, which contains detailed comments on what each key does. Here is the default setting and parameter descriptions for power strap generation.

Hammer global default power straps setting
 1  power_to_route_blockage_ratio: 1.1 # By default, set the power halo + blockage spacing to 1.1x in every dimension relative to route blockage.
 2
 3  blockage_spacing_top_layer: null # Top metal layer that is pulled back around blocks and hardmacros
 4  # Used by floorplanning.
 5  # Overridden by individual placement constraints on top_layer.
 6  # type: Optional[str]
 7
 8  generate_power_straps_method: "by_tracks" # If power_straps_mode is 'generate', which method to use.
 9  # Currently, the valid options are:
10  # - by_tracks - Specify the power strap plan per layer in terms of tracks
11
12  generate_power_straps_options:
13  # Default settings for power strap generation modes
14  # Keys are the valid values of the 'generate_power_straps_method' key above
15    by_tracks:
16      blockage_spacing: "par.blockage_spacing" # Spacing from end of strap to a block or blockage
17      # Overrideable by appending _<layer name>
18      # type: Decimal
19      blockage_spacing_meta: lazycrossref
20
21      track_width: 5 # Number of routing tracks to be consumed by an individual strap
22      # Overrideable by appending _<layer name>
23      # type: int
24
25      track_start: 0 # The first track to contain a power stripe
26      # Overrideable by appending _<layer name>
27      # type: int
28      # TODO(johnwright): include an auto-center option
29
30      track_offset: 0.0 # Absolute offset for straps relative to the design bounding box origin
31      # Overrideable by appending _<layer name>
32      # type: Decimal
33
34      track_spacing: 0 # Number of routing tracks between sets of straps (0 is recommended)
35      # Overrideable by appending _<layer name>
36      # type: int
37
38      power_utilization: 0.1 # Ratio of total routing tracks to dedicate to power straps, which is used to calculate set pitch
39      # Overrideable by appending _<layer name>

The currently supported API supports power strap generation by tracks, which auto-calculates power strap width, spacing, set-to-set distance, and offsets based on basic DRC rules specified in the technology Stackup object.

The technology Stackup information (“stackups”) can be found in the <tech>.tech.json file under the tech plugin directory. The “stackups” usually are located near the end of the <tech> .tech.json file. An example from asap7 is as follows:

ASAP7 stackup object
 1    {
 2      "name": "asap7_3Ma_2Mb_2Mc_2Md",
 3      "grid_unit": 0.001,
 4      "metals": [
 5        {"name": "M1", "index": 1, "direction": "horizontal", "min_width": 0.072, "pitch": 0.144, "offset": 0.0, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.072}], "power_strap_width_table": [], "grid_unit": 0.001},
 6        {"name": "M2", "index": 2, "direction": "horizontal", "min_width": 0.072, "pitch": 0.144, "offset": -1.08, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.072}], "power_strap_width_table": [0.072, 0.36, 0.648, 0.936, 1.224, 1.512], "grid_unit": 0.001},
 7        {"name": "M3", "index": 3, "direction": "vertical", "min_width": 0.072, "pitch": 0.144, "offset": 0.0, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.072}], "power_strap_width_table": [0.072, 0.36, 0.648, 0.936, 1.224, 1.512], "grid_unit": 0.001},
 8        {"name": "M4", "index": 4, "direction": "horizontal", "min_width": 0.096, "pitch": 0.192, "offset": 0.048, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.096}, {"width_at_least": 0.1, "min_spacing": 0.288}], "power_strap_width_table": [0.096, 0.48, 0.864, 1.248, 1.632], "grid_unit": 0.001},
 9        {"name": "M5", "index": 5, "direction": "vertical", "min_width": 0.096, "pitch": 0.192, "offset": 0.048, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.096}, {"width_at_least": 0.1, "min_spacing": 0.288}], "power_strap_width_table": [0.096, 0.48, 0.864, 1.248, 1.632, 2.016, 2.4, 2.784, 3.168, 3.552, 3.936], "grid_unit": 0.001},
10        {"name": "M6", "index": 6, "direction": "horizontal", "min_width": 0.128, "pitch": 0.256, "offset": 0.064, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.128}, {"width_at_least": 0.1, "min_spacing": 0.288}], "power_strap_width_table": [0.128, 0.64, 1.152, 1.664, 2.176], "grid_unit": 0.001},
11        {"name": "M7", "index": 7, "direction": "vertical", "min_width": 0.128, "pitch": 0.256, "offset": 0.064, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.128}, {"width_at_least": 0.1, "min_spacing": 0.288}], "power_strap_width_table": [0.128, 0.64, 1.152, 1.664, 2.176], "grid_unit": 0.001},
12        {"name": "M8", "index": 8, "direction": "horizontal", "min_width": 0.16, "pitch": 0.32, "offset": 0.16, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.16}, {"width_at_least": 0.239, "min_spacing": 0.24}, {"width_at_least": 0.319, "min_spacing": 0.32}, {"width_at_least": 0.479, "min_spacing": 0.48}, {"width_at_least": 1.999, "min_spacing": 2.0}, {"width_at_least": 3.999, "min_spacing": 4.0}], "power_strap_width_table": [], "grid_unit": 0.001},
13        {"name": "M9", "index": 9, "direction": "vertical", "min_width": 0.16, "pitch": 0.32, "offset": 0.16, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 0.16}, {"width_at_least": 0.239, "min_spacing": 0.24}, {"width_at_least": 0.319, "min_spacing": 0.32}, {"width_at_least": 0.479, "min_spacing": 0.48}, {"width_at_least": 1.999, "min_spacing": 2.0}, {"width_at_least": 3.999, "min_spacing": 4.0}], "power_strap_width_table": [], "grid_unit": 0.001},
14        {"name": "Pad", "index": 10, "direction": "redistribution", "min_width": 0.16, "pitch": 8.16, "offset": 0.0, "power_strap_widths_and_spacings": [{"width_at_least": 0.0, "min_spacing": 8.0}, {"width_at_least": 47.999, "min_spacing": 12.0}], "power_strap_width_table": [], "grid_unit": 0.001}
15      ]
16    }
17  ],
18  "sites": [

The keys in the Stackup object are defined in stackup.py as follows.

Description for a metal layer/stackup
 1    name: Metal layer name (e.g. M1, M2).
 2    index: The order in the stackup (lower is closer to the substrate).
 3    direction: The preferred routing direction of this metal layer, or
 4               RoutingDirection.Redistribution for non-routing top-level
 5               redistribution metals like Aluminium.
 6    min_width: The minimum wire width for this layer.
 7    max_width: The maximum wire width for this layer.
 8    pitch: The minimum cross-mask pitch for this layer (NOT same-mask pitch
 9           for multiple-patterned layers). Width of routing grid for a given layer.
10           To route denser wires on chip, multiple masks are required.
11           During fabrication, the masks are applied separately with some spatial offsets
12           to achieve denser line patterning. For more information on multiple-patterning,
13           check https://en.wikipedia.org/wiki/Multiple_patterning
14    offset: The routing track offset from the origin for the first track in this layer.
15            (0 = first track is on an axis).
16    power_strap_widths_and_spacings: A list of WidthSpacingTuples that specify the minimum
17                                     spacing rules for an infinitely long wire of variying width.
18    power_strap_width_table: A list of allowed metal widths in the technology.
19                             Widths smaller than the last number must be quantized to a value in the table.
20    grid_unit: The fixed-point decimal value of a minimum grid unit (e.g. 1nm = 0.001).

The basic pieces of information needed are the desired track utilization per strap and overall power strap density. Powerstraps are routed in pairs of Vdd and Vss. Based on the effective power utilization and track spacing, there are three ways to route powerstraps.

For track spacing = 0 and effective power utilization = 100%, powerstraps are routed as follows.

../_images/strap_100util.png

For track spacing = 0 and effective power utilization < 100%, powerstraps are routed as follows.

../_images/strap_0spacing_not100util.png

For track spacing > 0 and effective power utilization < 100%, powerstraps are routed as follows.

../_images/strap_not0spacing_not100util.png

The currently supported API supports power strap generation by tracks, which auto-calculates power strap width, spacing, set-to-set distance, and offsets based on basic DRC rules specified in the technology Stackup object. The basic pieces of information needed are the desired track utilization per strap and overall power strap density. Different values can be specified on a layer-by-layer basis by appending _<layer name> to the end of the desired option.

For mesh pattern, the following diagram shows how the sizings of a mesh-patterned strap is derived from user inputs.

../_images/mesh_no_space.png

Notice that for a mesh pattern, users do not need to specify the layer track spacing, since that should not matter for a regular mesh pattern.

5.2.7. Special Cells

Special cells are specified in the technology’s JSON, but are exposed to provide lists of cells needed for certain steps, such as for fill, well taps, and more. Synthesis and place-and-route tool plugins can grab the appropriate type of special cell for the relevant steps.

5.2.8. Submission

Each tool has run submission options given by the Hammer IR key <tool type>.submit. Using the command and settings keys, a setup for LSF or similar workload management platforms can be standardized.