<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.cadence.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Creating Circles in layout</title><link>https://community.cadence.com/cadence_technology_forums/f/custom-ic-design/40642/creating-circles-in-layout</link><description>Hi, 
 I am trying to create a circle in my layout with smallest possible resolution (PDK suggests 5 nm). For this, I used the SKILL code posted before on this forum. The code works for the radius 1 um and grid size 5 nm and the shape passes the DRC. But</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Creating Circles in layout</title><link>https://community.cadence.com/thread/1357634?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 18:03:24 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:44d99ef8-aeb5-437e-9f04-85c21e93059a</guid><dc:creator>Andrew Beckett</dc:creator><description>&lt;p&gt;The limit is 4000. I just picked a number which was less than a quarter of that without me needing to think too carefully about precisely how I was counting the number of points. So I arbitrarily picked 960 as it&amp;#39;s less than 1000. 1000 wouldn&amp;#39;t have worked (I just tried) as some of the point lists end up too long.&lt;/p&gt;
&lt;p&gt;So it was mostly laziness - I didn&amp;#39;t want to think about it too much!&lt;/p&gt;
&lt;p&gt;Andrew.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating Circles in layout</title><link>https://community.cadence.com/thread/1357632?ContentTypeID=1</link><pubDate>Mon, 12 Nov 2018 16:26:57 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:1159d924-33a2-45dd-98a8-a1d697365b7f</guid><dc:creator>RakeshPRG</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;/p&gt;
&lt;p&gt;Thanks. Using this code, I could generate the required circle. I am curious point count bound 960 specified in the code. I believe its like one fourth of the maximum which could be like 3840. How did you determine these maximum number of points?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Rakesh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating Circles in layout</title><link>https://community.cadence.com/thread/1357620?ContentTypeID=1</link><pubDate>Sun, 11 Nov 2018 17:59:41 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:3b2c80de-f8ff-41f7-8253-facc9f26bebd</guid><dc:creator>Andrew Beckett</dc:creator><description>[quote userid="404115" url="~/cadence_technology_forums/f/custom-ic-design/40642/creating-circles-in-layout/1357611#1357611"]Thanks for the reply. I don&amp;#39;t know how to use the snippet of the code you mentioned above. I tried to run it in a separate skill file and also added it to the existing skill code[/quote]
&lt;p&gt;To use it, I placed an instance of your pcell, flattened it, and then just did load(&amp;quot;checkCode.il&amp;quot;) in the CIW where checkCode.il is the file containing the grid checking code I provided. I didn&amp;#39;t add much fanciness around it because it was just a quick check - so I suggest you don&amp;#39;t try running it on a layout which has anything other than one flattened instance of the pcell. It makes no sense to &amp;nbsp;include it in the pcell code itself.&lt;/p&gt;
&lt;p&gt;That said, I can&amp;#39;t really comment on what your DRC checks&amp;nbsp;are doing as I don&amp;#39;t have any visibility on these.&lt;/p&gt;
&lt;p&gt;The abGriddedCircle fails because it makes no attempt to ensure that there are fewer than 4000 points in the polygon, and such a large circle will result in more points. I made a change to the code below, and now it will produce a set of abutting polygons representing slices of the circle so that no polygon has too many points:&lt;/p&gt;
&lt;p&gt;&lt;a name="file1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;i&gt;&lt;span style="color:#b22222;"&gt;/* abGriddedCircle.il

Author     A.D.Beckett
Group      Custom IC (UK), Cadence Design Systems Ltd.
Language   SKILL
Date       Nov 11, 2018 
Modified   
By         

Have updated abGriddedCircle to split into pieces with
fewer than 4000 points

***************************************************

SCCS Info: @(#) abGriddedCircle.il 11/11/18.17:30:10 1.2

*/&lt;/span&gt;&lt;/i&gt;

&lt;i&gt;&lt;span style="color:#b22222;"&gt;/*****************************************************************
*                                                                *
*           abGriddedCircle(cellView lpp radius grid)            *
*                                                                *
* Draw a circle as a polygon, with all the points on a specified *
*               grid, with all angles 90 degrees.                *
*                                                                *
*****************************************************************/&lt;/span&gt;&lt;/i&gt;

&lt;b&gt;&lt;span style="color:#a020f0;"&gt;procedure&lt;/span&gt;&lt;/b&gt;(abGriddedCircle(cellView lpp radius grid)
    &lt;b&gt;&lt;span style="color:#a020f0;"&gt;let&lt;/span&gt;&lt;/b&gt;((point numSteps radSq pointList halfPointList 
            listOfHalfPointLists y (pointCount 0))
        radSq=radius**2
        numSteps=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;round&lt;/span&gt;&lt;/b&gt;(radius/grid)
        &lt;b&gt;&lt;span style="color:#a020f0;"&gt;for&lt;/span&gt;&lt;/b&gt;(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;step&lt;/span&gt;&lt;/b&gt; -numSteps numSteps
            y=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;round&lt;/span&gt;&lt;/b&gt;(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;sqrt&lt;/span&gt;&lt;/b&gt;(radSq-(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;step&lt;/span&gt;&lt;/b&gt;*grid)**2)/grid)*grid
            point=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;step&lt;/span&gt;&lt;/b&gt;*grid:y
            &lt;b&gt;&lt;span style="color:#a020f0;"&gt;when&lt;/span&gt;&lt;/b&gt;(halfPointList
                halfPointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;cons&lt;/span&gt;&lt;/b&gt;(xCoord(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;car&lt;/span&gt;&lt;/b&gt;(halfPointList)):y halfPointList)
            )
            halfPointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;cons&lt;/span&gt;&lt;/b&gt;(point halfPointList)
            &lt;i&gt;&lt;span style="color:#b22222;"&gt;;------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;            &lt;i&gt;&lt;span style="color:#b22222;"&gt;; Note that there are really two points added for each pointCount
&lt;/span&gt;&lt;/i&gt;            &lt;i&gt;&lt;span style="color:#b22222;"&gt;; so check when we reach a quarter of the maximum number of points
&lt;/span&gt;&lt;/i&gt;            &lt;i&gt;&lt;span style="color:#b22222;"&gt;;------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;            pointCount++
            &lt;b&gt;&lt;span style="color:#a020f0;"&gt;when&lt;/span&gt;&lt;/b&gt;(pointCount&amp;gt;=960
                listOfHalfPointLists=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;cons&lt;/span&gt;&lt;/b&gt;(halfPointList listOfHalfPointLists)
                halfPointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;list&lt;/span&gt;&lt;/b&gt;(point)
                pointCount=0
            )
        )
        &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;        &lt;i&gt;&lt;span style="color:#b22222;"&gt;; Add the remaining halfPointList on, unless only just started
&lt;/span&gt;&lt;/i&gt;        &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;        &lt;b&gt;&lt;span style="color:#a020f0;"&gt;unless&lt;/span&gt;&lt;/b&gt;(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;zerop&lt;/span&gt;&lt;/b&gt;(pointCount)
            listOfHalfPointLists=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;cons&lt;/span&gt;&lt;/b&gt;(halfPointList listOfHalfPointLists)
        )
        &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;        &lt;i&gt;&lt;span style="color:#b22222;"&gt;; Iterate over all the half point lists, and create polygons from
&lt;/span&gt;&lt;/i&gt;        &lt;i&gt;&lt;span style="color:#b22222;"&gt;; each half point list, together with the flipped other half
&lt;/span&gt;&lt;/i&gt;        &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;        &lt;b&gt;&lt;span style="color:#a020f0;"&gt;foreach&lt;/span&gt;&lt;/b&gt;(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;mapcar&lt;/span&gt;&lt;/b&gt; halfPointList listOfHalfPointLists
            pointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;nil&lt;/span&gt;&lt;/b&gt;
            &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;            &lt;i&gt;&lt;span style="color:#b22222;"&gt;; Build the complete point list from two halves, one flipped
&lt;/span&gt;&lt;/i&gt;            &lt;i&gt;&lt;span style="color:#b22222;"&gt;;----------------------------------------------------------------
&lt;/span&gt;&lt;/i&gt;            pointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;lconc&lt;/span&gt;&lt;/b&gt;(pointList 
                &lt;b&gt;&lt;span style="color:#a020f0;"&gt;foreach&lt;/span&gt;&lt;/b&gt;(&lt;b&gt;&lt;span style="color:#a020f0;"&gt;mapcar&lt;/span&gt;&lt;/b&gt; xy &lt;b&gt;&lt;span style="color:#a020f0;"&gt;reverse&lt;/span&gt;&lt;/b&gt;(halfPointList) xCoord(xy):-yCoord(xy))
            )
            pointList=&lt;b&gt;&lt;span style="color:#a020f0;"&gt;lconc&lt;/span&gt;&lt;/b&gt;(pointList halfPointList)
            &lt;b&gt;&lt;i&gt;&lt;span style="color:#000000;"&gt;dbCreatePolygon(cellView&lt;/span&gt;&lt;/i&gt;&lt;/b&gt; lpp &lt;b&gt;&lt;span style="color:#a020f0;"&gt;car&lt;/span&gt;&lt;/b&gt;(pointList))
        )
    )
)
&lt;/pre&gt;
&lt;p&gt;&lt;a name="file1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So perhaps give that a try. Not sure why this should be any better in terms of being on-grid than the original code, but at least all the segments are orthogonal (which they aren&amp;#39;t in the earlier code you were trying).&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Andrew.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating Circles in layout</title><link>https://community.cadence.com/thread/1357611?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 18:22:32 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:e0c3c4c3-1107-4e52-92de-9c68500d416c</guid><dc:creator>RakeshPRG</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;/p&gt;
&lt;p&gt;Thanks for the reply. I don&amp;#39;t know how to use the snippet of the code you mentioned above. I tried to run it in a separate skill file and also added it to the existing skill code. The structure created using the above code does not comply with the DRC rules. I am trying to circumvent this problem. So I also used another SKILL code you have provided in one of the previous forums. The code goes as&lt;/p&gt;
&lt;p&gt;procedure(abGriddedCircle(cellView lpp radius grid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; let((point numSteps radSq pointList y)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radSq=radius**2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; numSteps=round(radius/grid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(sign &amp;#39;(1 -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(step -numSteps numSteps&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=round(sign*sqrt(radSq-(step*grid)**2)/grid)*grid&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point=step*grid:y&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when(pointList&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointList=cons(xCoord(car(pointList)):y pointList)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointList=cons(point pointList)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbCreatePolygon(cellView lpp pointList)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and then using the abgriddedCircle function, I could create circles of different radii and also multiple circle in the same layout very conveniently. But I face an error when I try the 20 um radius and 0.005 grid. The error details invalid point list (as shown in the attached fig). Can you suggest how to overcome this and create the circle?&lt;img alt=" " src="https://community.cadence.com/resized-image/__size/640x0/__key/communityserver-discussions-components-files/38/CIW-error.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Creating Circles in layout</title><link>https://community.cadence.com/thread/1357610?ContentTypeID=1</link><pubDate>Fri, 09 Nov 2018 09:11:16 GMT</pubDate><guid isPermaLink="false">75bcbcf9-38a3-4e2e-b84b-26c8c46a9500:cc21acbc-306b-4b9c-a475-9e535b303724</guid><dc:creator>Andrew Beckett</dc:creator><description>&lt;p&gt;As far as I can see, if you use this PCell with a radius of 20, and a grid of 0.005, all the points in the various slices are all on-grid. I assume this came from this post:&amp;nbsp;&lt;a href="https://community.cadence.com/cadence_technology_forums/f/custom-ic-design/11890/creating-circle-in-virtuoso/15769#15769"&gt;https://community.cadence.com/cadence_technology_forums/f/custom-ic-design/11890/creating-circle-in-virtuoso/15769#15769&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The chopping into sections is because Virtuoso has a historical limit of 4000 points per polygon, and so you can&amp;#39;t create a polygon directly that has more than that number of points - this code works (as far as I can see) by creating a number of different slices when the point count is exceeded.&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t run Calibre on this (because I don&amp;#39;t have it, nor do I have the rules you&amp;#39;re using), but I placed an instance, flattened it, and then ran:&lt;/p&gt;
&lt;pre&gt;let((shapeOffGrid)
    foreach(shape geGetEditCellView()~&amp;gt;shapes
        shapeOffGrid=nil
        foreach(point shape~&amp;gt;points
            when(mod(round(xCoord(point)*1000) 5)!=0 ||
                mod(round(yCoord(point)*1000) 5)!=0
                printf(&amp;quot;Off grid %L\n&amp;quot; point)
                shapeOffGrid=t
            )
        )
        when(shapeOffGrid
            geSelectFig(shape)
        )
    )
)&lt;/pre&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Andrew&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>