delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2014/01/10/04:44:19

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Envelope-From: paubert AT iram DOT es
Date: Fri, 10 Jan 2014 10:43:26 +0100
From: Gabriel Paubert <paubert AT iram DOT es>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] Suppress NC nodes from netlist?
Message-ID: <20140110094326.GA12963@visitor2.iram.es>
References: <alpine DOT LRH DOT 2 DOT 01 DOT 1401091631360 DOT 13782 AT homer02 DOT u DOT washington DOT edu>
MIME-Version: 1.0
In-Reply-To: <alpine.LRH.2.01.1401091631360.13782@homer02.u.washington.edu>
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Spamina-Bogosity: Unsure
X-Spamina-Spam-Score: -0.2 (/)
X-Spamina-Spam-Report: Content analysis details: (-0.2 points)
pts rule name description
---- ---------------------- --------------------------------------------------
-1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP
0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60%
[score: 0.5094]
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, Jan 09, 2014 at 04:38:35PM -0800, Frank Miles wrote:
> (gschem-gnetlist newbie here...)
> 
> I'd like to suppress 'not connected' nodes from the gnetlist output.  These have
> NC symbols attached in gschem.  Is there some simple way that I'm oblivious to?
> Or is this possible in a newer gnetlist and not mine?  Thanks!

I think it's a kind of "harmless bug" that does not bother most
netlist writers.

However, for a person who uses CadStar to implement my schematics, I had
to write a new netlister and I had to remove single pin nets because of
the format: the first line of each net definition has to include 2 pins.
I also occasionnally encountered nets with zero pins!

I don't think my netlister is really ready for use by external people, 
but what I did is the following (I have trimmed some parts which have
nothing to see with connectivity netlist, since I also included routing 
directives for impedance control and grouping directives to define differential 
pairs, so maybe some parentheses are now unbalanced), the critical line being
the (cond ((> (length netpins) 1) in the rinf:write-net function:

;;
;; Display the individual net connections 
;; starting from the third if they exist.
;;
(define rinf:write-connections
  (lambda (netpins port)
    (if (not (null? netpins))
        (begin
          (format port "         ~a ~a~%" 
                  (caar netpins)
                  (cadar netpins))
          (rinf:write-connections (cdr netpins) port)))))

;;
;; Display all pins from the net starting from the passed one
;; which is the second one.
;; 
;; This is the line with the .TER command. 
;;
(define rinf:write-net-pins
  (lambda (netpins port)
    (format port ".TER     ~a ~a~%"
            (caar netpins)
            (cadar netpins))
    (rinf:write-connections (cdr netpins) port)))

;;
;; Write net: first line starting .ADD_TER 
;;
;; Only write nets that have at least 2 pins: gnetlist
;; produces quite a lot of single pin nets, even when
;; a pin is explicitly connected to a No-connect symbol!
;; There are also cases where the list of pins is empty!
define rinf:write-net
  (lambda (port netnames)
    (if (not (null? netnames))
        (let ((netpins (gnetlist:get-all-connections (car netnames)))
          (cond ((> (length netpins) 1)
                 (format port ".ADD_TER ~a ~a ~s~%" 
                         (caar netpins)
                         (cadar netpins) 
                         (car netnames))
                  (rinf:write-net-pins (cdr netpins) port)
                  (newline port)))
           (rinf:write-net port (cdr netnames))))))

;;
;; Write the net part of the gEDA format
;;
(define rinf:nets
   (lambda (port)
      (let ((all-uniq-nets (gnetlist:get-all-unique-nets "dummy")))
         (rinf:write-net port all-uniq-nets))))


	Gabriel

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019