[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: PATCH: gnetlist's drc2 backend should check that NoConnection nets don't have connections



Adding the NoConnection DRC attribute to a net causes the drc2 backend
to ignore it when checking for unconnected nets.  However, drc2
currently doesn't enforce that the net is actually unconnected.  It's
possible to mark two pins as NoConnection and then accidentally wire
them together.  This patch to gnet-drc2.scm checks for that case:

--- /usr/share/gEDA/scheme/gnet-drc2.scm.bak	2011-01-03 17:35:36.000000000 -0700
+++ /usr/share/gEDA/scheme/gnet-drc2.scm	2011-01-03 18:34:08.000000000 -0700
@@ -556,6 +556,42 @@
 ;

 ;;
+;; Check for NoConnection nets with more than one pin connected.
+;;
+;; Example of all-nets: (net1 net2 net3 net4)
+(define drc2:check-connected-noconnects
+  (lambda (port all-nets)
+    (if (not (null? all-nets))
+      (let* ((netname (car all-nets))
+        (directives (gnetlist:graphical-objs-in-net-with-attrib-get-attrib
+                    netname
+                    "device=DRC_Directive"
+                    "value")))
+        (begin
+          ; Only check nets with a NoConnection directive
+          (if (member "NoConnection" directives)
+            (begin
+              (if ( >  (length (gnetlist:get-all-connections netname)) '1)
+                (begin
+                  (display (string-append "ERROR: Net '"
+                                  netname "' has connections, but "
+                                  "has the NoConnection DRC directive: ") port)
+                  (drc2:display-pins-of-type port "all"
(gnetlist:get-all-connections netname))
+                  (display "." port)
+                  (newline port)
+                  (set! errors_number (+ errors_number 1))
+                )
+              )
+            )
+          )
+          (drc2:check-connected-noconnects port (cdr all-nets))
+        )
+      )
+    )
+  )
+)
+
+;;
 ;; Check for nets with less than two pins connected.
 ;;
 ;; Example of all-nets: (net1 net2 net3 net4)
@@ -953,6 +989,14 @@
 		  (drc2:check-duplicated-references port packages)
 		  (newline port)))

+	    ;; Check for NoConnection nets with more than one pin connected.
+	    (if (not (defined? 'dont-check-connected-noconnects))
+		(begin
+		  (display "Checking NoConnection nets for connections..." port)
+		  (newline port)
+		  (drc2:check-connected-noconnects port
(gnetlist:get-all-unique-nets "dummy"))
+		  (newline port)))
+
 	    ;; Check nets with only one connection
 	    (if (not (defined? 'dont-check-one-connection-nets))
 		(begin


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user