home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / pcbsrcs2 / manual < prev    next >
Text File  |  1991-02-07  |  11KB  |  218 lines

  1. BACKGROUND
  2. ----------
  3.  
  4. This is a software package for printed circuit board design. An article I
  5. wrote about it has been printed in the September 1989 issue of Dr. Dobb's
  6. Journal; the title is A* Autorouting. A copy of the article as it was
  7. submitted to Dr. Dobb's is in the file ARTICLE. Also included are various
  8. ascii representations of the figures. Dr. Dobb's editors decided not to print
  9. some of the article and a few of the figures, but I personally feel that the
  10. entire article and all of the figures are necessary for a full understanding
  11. of autorouting. You should probably read the article in Dr. Dobb's, or the
  12. file ARTICLE, before attempting to do anything with the programs.
  13.  
  14.  
  15. ABOUT THE PROGRAMS
  16. ------------------
  17.  
  18. This is a printed circuit board cad package. It consists of the following
  19. programs: a rat nester, an autorouter, a board viewer, a board printer, a
  20. postscript filter, a file packer (two kinds), and a file unpacker. The
  21. following comment appears in each of the main programs (pcb*.c):
  22.  
  23. ** you may give this software to anyone, make as many copies as you like, and
  24. ** post it on public computer bulletin boards and file servers. you may not
  25. ** sell it or charge any fee for distribution (except for media and postage),
  26. ** remove this comment or the copyright notice from the code, or claim that
  27. ** you wrote this code or anything derived from it. you may modify the code as
  28. ** much as you want (please document clearly with comments, and maintain the
  29. ** coding style), but programs which are derived from this one are subject to
  30. ** the conditions stated here. i am providing this code so that people can
  31. ** learn from it, so if you distribute it, please include source code, not
  32. ** just executables. contact me to report bugs or suggest enhancements; i do
  33. ** not guarantee support, but i will make an effort to help you, and i want to
  34. ** act as a central clearing house for future versions. you should contact me
  35. ** before undertaking a significant development effort, to avoid reinventing
  36. ** the wheel. if you come up with an enhancement you consider particularly
  37. ** useful, i would appreciate being informed so that it can be incorporated in
  38. ** future versions. my address is: Randy Nevin, 1731 211th PL NE, Redmond,
  39. ** WA 98053, USA. this code is available directly from the author; just send a
  40. ** 360k floppy and a self-addressed floppy mailer with sufficient postage.
  41.  
  42. What I intend this to say is that you can do anything you want with these
  43. programs with the following conditions: (1) you can't sell it or anything
  44. derived from it for profit, and (2) you must give me credit. I do not use the
  45. terms 'shareware', 'freeware', or 'public domain' to describe these programs,
  46. since currently accepted definitions for them do not match my intentions.
  47. These programs are absolutely free.
  48.  
  49.  
  50. WHAT THEY DO
  51. ------------
  52.  
  53. The rat nester reads a circuit description, and displays the circuit as a rat
  54. nest, showing the holes and straight lines connecting the specified holes,
  55. without regard to where traces cross. (This program is useful for helping the
  56. designer decide where the components should be located, based on the
  57. connections between them. Minimizing the overall distance of the traces to be
  58. routed can dramatically improve autorouting speed.)
  59.  
  60. The autorouter reads a circuit description, routes the traces, and outputs the
  61. routed printed circuit board to a file.
  62.  
  63. The board viewer can read this file and display an image of the 2-sided board
  64. on an EGA monitor.
  65.  
  66. The board printer can also read this file, and produces board image files of
  67. various resolutions. The board image files can then be sent to an HP laserjet
  68. II laser printer to get hard copy. The board printer can also produce
  69. vector-oriented board image files which are human-readable, and should be
  70. easily translatable into various graphics printer languages, such as
  71. postscript and hpgl.
  72.  
  73. The postscript filter is one such translator, and produces postscript output
  74. from the vector-oriented board image.
  75.  
  76. The file packer and unpacker can be used to save disk space; since board
  77. images usually consist of just a few kinds of bytes, compression rates of 80%
  78. are not uncommon. The file packer and unpacker are intended to compress large
  79. board images, but in fact will work on any file (though the savings are
  80. greatest for files consisting of just a few kinds of often repeated bytes).
  81.  
  82. There are actually two kinds of file packers, but the unpacker can handle
  83. either kind of compression. The first file packer (pcbpak1) uses huffman
  84. encoding down to the bit level, and the second file packer (pcbpak2) uses
  85. run-length encoding at the byte level. I suggest you try each, and use the
  86. one that results in the greatest savings (this will vary according to the
  87. input file).
  88.  
  89. I initially supported the EGA and the HP laserjet II because they are what I
  90. have access to. Shortly after the first release, a user donated the postscript
  91. filter. Other users will want support for different display adapters (VGA,
  92. Hercules) and printers. If you have one of these and are ambitious enough to
  93. enhance the programs to work with it, I hope you'll contact me so your work
  94. can be shared with others.
  95.  
  96.  
  97. COMPILING THE PROGRAMS
  98. ----------------------
  99.  
  100. A makefile is included which compiles and links the programs. It is written
  101. for the Microsoft C 4.0 compiler and Microsoft MASM 4.0 macro assembler, but
  102. should be easily adaptable to whatever compiler/assembler you have. (This is
  103. an example of an enhancement that others would like to share.) The two rules:
  104.     .c.obj:
  105.         cl /Gs /Oat /W3 /Zp /c $*.c
  106.     .asm.obj:
  107.         masm /t /ml $*.asm;
  108. describe compiling and assembling. /Gs allows the compiler to omit
  109. stack-checking code. /Oat is optimization, and is optional. /W3 is a warning
  110. level, and is optional. /Zp causes structures to be packed, and is optional
  111. (omitting it could cause the programs to use more memory). /c keeps the
  112. compiler from initiating a link for each module. /t causes MASM to use terse
  113. mode, and is optional. /ml causes MASM to maintain the case of names (don't
  114. automatically uppercase them), and is required.
  115.  
  116.  
  117. RUNNING THE PROGRAMS
  118. --------------------
  119.  
  120. All the programs except the postscript filter (PCBPSPLT) require command line
  121. arguments, and if you forget what they are, just execute the programs with no
  122. arguments. They will give a usage clause describing what arguments are needed.
  123.  
  124. For PCBRAT.EXE there is one argument: the input (circuit description)
  125. filename. By convention, this is a .PCB file. For PCBROUTE.EXE there are two
  126. arguments: the input (circuit description) filename, and the output (board
  127. description) filename. For PCBVIEW.EXE there is one argument: the input (board
  128. description) filename. For PCBPRINT.EXE there is one required argument, the
  129. input (board description) filename, and up to six optional arguments: /P
  130. indicates portrait mode (the circuit board is printed right-side up), /L
  131. indicates landscape mode (the circuit board is printed sideways), /Rn
  132. indicates laser printer resolution (n is 75, 100, 150, or 300 dots per inch),
  133. and /Zm indicates the zoom factor (m is 0, 1, 2, or 3). /H selects HP laserjet
  134. II output; it is the default, and causes the four switches above to be
  135. accepted. /V selects vector-oriented output; if it is given, no other switch
  136. is accepted. Vector-oriented output consists of DIMENSION, LINE, and CIRCLE
  137. statements; read the comments in PCBPRINT.C if you are trying to produce
  138. output for a postscript printer. They explain these statements. Refer to
  139. README.PS for how to use PCBPSPLT.EXE. For PCBPAK*.EXE there are two
  140. arguments: the name of the file to pack, and the name of the output file.
  141. For PCBUNPAK.EXE there are two arguments: the name of the file to unpack, and
  142. the name of the output file.
  143.  
  144.  
  145. INPUT FORMAT
  146. ------------
  147.  
  148. The file called EX1.PCB is an example input file. It defines (a) the
  149. dimensions of the circuit board, which are 29 rows and 37 columns (think of
  150. this as a matrix of cells), (b) a chip type (the 7486, which has 4 XOR gates),
  151. (c) holes where power and ground will be applied, (d) holes where the input
  152. will be applied, (e) the hole where the output will appear, (f) four instances
  153. of the 7486 chip, and (g) the pairs of pins that must be connected to complete
  154. the circuit. For a complete description of the input format, read the large
  155. block comment at the beginning of file IO.C.
  156.  
  157.  
  158. THE FILES
  159. ---------
  160.  
  161. MAKEFILE    -- describes how to compile, assemble, and link the programs
  162. BITMAP1.H    -- bitmaps for various cell types
  163. BITMAP2.H    -- more bitmaps
  164. BITMAP3.H    -- yet more bitmaps
  165. CELL.H        -- cell types and other global constants
  166. ALLOC.C        -- memory allocation routine
  167. BITMAP.C    -- bitmap data structure definitions
  168. BITMAP1.C    -- bitmap data structure definitions (holes only)
  169. BOARD.C        -- routines to initialize the board, and access cells
  170. DIST.C        -- distance calculation routine
  171. IO.C        -- input format processing routines
  172. LINE.C        -- routine to draw lines
  173. PCBPAK1.C    -- main routine for file packer (huffman)
  174. PCBPAK2.C    -- main routine for file packer (run-length)
  175. PCBPRINT.C    -- main routine for board printer
  176. PCBPSPLT.C    -- main routine for postscript filter
  177. PCBRAT.C    -- main routine for rat nester
  178. PCBROUTE.C    -- main routine for autorouter
  179. PCBUNPAK.C    -- main routine for file unpacker
  180. PCBVIEW.C    -- main routine for board viewer
  181. QUEUE.C        -- routines to manipulate the search queue
  182. SOLVE.C        -- main search routine (using the A* algorithm)
  183. WORK.C        -- routines to manipulate the work list
  184. PCBPAK1.EXE    -- compiled version of file packer (first kind)
  185. PCBPAK2.EXE    -- compiled version of file packer (second kind)
  186. PCBPRINT.EXE    -- compiled version of board printer
  187. PCBPSPLT.EXE    -- compiled version of postscript filter
  188. PCBRAT.EXE    -- compiled version of rat's nester
  189. PCBROUTE.EXE    -- compiled version of autorouter
  190. PCBUNPAK.EXE    -- compiled version of file unpacker
  191. PCBVIEW.EXE    -- compiled version of board viewer
  192. UTIL.ASM    -- assembly language graphics helpers
  193. ARTICLE        -- text of magazine article printed in Dr. Dobb's Journal,
  194.            September 1989.
  195. FIGURE.*    -- ascii representations of various figures
  196. ASTAR.C        -- C pseudocode for the A* search algorithm
  197. EX1.PCB        -- the example input file
  198. TTL74*.INC    -- ttl chip definition files. you may want to put all of them
  199.            in a subdirectory called TTL
  200. MANUAL        -- this file
  201. README.PS    -- descrition file for postscript filter
  202.  
  203.  
  204. AUTHOR
  205. ------
  206.  
  207. Randy Nevin, 1731 211th PL NE, Redmond, WA 98053, USA
  208.  
  209.  
  210. PCBPSPLT
  211. --------
  212.  
  213. Dave Schmidt has contributed a filter program to take the vector-oriented
  214. output of pcbprint.exe and translate it into postscript. It is called
  215. PCBPSPLT.EXE (PostScript PLoTter). See README.PS for directions on using it.
  216. The pertinent files are: PCBPSPLT.C, PCBPSPLT.PRO, PCBPSPLT.EPI, and
  217. README.PS.
  218.