ucb-bar / hammer

Hammer: Highly Agile Masks Made Effortlessly from RTL
BSD 3-Clause "New" or "Revised" License
255 stars 59 forks source link

Accept int locations in pin constraints as API sugar #539

Open edwardcwang opened 5 years ago

edwardcwang commented 5 years ago

The following Hammer YAML is not accepted. May be nice to just convert it to float? Should keep decimal/float internally.

vlsi.inputs.pin.assignments:
  - pins: "clock"
    side: right
    layers: ["M2"]
    location: [1000, 500]
  File "/hammer/src/hammer-vlsi/hammer_vlsi/hammer_tool.py", line 957, in get_pin_assignments
    pin = PinAssignment.from_dict(raw_assign, semi_auto)
  File "/hammer/src/hammer-vlsi/hammer_vlsi/constraints.py", line 164, in from_dict
    assert isinstance(location_raw[0], float), "location must be a Optional[Tuple[float, float]]"
AssertionError: location must be a Optional[Tuple[float, float]]
jwright6323 commented 5 years ago

They should probably be Decimals instead of floats anyway. We may be able to re-use some of the stuff from the stackup code, or better yet, move everything to hammer units and have a single solution for everything.