• 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 Design
  3. Import some particular shape in to Cadence layout L

Stats

  • Locked Locked
  • Replies 23
  • Subscribers 128
  • Views 21744
  • 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

Import some particular shape in to Cadence layout L

engine2011
engine2011 over 13 years ago

 Hi everyone,

 I want to use standard technology to fabricate a device which is basically a circle shape realized with the toppest level metal layer. Because the process resolution is 0.01um, the smooth brim of circle is not acceptable and will introduce some class a DRC errors. 

 Now I am making the brim of circle replaced by 90 degree polygon to solve these errors. The problem is, if I want to make it a good approximation to a circle, the polygon will be very complex. I can use Matlab to generate this shape without much effort, however, it will be very complex to draw it manually in Cadence. Does cadence have some function to import the shape data from Matlab?

 Thanks!

EF

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    It sounds to me as if you actually have some kind of "raster" representation where you have a matrix with 1s and 0s representing pixels (sort of)? So one approach would be to draw a set of rectangles and then merge them into a polygon? A similar idea is used in the code shown in this post - in the function abPixMapDrawLayout.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • engine2011
    engine2011 over 13 years ago

    Hi Andrew,

     Yes you are right, it's a kind of "raster". The shape is orignally a solid circle but the smooth brim of the circle can not pass DRC, we need to make the brim 'raster' to make it locates on the grid, and the final polygon have all side to side angles of 90.

    It is similar to a logo drawing. I hope the code will works for us. Thanks a lot Andrew!

    EF

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

    Another possiblity is to use something like this code which I just wrote:

    procedure(abGriddedCircle(cellView lpp radius grid)
        let((point numSteps radSq pointList y)
            radSq=radius**2
            numSteps=round(radius/grid)
            foreach(sign '(1 -1)
                for(step -numSteps numSteps
                    y=round(sign*sqrt(radSq-(step*grid)**2)/grid)*grid
                    point=step*grid:y
                    when(pointList
                        pointList=cons(xCoord(car(pointList)):y pointList)
                    )
                    pointList=cons(point pointList)
                )
            )
            dbCreatePolygon(cellView lpp pointList)
        )
    )

    For example:

    abGriddedCircle(geGetEditCellView() "Metal2" 20.0 1.0)

     

    Produced the attached image.

     

    Andrew.

     

    • circle.png
    • View
    • Hide
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • engine2011
    engine2011 over 13 years ago
    Hi Andrew,

    We have a question about your code of abXpmToLayout.ils. We have got an Xpm file now, and we tried to load our Xpm file into your code. But we have some problems about importing our file.

    We changed the file name at the line 94 of your code:

    (defun abPixMapReadFile ("/h/efu01/ibm180/final.XPM")

    then the following error showed:

    *Error* defun: illegal type character found in type template - defun(abPixMapReadFile ("/h/efu01/ibm180/final.XPM") let((prt staticFound line data dimensions ... ) unless((prt = &) error("Could not read pixmap file %s" fileName)) rexCompile("static char") while((& && &) (staticFound = &)) when(staticFound (data = t) while(& t) getWarn()) ... ))

    <<< Stack Trace >>>

    load("abXpmToLayout.ils")

    *Error* load: error while loading file - "abXpmToLayout.ils" at line 158

    <<< Stack Trace >>>

    load("abXpmToLayout.ils")

    Could you tell me what's the problem it is? Any other changes should I put into your code for importing our Xpm file. P.S. The Xpm file is 1500*1500 pixel.

    Thanks,

    EF
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    The problem is that you've changed the code so that it is now not syntactically correct! You've changed the name of the argument to that function to be a literal string - and that's not allowed. Nor is it necessary. The whole point of defining a function with an argument is to allow you to call that function with whatever value you like - you should not have to change the code for each pathname you want to use.

    So, leave the code as it was, and then do:

    abPixMapReadFile("/h/efu01/ibm180/final.XPM")

    Or even just call:

    abXpmToLayout()

    and then use the form to navigate to the file you wish to import. Calling abPixMapReadFile alone will not produce the image - it just parses the pixmap and stores it in some data structures, ready to be drawn later. The function that does the drawing is abPixMapDrawLayout() - but you'll need to see how the various callbacks work to see how the data structures are assembled so that they are ready to be called by abPixMapDrawLayout(). Using the form saves you that bother - it will read the file and then pop up another form to get you to choose which layers you want to be used for which colours in the original pixmap file.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • engine2011
    engine2011 over 13 years ago

    Hi Andrew,

    I did the following things by steps:

    Firstly I load the code by: load("abXmpToLayout.ils"), it returns "t"

    Then, I run: abPixMapReadFile("final.XPM"), it returns stdobj@0x14a09024, there is not other callbacks.

    However, there is a warning after I load the ils file:

    *WARNING* (TECH-230035): User-defined rule "minExtensionDistance" in constraint
                             group "foundry" of techDB "cmrf7sf" conflicts with
                             a built-in constraint with the same name.
                             You may write out "constraintGroups" section to an
                             ASCII file, reopen the technology database in "a"
                             mode, and reload the file to update the database.
                             Another option is to rename this rule.

    This warning even shows when I start cadence virtuoso, but I will always check the Options-display-grid controls to make sure the minimum snap is correct. So I think this warning doesn't affect custom layout design. I don't know whether it will affect the parse of the Xmp file.

    Thanks,

    EF

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

    Those warnings can't be coming from loading the file, or from calling that function. They are coming when something is loading in the technology library, I believe - which could be triggered when something first accesses your technology library.

    It certainly won't affect parsing of the XPM file. 

    As I said before though, all you've done by calling abPixMapReadFile is to read the pixmap file and store it in some internal data structures; inside the rest of the code are functions to take that data structure and generate a layout from it.

    As I said before, I would start by using the main entry point into the code and use the user interface (abXpmToLayout).

    Or you could even use the other code I posted which directly generates the circle with only 90 degree angles used. That's even simpler...

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • engine2011
    engine2011 over 13 years ago

    Hi Andrew,

    We finally got it. Thanks!

    The other coding you gave me last time also works. But we finally want to draw a raster donut but a raster solid circle, so it does not work for that.

    Thanks a lot!

     EF & Liu

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

    Hi EF & Liu,

    I did two things here - I corrected the previous abGriddedCircle implementation (I'd made a mistake and the direction of one of the halves was wrong - so you had a slightly strange polygon with a line through the middle), and added abGriddedDonut - which gives you the ability to create donuts directly too.

    /*****************************************************************
    *                                                                *
    *           abGriddedCircle(cellView lpp radius grid)            *
    *                                                                *
    * Draw a circle as a polygon, with all the points on a specified *
    *               grid, with all angles 90 degrees.                *
    *                                                                *
    *****************************************************************/

    procedure(abGriddedCircle(cellView lpp radius grid)
        let((point numSteps radSq pointList halfPointList y)
            radSq=radius**2
            numSteps=round(radius/grid)
            for(step -numSteps numSteps
                y=round(sqrt(radSq-(step*grid)**2)/grid)*grid
                point=step*grid:y
                when(halfPointList
                    halfPointList=cons(xCoord(car(halfPointList)):y halfPointList)
                )
                halfPointList=cons(point halfPointList)
            )
            ;----------------------------------------------------------------
            ; Build the complete point list from two halves, one flipped
            ;----------------------------------------------------------------
            pointList=lconc(pointList
                foreach(mapcar xy reverse(halfPointList) xCoord(xy):-yCoord(xy))
            )
            pointList=lconc(pointList halfPointList)
            dbCreatePolygon(cellView lpp car(pointList))
        )
    )

    /***************************************************************
    *                                                              *
    *        abGriddedDonut(cellView lpp outer inner grid)         *
    *                                                              *
    *  Draw a donut as a polygon, with all points on a specified   *
    *              grid, with all angles 90 degrees.               *
    *                                                              *
    ***************************************************************/

    procedure(abGriddedDonut(cellView lpp outer inner grid)
        let((point numSteps radSq pointList halfPointList y)
            foreach((direction radius) '(1 -1) list(outer inner)
                radSq=radius**2
                numSteps=round(radius/grid)
                halfPointList=nil
                for(step -numSteps numSteps
                    y=direction*round(sqrt(radSq-(step*grid)**2)/grid)*grid
                    point=step*grid:y
                    when(halfPointList
                        halfPointList=cons(xCoord(car(halfPointList)):y halfPointList)
                    )
                    halfPointList=cons(point halfPointList)
                )
                ;------------------------------------------------------------
                ; Build the complete point list from two halves, one flipped
                ;------------------------------------------------------------
                pointList=lconc(pointList
                    foreach(mapcar xy reverse(halfPointList) xCoord(xy):-yCoord(xy))
                )
                pointList=lconc(pointList halfPointList)
            )
            dbCreatePolygon(cellView lpp car(pointList))
        )
    )

    Enjoy!

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • engine2011
    engine2011 over 13 years ago

    Thanks a lot, Andrew!!

    • 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