• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. help - skill code for goto xy coordinate

Stats

  • Locked Locked
  • Replies 23
  • Subscribers 146
  • Views 15829
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

help - skill code for goto xy coordinate

zeroskills
zeroskills over 15 years ago

i would like some help on skill code for goto xy coordinate. we used to have this skill code, it does this...

pop up goto xy form, just input x and y coordinate then view size, like how zoom in or out you want it. then there will be an "X" ruler mark on the coordinate.

 

  • Cancel
  • kbhow
    kbhow over 15 years ago

     Hi,

    I wrote a simple code for you. This will prompt user a form to key in x and y coordinate.User can input scale as well.For eg: 1.5 2.6 2 (1.5 is x coord; 2.6 is y coord; and 2 is the scale) , or they can just input x and y coordinate only, for eg: 2.5 9.0 

    In the other hand, it will use ruler to create a marker at the coordinate.

     

    procedure( ZoomToPoint( x y @key

                                               (scale 1)

                                               (winId hiGetCurrentWindow())

                                               (cvId geGetEditCellView()))

        let(( (dx 2) (dy 2))

     

           ;----------------------------

           ; Zoom to point with scale

            ;----------------------------

            hiZoomWindowAtPoint(winId scale x:y)

            printf("\nCmd: Zooming to Point %L %L with scale %L\n" x y scale)

     

            ;-------------------------------

            ; Create cross mark using ruler

            ;-------------------------------

            leCreateRuler( cvId list(x:y x+dx:y+dy))

            leCreateRuler( cvId list(x:y x+dx:y-dy))

            leCreateRuler( cvId list(x:y x-dx:y+dy))

            leCreateRuler( cvId list(x:y x-dx:y-dy))

     

        );let

    );proc

     

    procedure( zoomGUI()

        let(()

     

            ;----------------

            ; Create form

            ;----------------

             hiCreateAppForm(

                    ?name 'zoomGui

                    ?formTitle "Zoom and Mark"

                    ?callback "zoomGuiCB(zoomGui->column->value)"

                    ?fields list(

                              list( hiCreateStringField(

                                          ?name 'column

                                          ?prompt "Go to:"

                                           ) 5:5 200:25 50)

     

                               );

                     ?buttonLayout 'OKCancel

                     ?help ""

                   );

     

              hiDisplayForm(zoomGui)

        );let

    );proc

    procedure( zoomGuiCB(input)

        let((dX dY (zscale 1))

     

            value = parseString(input " ")

            ;-----------------------

            ; Process form' value

            ;-----------------------

            if( length(value) == 2 then

                  dX = atof(car(value))

                  dY = atof(cadr(value))

           else

                  if( length(value) == 3 then

                        dX = atof(car(value))

                        dY = atof(cadr(value))

                        zscale = atof(caddr(value))

                 else

                        warn("Zoom to Pt => Invalid input! Input must be x y scale")

                  );if

             );if

             ;--------------------------

             ; Calling function to zoom

             ;--------------------------

             ZoomToPoint(dX dY ?scale zscale)

        );let

    );proc

     

     

     

     

     

    How

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    You could also use leSetRefPoint() to set the reference point (and if you have set on Options->Display that the reference point is visible, you'll get a little cross shown at the point).

    BTW, one thing that many users are unaware of is that if you were to just use the standard "Pan" command (from the menu, say), you can type in the coordinates in the CIW:

    100:240

    (for example) and it will pan to that location. Any "enter function" - i.e. when you're prompted for points - can have the points typed in the CIW.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zeroskills
    zeroskills over 15 years ago

    Thanks for the code.

    I copied and saved your code to "gotoxy.il", but how to attach it with a bindkey?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago

    hiSetBindKey("Layout" "Ctrl<Key>p" "zoomGUI()")

    Or whatever key you want. Looking at the code, zoomGUI() is the main entry point. You'll need to have loaded the code (from your .cdsinit, say).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zeroskills
    zeroskills over 15 years ago

    Thanks kbhow and andrew. It's working now.

    One more request, could it have an input box for x coordiante, input box for x coordiante,  and input box for scale/zoom size?

    Thanks.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Riad KACED
    Riad KACED over 15 years ago

    Hi Guys,

    I'm jumping a bit late into the subject but wanted to share some code I have written based on what discussed here.

    The above code has the added value of self-calculating the 'right' zoom ratio before applying the pan function. This code calcules a zoom that would magnify the design into a window size les than 1um^2, assuming the initial design is more than 1um*1um.One can make this code zooming even more if needed, just by adding a multiplier as explained within the code.


    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointFormCB
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointFormCB(form)
      let((point xCoordinate yCoordinate)
        xCoordinate=car(parseString(form->xyCoordinates->value ","))
        yCoordinate=cadr(parseString(form->xyCoordinates->value ","))
        point=list(cdfParseFloatString(xCoordinate) cdfParseFloatString(yCoordinate))
        printf("The Selected Point is: %L\n" point)
        RKzoomToPointCB(point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCB.
    ; This is actually the main function, it does dynamically calculate the
    ; zoom ratio and then pan. It also put the ref point that is displayed
    ; if users setup their environment to do so.
    ;---------------------------------------------------------------------------
    procedure( RKzoomToPointCB(point)
      let((windowId viewBBox zoomVal)
        windowId=hiGetCurrentWindow()
        hiZoomAbsoluteScale(windowId 1)
        viewBBox=hiGetViewBBox(windowId)
        zoomVal=max(abs(yCoord(upperRight(viewBBox))-yCoord(lowerLeft(viewBBox)))
                    abs(xCoord(upperRight(viewBBox))-xCoord(lowerLeft(viewBBox))))
        ; One can make the zoom even higher, just by seeting
        ; something like
        ; zoomVal=10*zoomVal for example
        hiPan( hiGetCurrentWindow() point)
        hiZoomRelativeScale(windowId  zoomVal)
        ;unless(leEditorOptionsForm->options->displayRefPoint->value
        ;  leEditorOptionsForm->options->displayRefPoint->value=t
        ;)
        leSetRefPoint(windowId~>cellView point)
      )
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPoint, main entry.
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPoint()
      unless(boundp('RKzoomToPointForm)
        RKzoomToPointCreateForm()
      )
      hiDisplayForm(RKzoomToPointForm)
    )
    ;---------------------------------------------------------------------------
    ; procedure : RKzoomToPointCreateForm
    ;---------------------------------------------------------------------------
    procedure(RKzoomToPointCreateForm()
      let((xyCoordinates zoomLabel zoomButton)
       
        zoomLabel=hiCreateLabel(
          ?name 'zoomLabel
          ?labelText "enter ',' separated points: ex 0.0,0.0"
          ?justification `center
        )
      
        xyCoordinates=hiCreateStringField(
          ?name 'xyCoordinates
          ?prompt "X,Y Coordinates"
          ?value "0.0,0.0"
        )           
        zoomButton=hiCreateButton(
          ?name 'zoomButton
          ?buttonText "Zoom & Pan"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
        )
                   
       RKzoomToPointForm=hiCreateAppForm(
          ?name 'RKzoomToPointForm
          ?formTitle "RK Zoom To Point"
          ?callback strcat("(RKzoomToPointFormCB " 'RKzoomToPointForm " )")
          ?buttonLayout '(OKCancelDef)
          ?fields list(
            list(zoomLabel 5:5 250:30 100 )
            list(xyCoordinates 5:40 250:30 100 )
        list(zoomButton  30:75 200:30  )
          )
        )
      )
    )
    ;---------------------------------------------------------------------------
    ; Bindkey definition
    ;---------------------------------------------------------------------------
    hiSetBindKey("Layout" "Alt<Key>z" "RKzoomToPoint()")

     

     

    Cheers,

    Riad. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • zeroskills
    zeroskills over 15 years ago

    Thanks Riad for another code. but yours does not have the "X" mark ruler and it's too zoomed in.

    and could there  be a seperate input box for x and y coordinates?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 15 years ago
    Of course. From all this example code, it really should not be too hard for you to adapt it yourself to your own needs.

    You have some pretty good framework code here, which would only need small changes.

    I too have an example for doing this. But decided there were enough similar examples already. Can't remember whether mine has separate X and Y boxes, but anyway it doesn't draw rulers at the "buried treasure point" ;-) (I'm travelling so can't check easily)

    Regards,

    Andrew
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • dmay
    dmay over 15 years ago

    This is a forum for ideas and answers, not a development team for your CAD needs. As Andrew said, you should be able to get it working from the examples you have received so far.

    As for my two cents, I don't like having a separate field for X and Y. Most of the time, our users are cutting and pasting X and Y coordinates from a file. Our solution was to make the XY field on the form a string field. We pre-process the string and convert it into X and Y coordinates. In doing this, the pre-process code removes colons, quotes, commas, etc so the user can paste coordinate info in any format that he has and not have to separately cut and paste the X and the Y.

    The following procedure takes the string entered on the form (coord) and returns a point:

    procedure(coordCleanup( coord)
      rexCompile( "[(){}xy=,XY:]")
      coord = rexReplace( coord " " 0)
      ;Occasionally an extra decimal: (920.000000. -223.500000)
      rexCompile( "\\. ")
      coord = rexReplace( coord " " 0)
      coord = parseString(coord)
      mapcar( 'aelNumber coord)
    ) ;proc

    Now, the user can paste this in the box:
    x=10,y=20

    And this routine will return: list(10 20)

    Derek

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Riad KACED
    Riad KACED over 15 years ago
    Hi,

    >> Thanks Riad for another code. but yours does not have the "X" mark ruler

    If you were really listening to what other people said, then you would have realised that my routine has the ‘X’ as well.

    As per Andrew’s recommendation, I have added into the code the following:

    leSetRefPoint(windowId~>cellView point)

    But since we all have different tastes, I did not want to force the environment to display the reference point.

    Instead, you end user can go to the VLE->Options->Layout Editor->Display Ref Point

    Well, If you have carefully read through the code, you would have realized I have put the following in comment:

        ;unless(leEditorOptionsForm->options->displayRefPoint->value
        ;  leEditorOptionsForm->options->displayRefPoint->value=t
        ;)
    So to answer your question: the X is created, it’s down to you to display it !

    Marking with rules is just fiddling around, I don’t like fiddling.

    >> and it's too zoomed in.

    Again, it would have been better if you read my comments.

    My routine has got a dynamic zooming scale. Say you are working on a block level design whose size is 100u*100u. Say a zoom by 100 would be alright for you. But if you move to a chip level layout then a zoom by 100 might be not enough. My routine does all dynamically to fall into a window which is less than 1um square. I have setup this given the technology node I’m working with. This might be too much for some people and may be not enough for others. That’s why I have said in my commented code how to make flexible. Basically by adding a multiplier. You can make it >1 or <1, depends on you wanting more zoom out/in. Again, please read the comments.

    >> and could there  be a seperate input box for x and y coordinates?

    I do not like the separated coordinates, simply because you loose productivity. Again, when you get an error from Assura/Calibre (I think I have written this for Calibre corrdinates) saying something occurred at that point, then it easier for people just make a cp/paste as Derek advised.

    At the end, I do concur with Andrew’s and Derek’s; you better take this as an idea to start with rather than a tailored suit ready to wear!

    Scripting is all about practice and you need to put your hands on mate!

     
    Cheers,

    Riad.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
>

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information