magic icon indicating copy to clipboard operation
magic copied to clipboard

Measure command places ruler incorrectly for sky130

Open Sinbiosis opened this issue 3 years ago • 3 comments

Describe the bug:

After loading the sky130 .magicrc file with optional keybindings, making a selection on a certain rectangle, and pressing the 'k' key results in the ruler being placed far off from the box's location (see attached)

Expected: A ruler giving the length (or width) of the rectangle

To reproduce:

  1. Use the default magic rcfile given sky130A as generated by open_pdk git repo. (in ${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.magicrc)
  2. Select a rectangle in a layout magic_before_measure
  3. press little 'k'
  4. Try and locate the ruler magic_after_measure

Sinbiosis avatar Sep 10 '22 06:09 Sinbiosis

Same here, we just stumbled across the same issue. box produces correct results, but the ruler is off.

hpretl avatar Sep 19 '22 12:09 hpretl

Everything seems to be fine if snap internal is set instead of "user" or "lambda".

I suppose the reason is: measure uses command element, which has been changed to use cmdParseCoord. The coordinates are fetched with box value which returns internal values, and these values are then parsed to cmdParseCoord without suffix. cmdParseCoord assumes the given values are on the snap xxxx grid if there is no suffix, therefore internal values are scaled from snap-grid to internal-grid

w32agobot avatar Sep 26 '22 08:09 w32agobot

Is this an edge case that can be corrected for in magic's code or should I include a snap internal command from now on in my .magicrc file? Also, are there any down sides to setting snap internal?

Sinbiosis avatar Sep 26 '22 12:09 Sinbiosis