Next: Initialization of the Backend
Up: Scheme backend API
Previous: Overview
Contents
Each netlist backend is required to provide a function whose name
matches the netlist type. For example, the switcap backend contained
in gnet-switcap.scm must provide a function called ``switcap''. That
is the function which gnetlist will call to initiate the netlisting.
The entry point function is given a single argument which is the
filename for the output netlist. Typically the first thing a
netlister does is to open the output file for writing.
The following excerpt from the switcap backend shows the start of the
entry point function and shows the output file being opened. At the
end of the function, the output file is closed.
;; ---------------------------------------
;; Switcap netlist generation -- top level
;; ---------------------------------------
(define switcap
(lambda (output-filename)
(let ((port (open-output-file output-filename)))
;; rest of netlisting goes here
;; close the output file and return
(close-output-port port))))
Stuart Brorson
2005-03-15