home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p078 / 3.img / NETFORMS.PLB / RACALRED.CF < prev    next >
Encoding:
Text File  |  1991-10-14  |  5.3 KB  |  252 lines

  1. /*
  2.     /2
  3.     /L Do not append sheet number to labels
  4.  */
  5.  
  6. /*  VERSION="1.10   14-OCT-91"
  7.  *      - Updated 'WriteNet' so it properly handles long lines
  8.  *      - Added Version message
  9.  *
  10.  *  Capacities:
  11.  *      - Part Names are not checked for length
  12.  *      - Module Names are not checked for length
  13.  *      - Reference Strings are not checked for length
  14.  *      - Node Names are not checked for length
  15.  *      - Node Numbers are limited to 5 digits (plus the leading 'N')
  16.  *      - Pin Numbers are not checked for length
  17.  *
  18.  *  Characters:
  19.  *      - All ASCII keyboard characters are legal
  20.  */
  21.  
  22. int sw_L;
  23.  
  24. int net_items;
  25. int len;
  26.  
  27. /*-----------------------*/
  28.  
  29. Initialize()
  30. {
  31.     WriteString(0, "Creating Netlist...");
  32.     WriteCrLf(0);
  33.  
  34.     AddSymbol("ReferenceStr");
  35.     SetNumberWidth(5);
  36.  
  37.     AddSymbol("Str");
  38.  
  39.     WriteString(1, ".PCB");
  40.     WriteCrLf(1);
  41.     WriteString(1, ".REM ");
  42.     CopySymbol(TitleString, Str);
  43.     PadSpaces(Str, 46);
  44.     WriteSymbol(1, Str);
  45.     WriteString(1, "Revised: ");
  46.     WriteSymbol(1, DateString);
  47.     WriteCrLf(1);
  48.     WriteString(1, ".REM ");
  49.     CopySymbol(DocumentNumber, Str);
  50.     PadSpaces(Str, 46);
  51.     WriteSymbol(1, Str);
  52.     WriteString(1, "Revision: ");
  53.     WriteSymbol(1, Revision);
  54.     WriteCrLf(1);
  55.     WriteString(1, ".REM ");
  56.     WriteSymbol(1, Organization);
  57.     WriteCrLf(1);
  58.     WriteString(1, ".REM ");
  59.     WriteSymbol(1, AddressLine1);
  60.     WriteCrLf(1);
  61.     WriteString(1, ".REM ");
  62.     WriteSymbol(1, AddressLine2);
  63.     WriteCrLf(1);
  64.     WriteString(1, ".REM ");
  65.     WriteSymbol(1, AddressLine3);
  66.     WriteCrLf(1);
  67.     WriteString(1, ".REM ");
  68.     WriteSymbol(1, AddressLine4);
  69.     WriteCrLf(1);
  70.     WriteString(1, ".CON");
  71.     WriteCrLf(1);
  72.     WriteString(1, ".COD 2");
  73.     WriteCrLf(1);
  74.     WriteCrLf(1);
  75.  
  76.     WriteString(2, ".PCB");
  77.     WriteCrLf(2);
  78.     WriteString(2, ".REM ");
  79.     CopySymbol(TitleString, Str);
  80.     PadSpaces(Str, 46);
  81.     WriteSymbol(2, Str);
  82.     WriteString(2, "Revised: ");
  83.     WriteSymbol(2, DateString);
  84.     WriteCrLf(2);
  85.     WriteString(2, ".REM ");
  86.     CopySymbol(DocumentNumber, Str);
  87.     PadSpaces(Str, 46);
  88.     WriteSymbol(2, Str);
  89.     WriteString(2, "Revision: ");
  90.     WriteSymbol(2, Revision);
  91.     WriteCrLf(2);
  92.     WriteString(2, ".REM ");
  93.     WriteSymbol(2, Organization);
  94.     WriteCrLf(2);
  95.     WriteString(2, ".REM ");
  96.     WriteSymbol(2, AddressLine1);
  97.     WriteCrLf(2);
  98.     WriteString(2, ".REM ");
  99.     WriteSymbol(2, AddressLine2);
  100.     WriteCrLf(2);
  101.     WriteString(2, ".REM ");
  102.     WriteSymbol(2, AddressLine3);
  103.     WriteCrLf(2);
  104.     WriteString(2, ".REM ");
  105.     WriteSymbol(2, AddressLine4);
  106.     WriteCrLf(2);
  107.     WriteString(2, ".REF");
  108.     WriteCrLf(2);
  109.     WriteCrLf(2);
  110.  
  111.     sw_L = SwitchIsSet("L");
  112. }
  113.  
  114. /*-----------------------*/
  115.  
  116. WriteHeader()
  117. {
  118.     while (LoadInstance())
  119.     {
  120.         WriteString(2, ".REM ");
  121.         WriteSymbol(2, PartName);
  122.         WriteCrLf(2);
  123.  
  124.         len = SymbolLength(ReferenceString);
  125.         if (len > 4)
  126.         {
  127.             WriteSymbol(2, ReferenceString);
  128.         }
  129.         else
  130.         {
  131.             CopySymbol(ReferenceString, ReferenceStr);
  132.             PadSpaces(ReferenceStr, 4);
  133.             WriteSymbol(2, ReferenceStr);
  134.         }
  135.         WriteString(2, " ");
  136.  
  137.         /* use the PartName if there is no ModuleName */
  138.         len = SymbolLength(ModuleName);
  139.         if (len > 0)
  140.         {
  141.             WriteSymbol(2, ModuleName);
  142.         }
  143.         else
  144.         {
  145.             WriteSymbol(2, PartName);
  146.         }
  147.  
  148.         WriteCrLf(2);
  149.     }
  150.     WriteString(2, ".EOD");
  151.     WriteCrLf(2);
  152. }
  153.  
  154. /*-----------------------*/
  155.  
  156. HandleNodeName()
  157. {
  158.     int i;
  159.  
  160.     net_items = 0;
  161.     WriteString(1, ".REM ");
  162.  
  163.     i = GetStandardSymbol(TypeCode);
  164.  
  165.     if (i == 'L')
  166.     {
  167.         SetNumberWidth(1);
  168.         if (sw_L == 0)
  169.         {
  170.             MakeLocalSignal("_");
  171.             WriteSymbol(1, LocalSignal);
  172.         }
  173.         else
  174.         {
  175.             WriteSymbol(1, SignalNameString);
  176.         }
  177.         
  178.         WriteString(1, " (local to sheet ");
  179.         WriteSymbol(1, SheetNumber);
  180.         WriteString(1, ")");
  181.         SetNumberWidth(5);
  182.     }
  183.     if (i == 'P')
  184.     {
  185.         WriteSymbol(1, SignalNameString);
  186.     }
  187.     if (i == 'S')
  188.     {
  189.         WriteSymbol(1, SignalNameString);
  190.     }
  191.     if (i == 'N')
  192.     {
  193.         WriteString(1, "N");
  194.         WriteSymbol(1, NetNumber);
  195.     }
  196.     if (i == 'U')
  197.     {
  198.         WriteString(1, "N");
  199.         WriteSymbol(1, NetNumber);
  200.     }
  201.     WriteCrLf(1);
  202. }
  203.  
  204. /*-----------------------*/
  205.  
  206. WriteNet()
  207. {
  208.     WriteSymbol(1, ReferenceString);
  209.     WriteString(1, " ");
  210.     WriteSymbol(1, PinNumberString);
  211.     WriteString(1, " ");
  212.  
  213.     net_items = net_items + 1;
  214.  
  215.     if (net_items == 8)
  216.     {
  217.         WriteCrLf(1);
  218.         WriteSymbol(1, ReferenceString);
  219.         WriteString(1, " ");
  220.         WriteSymbol(1, PinNumberString);
  221.         WriteString(1, " ");
  222.  
  223.         net_items = 1;
  224.     }
  225. }
  226.  
  227. /*-----------------------*/
  228.  
  229. WriteNetEnding()
  230. {
  231.     WriteCrLf(1);
  232. }
  233.  
  234. /*-----------------------*/
  235.  
  236. ProcessFieldStrings()
  237. {
  238. }
  239.  
  240. /*-----------------------*/
  241.  
  242. WriteNetListEnd()
  243. {
  244.     WriteString(1, ".EOD");
  245.     WriteCrLf(1);
  246.  
  247.     WriteString(0, "Done");
  248.     WriteCrLf(0);
  249. }
  250.  
  251.  
  252.