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

Re: gEDA-user: gschem sym files



Karl:
> >   1b, identify the correct meaning of pintype values as used today
> 
> Since drc2 is the only user of the pintype value, I looked into it.
...
> Note A,
>  since drc-matrix is symmetric (connection a -> b is the
>  same as connection b -> a) and it is not directly referenced by 
>  anything else than get-drc-matrixelement, I suggest we do it lower 
>  triangular and let get-drc-matrix-element swap row/column if
>  row < column. As a side effect the drc2:is_simetric-drc-matrix
>  check could be elimated.
...

Patch attached.

Regards,
/Karl Hammar

---------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57

diff --git a/gnetlist/scheme/gnet-drc2.scm b/gnetlist/scheme/gnet-drc2.scm
index a72f2a4..62e9fdc 100644
--- a/gnetlist/scheme/gnet-drc2.scm
+++ b/gnetlist/scheme/gnet-drc2.scm
@@ -219,27 +219,27 @@
 ;  Order is important !
 ;             unknown in    out   io    oc    oe    pas   tp    tri   clk   pwr unconnected
 ;unknown
-  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\e )
+  '(            #\c )
 ;in
-  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\e )
+  '(            #\c   #\c   )
 ;out
-  '(            #\c   #\c   #\e   #\w   #\e   #\e   #\c   #\e   #\e   #\c   #\e   #\e )
+  '(            #\c   #\c   #\e   )
 ;io
-  '(            #\c   #\c   #\w   #\c   #\w   #\w   #\c   #\w   #\c   #\c   #\w   #\e )
+  '(            #\c   #\c   #\w   #\c   )
 ;oc
-  '(            #\c   #\c   #\e   #\w   #\e   #\c   #\c   #\e   #\c   #\c   #\e   #\e )
+  '(            #\c   #\c   #\e   #\w   #\e   )
 ;oe
-  '(            #\c   #\c   #\e   #\w   #\c   #\e   #\c   #\e   #\c   #\c   #\e   #\e )
+  '(            #\c   #\c   #\e   #\w   #\c   #\e   )
 ;pas
-  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\e )
+  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   )
 ;tp
-  '(            #\c   #\c   #\e   #\w   #\e   #\e   #\c   #\e   #\e   #\c   #\e   #\e )
+  '(            #\c   #\c   #\e   #\w   #\e   #\e   #\c   #\e   )
 ;tri
-  '(            #\c   #\c   #\e   #\c   #\c   #\c   #\c   #\e   #\c   #\c   #\e   #\e )
+  '(            #\c   #\c   #\e   #\c   #\c   #\c   #\c   #\e   #\c   )
 ;clk
-  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\e   #\e )
+  '(            #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   #\c   )
 ;pwr
-  '(            #\c   #\c   #\e   #\w   #\e   #\e   #\c   #\e   #\e   #\e   #\c   #\e )
+  '(            #\c   #\c   #\e   #\w   #\e   #\e   #\c   #\e   #\e   #\e   #\c  )
 ;unconnected
   '(            #\e   #\e   #\e   #\e   #\e   #\e   #\e   #\e   #\e   #\e   #\e   #\e )
 )))
@@ -284,7 +284,9 @@
 ; Get value x y from matrix
 (define drc2:get-drc-matrix-element
   (lambda (row column)
-	  (list-ref (list-ref drc-matrix row) column)))
+    (if (< row column)
+	(list-ref (list-ref drc-matrix column) row)
+	(list-ref (list-ref drc-matrix row) column))))
   
 ; Check if all elements of the DRC matrix are characters
 (define drc2:drc-matrix-elements-are-correct?
@@ -306,27 +308,6 @@
       
 ))
 
-; Check if the DRC matrix is simetric.
-(define drc2:is-simetric-drc-matrix
-  (lambda ()
-    (let check-row ((row 1))
-      (if (let check-column ((column 0))    
-	    (if (not (eqv? (drc2:get-drc-matrix-element row column)
-			   (drc2:get-drc-matrix-element column row)))
-		#f
-		(if (< column (- row 1))
-		    (check-column (+ column 1)) 		    
-		    #t)
-		)
-	    )
-	  (if (< row (- (length pintype-names) 1))
-	      (check-row (+ row 1)) 
-	      #t)	  
-	 #f)
-      )
-      
-))
-	  
 ;
 ; End of DRC matrix functions
 ;-----------------------------------------------------------------------
@@ -924,12 +905,6 @@
          (begin
 		    
 	    ;; Perform DRC-matrix sanity checks.
-	    ; See if the matrix is simetric.
-	    (if (not (drc2:is-simetric-drc-matrix))
-		(begin (display "INTERNAL ERROR: DRC matrix is NOT simetric." port)
-		       (newline port)
-		       (newline port)
-		       (error "INTERNAL ERROR. DRC matrix is NOT simetric")))
 	    ; See if all elements of the matrix are chars
 	    (if (not (drc2:drc-matrix-elements-are-correct?))
 		(begin (display "INTERNAL ERROR: DRC matrix elements are NOT all chars." port)

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