/* 5 Row P1 Backplane NetList Rev. 13-MAY-1996 This is the source file for the program that makes the netlist file for the P1 5 Row backplane for the Run II Trigger Framework. This file produces the netlist for the 21 TE160 connectors and the 21 Ten-Point power connectors. The TE160 connectors are labeled J1 through J21 and the Ten-Point power connectors are labeled T1 through T21. */ #include #define MAXBUFF 500 #define MAXLINE 80 FILE *Get_Out_File( ) ; void setup_buf ( char character_buffer[] ) ; /* The following are the nets of the 21 Ten-Point Power Tap connectors */ /* These are in order connector T1 through T21, i.e. left to right */ /* viewed from the front. */ const char mm_array[21][10] = { {"GROUND "}, {"-12V "}, {"+5V "}, {"GROUND "}, {"+5V "}, {"GROUND "}, {"-4.5V "}, {"GROUND "}, {"+5V "}, {"GROUND "}, {"+5V_STDBY "}, {"GROUND "}, {"+5V "}, {"GROUND "}, {"-2V "}, {"GROUND "}, {"+5V "}, {"GROUND "}, {"+5V "}, {"+12V "}, {"GROUND "}, } ; /* The following are the nets of the 21 TE 160 5 row VME connectors */ /* These are in order connector pin A1 through pin E32, i.e. */ /* A1, A2, A3, A4, A5, B1, B2,... */ const char nn_array[160][10] = { {"TS_00_INV "}, {"TS_00_NINV"}, {"GROUND "}, {"TS_08_INV "}, {"TS_08_NINV"}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"TS_01_INV "}, {"TS_01_NINV"}, {"GROUND "}, {"TS_09_INV "}, {"TS_09_NINV"}, {"TS_02_INV "}, {"TS_02_NINV"}, {"GROUND "}, {"TS_10_INV "}, {"TS_10_NINV"}, {"TS_03_INV "}, {"TS_03_NINV"}, {"GROUND "}, {"TS_11_INV "}, {"TS_11_NINV"}, {"TS_04_INV "}, {"TS_04_NINV"}, {"GROUND "}, {"TS_12_INV "}, {"TS_12_NINV"}, {"TS_05_INV "}, {"TS_05_NINV"}, {"GROUND "}, {"TS_13_INV "}, {"TS_13_NINV"}, {"TS_06_INV "}, {"TS_06_NINV"}, {"GROUND "}, {"TS_14_INV "}, {"TS_14_NINV"}, {"TS_07_INV "}, {"TS_07_NINV"}, {"GROUND "}, {"TS_15_INV "}, {"TS_15_NINV"}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"DATA_00 "}, {"BBSY* "}, {"DATA_08 "}, {"DATA_01 "}, {"BCLR* "}, {"DATA_09 "}, {"DATA_02 "}, {"GROUND "}, {"ACFAIL* "}, {"GROUND "}, {"DATA_10 "}, {"DATA_03 "}, {"BG0IN* "}, {"DATA_11 "}, {"DATA_04 "}, {"BG0OUT* "}, {"DATA_12 "}, {"DATA_05 "}, {"BG1IN* "}, {"DATA_13 "}, {"DATA_06 "}, {"BG1OUT* "}, {"DATA_14 "}, {"DATA_07 "}, {"BG2IN* "}, {"DATA_15 "}, {"BG2OUT* "}, {"SYSCLK "}, {"BG3IN* "}, {"SYSFAIL* "}, {"BG3OUT* "}, {"BERR* "}, {"GROUND "}, {"DS1* "}, {"GROUND "}, {"BR0* "}, {"GROUND "}, {"SYSRESET* "}, {"GROUND "}, {"DS0* "}, {"BR1* "}, {"LWORD* "}, {"GROUND "}, {"WRITE* "}, {"GROUND "}, {"BR2* "}, {"GROUND "}, {"AM5 "}, {"BR3* "}, {"ADRS_23 "}, {"GROUND "}, {"DTACK* "}, {"GROUND "}, {"AM0 "}, {"ADRS_22 "}, {"AM1 "}, {"GROUND "}, {"AS* "}, {"GROUND "}, {"ADRS_21 "}, {"AM2 "}, {"ADRS_20 "}, {"AM3 "}, {"ADRS_19 "}, {"IACK* "}, {"ADRS_18 "}, {"IACKIN* "}, {"SERCLK "}, {"ADRS_17 "}, {"IACKOUT* "}, {"SERDAT* "}, {"ADRS_16 "}, {"AM4 "}, {"ADRS_15 "}, {"ADRS_07 "}, {"IRQ7* "}, {"ADRS_14 "}, {"ADRS_06 "}, {"IRQ6* "}, {"ADRS_13 "}, {"ADRS_05 "}, {"IRQ5* "}, {"ADRS_12 "}, {"ADRS_04 "}, {"IRQ4* "}, {"ADRS_11 "}, {"ADRS_03 "}, {"IRQ3* "}, {"ADRS_10 "}, {"ADRS_02 "}, {"IRQ2* "}, {"ADRS_09 "}, {"ADRS_01 "}, {"IRQ1* "}, {"ADRS_08 "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"GROUND "}, {"-2V "}, {"-12V "}, {"+5V_STDBY "}, {"+12V "}, {"-4.5V "}, {"-2V "}, {"+5V "}, {"+5V "}, {"+5V "}, {"-4.5V "}, } ; main () { char workbuf[MAXBUFF] ; char otherbuf[MAXBUFF] ; int row ; int outer_control, dig ; int temp_1 ; FILE *fpout ; printf(" \n") ; fpout = Get_Out_File( ) ; /* Get the output filename */ /* First loop over the 160 nets on the 21 TE 160 connectors */ fprintf(fpout, "#\n") ; fprintf(fpout, "#\n") ; fprintf(fpout, "# The following are the NetList entries \n") ; fprintf(fpout, "# from the 21 TE-160 DIN connectors. \n") ; fprintf(fpout, "#\n") ; fprintf(fpout, "#\n") ; for ( outer_control = 0; outer_control < 160; ++outer_control ) { fprintf(fpout, "#\n") ; dig = ( (outer_control) / 5 ) + 1 ; temp_1 = outer_control % 5 ; if (temp_1 == 0) row = 'A' ; else if (temp_1 == 1) row = 'B' ; else if (temp_1 == 2) row = 'C' ; else if (temp_1 == 3) row = 'D' ; else if (temp_1 == 4) row = 'E' ; setup_buf(workbuf) ; /* Setup the line work buffer. */ workbuf[5] = nn_array[outer_control][0] ; workbuf[6] = nn_array[outer_control][1] ; workbuf[7] = nn_array[outer_control][2] ; workbuf[8] = nn_array[outer_control][3] ; workbuf[9] = nn_array[outer_control][4] ; workbuf[10] = nn_array[outer_control][5] ; workbuf[11] = nn_array[outer_control][6] ; workbuf[12] = nn_array[outer_control][7] ; workbuf[13] = nn_array[outer_control][8] ; workbuf[14] = nn_array[outer_control][9] ; if ( workbuf[6] == ' ' ) workbuf[6] = '\'' ; else if ( workbuf[7] == ' ' ) workbuf[7] = '\'' ; else if ( workbuf[8] == ' ' ) workbuf[8] = '\'' ; else if ( workbuf[9] == ' ' ) workbuf[9] = '\'' ; else if ( workbuf[10] == ' ' ) workbuf[10] = '\'' ; else if ( workbuf[11] == ' ' ) workbuf[11] = '\'' ; else if ( workbuf[12] == ' ' ) workbuf[12] = '\'' ; else if ( workbuf[13] == ' ' ) workbuf[13] = '\'' ; else if ( workbuf[14] == ' ' ) workbuf[14] = '\'' ; else workbuf[15] = '\'' ; fputs(workbuf, fpout) ; fprintf(fpout, " J1-%c%d J2-%c%d J3-%c%d J4-%c%d J5-%c%d J6-%c%d J7-%c%d\n", row, dig, row, dig, row, dig, row, dig, row, dig, row, dig, row, dig ); fputs(workbuf, fpout) ; fprintf(fpout, " J8-%c%d J9-%c%d J10-%c%d J11-%c%d J12-%c%d J13-%c%d J14-%c%d\n", row, dig, row, dig, row, dig, row, dig, row, dig, row, dig, row, dig ); fputs(workbuf, fpout) ; fprintf(fpout, " J15-%c%d J16-%c%d J17-%c%d J18-%c%d J19-%c%d J20-%c%d J21-%c%d\n", row, dig, row, dig, row, dig, row, dig, row, dig, row, dig, row, dig ); fprintf(fpout, "#\n") ; } /* Now write out the the connections to the power and ground nets from the 21 Ten-Point connections. */ fprintf(fpout, "#\n") ; fprintf(fpout, "#\n") ; fprintf(fpout, "# The following are the NetList entries from \n") ; fprintf(fpout, "# the 21 Ten-Point Power Tap connectors. \n") ; fprintf(fpout, "#\n") ; fprintf(fpout, "#\n") ; for ( outer_control = 0; outer_control < 21; ++outer_control ) { dig = outer_control + 1 ; fprintf(fpout, "#\n") ; setup_buf(workbuf) ; /* Setup the line work buffer. */ workbuf[5] = mm_array[outer_control][0] ; workbuf[6] = mm_array[outer_control][1] ; workbuf[7] = mm_array[outer_control][2] ; workbuf[8] = mm_array[outer_control][3] ; workbuf[9] = mm_array[outer_control][4] ; workbuf[10] = mm_array[outer_control][5] ; workbuf[11] = mm_array[outer_control][6] ; workbuf[12] = mm_array[outer_control][7] ; workbuf[13] = mm_array[outer_control][8] ; workbuf[14] = mm_array[outer_control][9] ; if ( workbuf[6] == ' ' ) workbuf[6] = '\'' ; else if ( workbuf[7] == ' ' ) workbuf[7] = '\'' ; else if ( workbuf[8] == ' ' ) workbuf[8] = '\'' ; else if ( workbuf[9] == ' ' ) workbuf[9] = '\'' ; else if ( workbuf[10] == ' ' ) workbuf[10] = '\'' ; else if ( workbuf[11] == ' ' ) workbuf[11] = '\'' ; else if ( workbuf[12] == ' ' ) workbuf[12] = '\'' ; else if ( workbuf[13] == ' ' ) workbuf[13] = '\'' ; else if ( workbuf[14] == ' ' ) workbuf[14] = '\'' ; else workbuf[15] = '\'' ; fputs(workbuf, fpout) ; fprintf(fpout, " T%d-1 T%d-2 T%d-3 T%d-4 T%d-5\n", dig, dig, dig, dig, dig ) ; fputs(workbuf, fpout) ; fprintf(fpout, " T%d-6 T%d-7 T%d-8 T%d-9 T%d-10\n", dig, dig, dig, dig, dig ) ; } fprintf(fpout, "#\n") ; fprintf(fpout, "#\n") ; /* All the work is done so just close the output file and exit */ fclose(fpout) ; } /* The following are the FUNCTIONS called by the above program */ FILE *Get_Out_File( ) { char filename[MAXLINE] ; FILE *fpout_loc ; printf("Enter the filename for the net list: "); gets(filename); if ((fpout_loc = fopen(filename, "w", "rat=cr", "rfm=var")) == NULL) { printf("\nERROR: Can't open output file %s\n", filename); exit (1); } return(fpout_loc) ; } /* This is the setup_buf function. It is used to set all elements of the workbuf array to '\0'. Then it writes NET ' into the first elements of the array. Note that because the arguments passed to this function is the name of the array, this function works on the actual array, not on a temporary local copies of the array. */ void setup_buf( char linebuf[] ) { int local_index = 0 ; while (local_index < MAXLINE) { linebuf[local_index] = '\0' ; ++local_index ; } linebuf[0] = 'N' ; linebuf[1] = 'E' ; linebuf[2] = 'T' ; linebuf[3] = ' ' ; linebuf[4] = '\'' ; } /* GROUND -12V +5V GROUND +5V GROUND -4.5V GROUND +5V GROUND +5V STDBY GROUND +5V GROUND -2V GROUND +5V GROUND +5V +12V GROUND GROUND -2V -12V +5V_STDBY +12V -4.5V -2V +5V +5V +5V -4.5V */