The bugreport is mostly from the "undo print 20" c...
# magic
p
The bugreport is mostly from the "undo print 20" command from magic. Tim understands that better than me I guess. The essential part is that magic uses a double-linked-list to manage the undo/redo list (you can see the head, tail and cur[rent] pointers there), but after an undo the cur pointer is suddenly a NULL pointer, even though that shouldn't be possible with a non-NULL double linked list
👍 1
t
I have the tarball and will look into it when I get the chance. I am interested in getting some version of this into magic/open_pdks, such that the rule tags that you put in the rule description can be put into the magic techfile in open_pdks. However, I would like to make a few usability changes; namely, to treat the tags as something that is not normally printed in "drc why" output but would only appear in output with a specific command option (since the information in the tags is not particularly useful to the end-user just staring at it). Maybe use "%[" to start a tag instead of "[" so that it can be handled by the escape substitution routine without preventing the use of brackets in a normal rule description.
p
Well, I am thinking whether magic might be able to provide the annotation of the DRC rules on the fly, then we would not need the annotated tech files.
If we had a command like "drc why kind" which would inform about the kind of the DRC issue, e.g. "spacing" or "width" or "maxwidth" ... and if we had a command like "drc why layers" which would provide the layer definition of the DRC rule, and perhaps a "drc why layers expand" which would expand them the same way "tech layers" does (but supporting images), then we would not need the annotated tech files anymore.
Perhaps also assigning unique IDs to each DRC rule and having some commands that provide meta-information of the rules might be useful.
A DRC listall why could then refer to that unique DRC rule ID, and then you could use the drc rules commands to get all the necessary details about the rules...
t
The "why" description already does something like this, because I did not want to save a copy of a string in every rule, so each rule gets a "tag" number that's an index into an array of strings. But it can also be an index into an array of anything else.
p
It might also be interesting perhaps to have a function inside magic that exports the whole list of DRC rules into a tabular form, perhaps CSV or something else.
t
The "tech drc" command option was the start of that, but I never did more than implement a few rule types. Should be easy enough to extend, though.
Probably requires automatically tagging the rule type at the time the tech file is parsed, though, because otherwise that information is lost, and it's very hard to determine what kind of rule it is supposed to be from looking at the generic edge rule implementation.