• 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 13665
  • 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
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    In general I would recommend writing the file in a format that is easy to parse - using things like lineread() can make it very easy to parse text which is in a SKILL-like syntax. 

    Assuming you're stuck with what you have though, how about this:

    layerPairPattern=pcreCompile("^LayerPair:(.*)$")
    when(pcreExecute(layerPairPattern line)
      data=car(linereadstring(pcreSubstitute(layerPairPattern "\\1")))
    )

    Assuming your line to process is in a variable line then data would contain ("m2" "drawing") (i.e. a list).

    If you're using IC5141, you'd have to use rex functions rather than pcre functions, but pattern matching is still your friend. Just a little less powerful in general:

    rexCompile("^LayerPair:\\(.*\\)$")
    when(rexExecute(line)
      data=car(linereadstring(rexSubstitute("\\1")))
    )

    Note that the pattern syntax is slightly different for the "registers" (i.e. remembering parts of a pattern) with rex than pcre.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Julia
    Julia over 10 years ago

    Hi Andrew,

    The oldest version is IC615.

    I have some flexibility on the file to parse. I created the first part of the script but later learned the user wanted to Re-Create modified versions of the shapes.

    I would appreciate suggestions on the format of the file.

    I still have the limitation of labeling the items for the user to know the information. The properties and coordinates is what they'll likely modify.

     

    Thanks for responding,

    Julia 

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • 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
  • Julia
    Julia over 10 years ago

    Working extremely well. I'm able to manipulate and move forward with the next requirements. THANKS!!

     

    • 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