I am working in the `sky130tech` file and would li...
# magic
r
I am working in the
sky130tech
file and would like to initialize the DRC rules in terms of lambda (λ). Specifically, I want to define lambda as 0.04µm and ensure that certain rules, such as the metal width, are written in terms of multiples of lambda. For example, how can I write a DRC rule to enforce that the metal width must be greater than 5λ (5 times lambda)? Could anyone guide me on how to structure this rule?
t
I got your email and was unable to respond because gmail kept rejecting my response as spam (very annoying behavior, Google. . .). Thanks for re-posting on Slack, as it's an interesting question with a somewhat complicated answer. I will post my email response below.
I'd like to make sure that you understand the implications of changing the lambda value in the technology; there are good reasons to use an SCMOS-like lambda value and work with lambda-based layout, but it is very uncommon and doesn't mesh well with non-lambda-based layout (which for sky130 is all the existing IP). A typical lambda choice is 1/2 minimum gate length, although with an odd-numbered value (0.13um), it may be better to increase the minimum gate length for lambda rules, which could be 0.14um or 0.16um (lambda = 0.07um or 0.08um). 0.04 is an unusual choice but may be a reasonable compromise; I have not spent any time analyzing how lambda rules would work in sky130 (and I generally regret my choice of 0.01um). Generally, the setting for lambda only requires the proper scalefactor in the cifoutput, cifinput, and drc sections of the tech file. In the existing tech file,
scalefactor 10 nanometers
means that values in the "cifoutput" section are written in nanometers and the relationship to magic's lambda units is 1 to 10. The same scalefactor is given in the cifinput section. The drc section is unitless (already in lambda) and the scalefactor only declares the ratio between values in the DRC section and lambda (so that rule distances can be given in fractional lambda values). The extract section uses "units microns" which ties the extraction values to whatever the scalefactor is in the "cifoutput" section. So to get your 0.04um lambda value, you would want to change the scalefactor values in cifinput and cifoutput from 10 to 40, and the drc scalefactor would also change from 10 to 40, and I think those are the only changes needed.
However, that said. . . In your email you didn't indicate that the purpose was to initialize DRC rules for lambda units. The answer to that question specifically may be much simpler, or more complicated, depending on how you want to go about it. 1. If you just want to do layout in lambda units, you can just set the snap grid to some unit value like 0.04um and that should be sufficient. 2. If you want DRC rule violations to be reported in lambda units instead of microns, replace the "%d" in all of the rules (and "%a" for area) with the lambda value 3. If you want the DRC rules to be measured in lambda units, then you would need to replace all of the DRC rules with the nearest lambda measurement, as well as replacing the "%d" as mentioned above in (2). If you have changed the effective lambda from 0.01 to 0.04 by changing scalefactors according to my previous post, then you don't need to do (3) manually; magic will start up with the internal grid scaled to lambda units, and the DRC rules will scale to lambda units as well (although they will be reported in microns if the "%d" syntax is used in the rule definition). I'm thinking that a better way to handle (2) would be for me to add a command option
drc lambda on|off
which would toggle between reporting DRC values in lambda vs. microns; it would be quite easy to implement.
r
Thank you so much @Tim Edwards. I really appreciate your help.
@Tim Edwards I want to pass argument like this " width *m1,rm1 ($scalefactor*6) "Metal1 width < %d (met1.1)" How can I do this ?
t
The traditional way to do this would be to have multiple
drc
sections, one for each scalefactor, rather than put the scalefactor into the DRC rule itself.