• 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. How do I properly format a imported properties file into...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 13680
  • 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

How do I properly format a imported properties file into SKILL to create shapes

Julia
Julia over 10 years ago

I wrote a simple SKILL script which pulls the properties off a shape and prints into a text file.

LayerPair: ("m1" "drawing") 

ShapePts: ((0.0 0.0) (100.0 100.0))

PropertyName: Name PropertyValue: "p3" 

LxLyCoor: 0.000000:0.000000

DxDy:  100.000000:100.000000

EndShape!

 

I may want to add minor modifications to the coordinates then read the file back into SKILL and re-create the shapes using dbCreateRect, dbCreatePolygon..feeding it the same info I pulled off the shape.

I use an 'infile and gets' to read each line. The lines come in with the following syntax.

 "LayerPair: (\"m2\" \"drawing\") \n"

I've tried parseString and other manipulations unsuccessfully. I'm sure there is a clever and obvious way to do this.

I did look at the online support, forum and google but I may not be phrasing the question correctly. 

I'd appreciate some pointers on what I'm doing wrong with the syntax..this should be simple with SKILL. 

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Julia,

    For example, missing out the colons would make it much easier as you could then read each line using linereadstring or even just lineread from the original file. I also changed the coordinates to be as lists, and removed the exclamation mark from the EndShape statement. So:

    LayerPair ("m1" "drawing")
    ShapePts ((0.0 0.0) (100.0 100.0))
    PropertyName Name PropertyValue "p3"
    LxLyCoor (0.000000 0.000000)
    DxDy (100.000000 100.000000)
    EndShape

    Doesn't lose much in terms of readability, but you can then do:

    prt=infile("data.txt")
    while(data=lineread(prt)
      when(listp(data)
        case(car(data)
          (LayerPair  printf("LayerPair is %L\n" cadr(data)))
          (ShapePts  printf("Points: %L\n" cadr(data)))
          (PropertyName printf("Create a property %s with value %s\n" cadr(data) cadddr(data)))
          (LxLyCoor printf("LxLy is at %L\n" cadr(data)))
          (DxDy printf("DxDy is at %L\n" cadr(data)))
          (EndShape printf("The end of the shape as we know it!\n"))
        )
      )
    )
    close(prt)

    This then displays:

    Points: ((0.0 0.0) (100.0 100.0))
    Create a property Name with value p3
    LxLy is at (0.0 0.0)
    DxDy is at (100.0 100.0)
    The end of the shape as we know it!

    Now you could go a lot further and make it even more machine readable - but maybe this ends up being less human readable:

    (Shape
     LayerPair ("m1" "drawing")
     ShapePts ((0.0 0.0) (100.0 100.0))
     PropertyName Name PropertyValue "p3"
     LxLyCoor (0.000000 0.000000)
     DxDy (100.000000 100.000000)
    )

    Then you could use:

    prt=infile("data.txt")
    data=car(lineread(prt))
    close(prt)
    data->LayerPair  => ("m1" "drawing")
    data->PropertyValue => "p3"

    In other words, it's a disembodied property list, and you just slurped it all back into a DPL.

    Anyway, either approach is pretty reasonable and avoids complex parsing.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Hi Julia,

    For example, missing out the colons would make it much easier as you could then read each line using linereadstring or even just lineread from the original file. I also changed the coordinates to be as lists, and removed the exclamation mark from the EndShape statement. So:

    LayerPair ("m1" "drawing")
    ShapePts ((0.0 0.0) (100.0 100.0))
    PropertyName Name PropertyValue "p3"
    LxLyCoor (0.000000 0.000000)
    DxDy (100.000000 100.000000)
    EndShape

    Doesn't lose much in terms of readability, but you can then do:

    prt=infile("data.txt")
    while(data=lineread(prt)
      when(listp(data)
        case(car(data)
          (LayerPair  printf("LayerPair is %L\n" cadr(data)))
          (ShapePts  printf("Points: %L\n" cadr(data)))
          (PropertyName printf("Create a property %s with value %s\n" cadr(data) cadddr(data)))
          (LxLyCoor printf("LxLy is at %L\n" cadr(data)))
          (DxDy printf("DxDy is at %L\n" cadr(data)))
          (EndShape printf("The end of the shape as we know it!\n"))
        )
      )
    )
    close(prt)

    This then displays:

    Points: ((0.0 0.0) (100.0 100.0))
    Create a property Name with value p3
    LxLy is at (0.0 0.0)
    DxDy is at (100.0 100.0)
    The end of the shape as we know it!

    Now you could go a lot further and make it even more machine readable - but maybe this ends up being less human readable:

    (Shape
     LayerPair ("m1" "drawing")
     ShapePts ((0.0 0.0) (100.0 100.0))
     PropertyName Name PropertyValue "p3"
     LxLyCoor (0.000000 0.000000)
     DxDy (100.000000 100.000000)
    )

    Then you could use:

    prt=infile("data.txt")
    data=car(lineread(prt))
    close(prt)
    data->LayerPair  => ("m1" "drawing")
    data->PropertyValue => "p3"

    In other words, it's a disembodied property list, and you just slurped it all back into a DPL.

    Anyway, either approach is pretty reasonable and avoids complex parsing.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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