Esempio n. 1
0
/* print out the current cost to the user */
void prnt_cost( char * out_string ) 
{
    INT xspan ;
    INT yspan ;

    funccostG = findcost() ;
    OUT2("%s", out_string ) ;
    OUT2("   routing cost        :%d\n", funccostG ) ;
    OUT2("   overlap penalty     :%d\n", binpenalG);
    OUT2("   lapFactor * overlap :%d\n", penaltyG);
    OUT2("   timing penalty      :%d\n", timingpenalG );
    OUT2("+  timeFactor * timepen:%d\n", timingcostG );
    OUT1("-------------------------------------\n" ) ; 
    OUT2("   total cost          :%d\n",
	(funccostG + penaltyG + timingcostG) ) ;
    wirecosts() ;

    find_core_boundary( &blocklG, &blockrG, &blockbG, &blocktG ) ;
    OUT5("\n\nCORE Bounding Box: l:%d r:%d b:%d t:%d\n",
	    blocklG , blockrG , blockbG , blocktG ) ;
    xspan = blockrG - blocklG ;
    yspan = blocktG - blockbG ;
    OUT2( "   xspan     = %d\n", xspan ) ;
    OUT2( "   yspan     = %d\n", yspan ) ;
    OUT2( "   core area = %4.2le\n\n",  (DOUBLE) xspan * (DOUBLE) yspan );
    OUT1("-------------------------------------\n" ) ; 
    Ymessage_flush() ;

}/* end print_current_cost */
Esempio n. 2
0
/*
 * ��גמה םא ‎ךנאם ןונגמדמ ןףםךעא  לום‏
 */
void print_level3_menu() {
  ClearDisplay();
  OUT1( blokirovka );
  if ( settingsState.stateword.a0 == 1 ) {
    OUT2( "[���.] ����." );
  }
  else {
    OUT2( "���. [����.]" );
  }

}
Esempio n. 3
0
void postWrite(hotCtx g)
	{
	postCtx h = g->ctx.post;

	OUT4(h->tbl.version);
	OUT4(h->tbl.italicAngle);
	OUT2(h->tbl.underlinePosition);
	OUT2(h->tbl.underlineThickness);
	OUT4(h->tbl.isFixedPitch);
	OUT4(h->tbl.minMemType42);
	OUT4(h->tbl.maxMemType42);
	OUT4(h->tbl.minMemType1);
	OUT4(h->tbl.maxMemType1);
	}
Esempio n. 4
0
void
metafont_start_output (string output_name, bzr_preamble_type pre, 
		       tfm_global_info_type info)
{
  unsigned this_param;
  string current_time = now ();

  mf_filename = make_output_filename (output_name, "mf");
  mf_file = xfopen (mf_filename, "w");

  /* Output some identification.  */
  OUT1 ("%% This file defines the Metafont font %s.\n", mf_filename);
  OUT1 ("%% {%s}\n", BZR_COMMENT (pre));
  OUT1 ("%% Generated %s.\n", current_time);
  OUT_LINE ("% This font is in the public domain.");
  
  /* Output the size that our original data is based on.  The font can
     be generated at sizes different than this.  */
  OUT_PT_ASSIGNMENT ("true_design_size#", BZR_DESIGN_SIZE (pre));
  
  /* Output the fontwide information given in INFO.  */
  OUT1 ("font_coding_scheme := \"%s\";\n", TFM_CODING_SCHEME (info));
  
  /* The real work is done in an auxiliary file.  */
  OUT_STATEMENT ("input bzrsetup");

  for (this_param = 1; this_param <= TFM_FONT_PARAMETER_COUNT (info);
       this_param++)
    OUT2 ("fontdimen %u: %.2fpt# * u#;\n", this_param,
          TFM_FONT_PARAMETER (info, this_param)); 
}
Esempio n. 5
0
void vmtxWrite(hotCtx g) {
	long i;
	vmtxCtx h = g->ctx.vmtx;

	/* Write vertical metrics */
	for (i = 0; i < h->tbl.vMetrics.cnt; i++) {
		LongVerMetrics *metric = &h->tbl.vMetrics.array[i];
		OUT2(metric->advanceHeight);
		OUT2(metric->tsb);
	}

	/* Write top sidebearings */
	for (i = 0; i < h->tbl.topSideBearing.cnt; i++) {
		OUT2(h->tbl.topSideBearing.array[i]);
	}
}
Esempio n. 6
0
static void
output_ligtable (tfm_char_type *tfm_chars)
{
  unsigned code;
  
  for (code = 0; code <= MAX_CHARCODE; code++)
    {
      list_type kern_list, ligature_list;
      unsigned this_kern, this_lig;
      tfm_char_type c = tfm_chars[code];
      boolean output_something = false;
      
      /* If this character didn't get output, or if we don't have TFM
         information for it, don't do anything.  */
      if (NO_CHAR_P (code))
        continue;
      
      /* Output the kerns.  */
      kern_list = c.kern;
      for (this_kern = 0; this_kern < LIST_SIZE (kern_list); this_kern++)
        {
          tfm_kern_type *kern = LIST_ELT (kern_list, this_kern);

          if (NO_CHAR_P (kern->character))
            continue;

          LIGTABLE_ENTRY (code);
          OUT2 ("hex\"%x\" kern %.4fpt#", kern->character, kern->kern);
        }
      
      /* Output the ligatures.  */
      ligature_list = c.ligature;
      for (this_lig = 0; this_lig < LIST_SIZE (ligature_list); this_lig++)
        {
          tfm_ligature_type *lig = LIST_ELT (ligature_list, this_lig);

          if (NO_CHAR_P (lig->character) || NO_CHAR_P (lig->ligature))
            continue;

	  LIGTABLE_ENTRY (code);
          OUT2 ("hex\"%x\" =: hex\"%x\"", lig->character, lig->ligature);
        }

      if (output_something)
        OUT_LINE (";");
    }
}
Esempio n. 7
0
static void writeLigCaretTable(hotCtx g, GDEFCtx h)
	{
	int i;
	OUT2(h->ligCaretTable.Coverage);
	OUT2(h->ligCaretTable.LigGlyphCount);
	for (i = 0; i< h->ligCaretEntries.cnt; i++)
		{
		LigGlyphEntry *lge = &h->ligCaretEntries.array[i];
		OUT2(lge->offset);
		}
	for (i = 0; i< h->ligCaretEntries.cnt; i++)
		{
		unsigned int j;
		LigGlyphEntry *lge = &h->ligCaretEntries.array[i];
		OUT2(lge->CaretCount);
		/* write offsets */
		for (j = 0; j< lge->CaretCount; j++)
			{
			OUT2(lge->caretTables.array[j].offset);
			}
		/* then write caret tables for this lge */
		for (j = 0; j< lge->CaretCount; j++)
			{
			CaretTable* ct = &lge->caretTables.array[j];
			OUT2(ct->format);
			OUT2(ct->CaretValue);
			}
		}
	otlCoverageWrite( g, h->ligCaretTable.otl);
	}
Esempio n. 8
0
/**************************************************************
        Инициализация дисплея  
        void InitDisplay(void)
***************************************************************/
void InitDisplay(void)
{
  InitDataPortsOut();
  
  RES_out;
  E_WR_out;
  K_out;
  RES_0;
  RD_WR_out;
  K_0;
  
  FunctionSet(1,1,0);
  ClearDisplay();
  EntryModeSet(1,0);
  DisplayONOFControlBit(1,0,0);
  ClearDisplay();
  CursorOrDisplayShift(0,1);  
  OUT1("ПРОШИВКА");
  OUT2("ЗАПУЩЕНА...");
  
  /*
  SetDDRAMAddress(0x00);//В начало первой строки
  WriteDataToRam('0');
  WriteDataToRam('1');
  WriteDataToRam('2');
  WriteDataToRam('3');
  WriteDataToRam('4');
  WriteDataToRam('5');
  WriteDataToRam('6');
  WriteDataToRam('7');
  WriteDataToRam('8');
  WriteDataToRam('9');
  WriteDataToRam('A');
  WriteDataToRam('B');
  WriteDataToRam('C');
  WriteDataToRam('D');
  WriteDataToRam('E');
  WriteDataToRam('F');
  SetDDRAMAddress(0x40);//В начало второй строки
  WriteDataToRam('0');
  WriteDataToRam('1');
  WriteDataToRam('2');
  WriteDataToRam('3');
  WriteDataToRam('4');
  WriteDataToRam('5');
  WriteDataToRam('6');
  WriteDataToRam('7');
  WriteDataToRam('8');
  WriteDataToRam('9');
  WriteDataToRam('A');
  WriteDataToRam('B');
  WriteDataToRam('C');
  WriteDataToRam('D');
  WriteDataToRam('E');
  WriteDataToRam('F');*/
}
Esempio n. 9
0
/* Write encodings */
void encodingWrite(tcCtx g)
	{
	encodingCtx h = g->ctx.encoding;
	int i;

	/* Write non-standard encodings */
	for (i = 0; i < h->encodings.cnt; i++)
		{
		int j;
		Encoding *encoding = &h->encodings.array[i];

		OUT1(encoding->format);
		switch (encoding->format & 0x7f)
			{
		case 0:
			/* Write format 0 */
			OUT1(encoding->nCodes);
			for (j = 0; j < encoding->nCodes; j++)
				OUT1(encoding->code[j]);
			break;
		case 1:
			{
			/* Write format 1 */
			unsigned nLeft = 0;

			OUT1(encoding->nRanges);
			OUT1(encoding->code[0]);
			for (j = 1; j < encoding->nCodes; j++)
				if (encoding->code[j - 1] + 1 != encoding->code[j] || 
					nLeft == 255)
					{
					OUT1(nLeft);
					OUT1(encoding->code[j]);
					nLeft = 0;
					}
				else
					nLeft++;
			OUT1(nLeft);
			}
			break;
			}
		if (encoding->format & 0x80)
			{
			OUT1(encoding->nSups);
			for (j = 0; j < encoding->nSups; j++)
				{
				CodeMap *supplement = &encoding->supplement[j];
				OUT1(supplement->code);
				OUT2(supplement->sid);
				}
			}
		}

	reuseInit(g, h);
	}
Esempio n. 10
0
static void writeMarkSetClassTable(hotCtx g, GDEFCtx h)
	{
	int i;
	OUT2(h->markSetClassTable.MarkSetTableFormat);
	OUT2(h->markSetClassTable.MarkSetCount);
	
	/* first write the offsets to the coverage tables */
	for (i = 0; i < h->markSetClassTable.markSetEntries.cnt; i++)
		{
		MarkSetEntry* markSetEntry = dnaINDEX(h->markSetClassTable.markSetEntries, i);
		OUT4(markSetEntry->MarkSetCoverage);
		}

	/* Now write the coverage tables */
	for (i = 0; i < h->markSetClassTable.markSetEntries.cnt; i++)
		{
		MarkSetEntry* markSetEntry = dnaINDEX(h->markSetClassTable.markSetEntries, i);
		otlCoverageWrite( g, markSetEntry->otl);
		}
	}
Esempio n. 11
0
void MMFXWrite(hotCtx g)
	{
	MMFXCtx h = g->ctx.MMFX;
	int i;

	/* Write header */
	OUT4(h->tbl.version);
	OUT2(h->tbl.nMetrics);
	OUT2(h->tbl.offSize);

	/* Write offset array */
	if (h->tbl.offSize == 2)
		for (i = 0; i < h->tbl.nMetrics; i++)
			OUT2((short)h->tbl.offset[i]);
	else
		for (i = 0; i < h->tbl.nMetrics; i++)
			OUT4(h->tbl.offset[i]);

	/* Write charstring data */
	OUTN(h->cstrs.cnt, h->cstrs.array);
	}
Esempio n. 12
0
static void writeAttachTable(hotCtx g, GDEFCtx h)
	{
	int i;
	OUT2(h->attachTable.Coverage);
	OUT2(h->attachTable.GlyphCount);
	for (i = 0; i< h->attachEntries.cnt; i++)
		{
		AttachEntry *apt = &h->attachEntries.array[i];
		OUT2(apt->offset);
		}
	for (i = 0; i< h->attachEntries.cnt; i++)
		{
		unsigned int j;
		AttachEntry *apt = &h->attachEntries.array[i];
		OUT2(apt->PointCount);
		for (j = 0; j< apt->PointCount; j++)
			{
			OUT2(apt->contourIndices.array[j]);
			}
		}
	otlCoverageWrite( g, h->attachTable.otl);
	}
Esempio n. 13
0
void wilson_dslash_spproj(double *out0, double *out1, double *out2, double *out3, 
			  double *inf, double sign)
{
  int c;

  for(c=0;c<3;c++){

    /* spin project with [1 + sign * gamma_0] */
    OUT0(0,c,0) = INF(0,c,0) + sign * ( -INF(1,c,3) ); 
    OUT0(1,c,0) = INF(1,c,0) + sign * (  INF(0,c,3) ); 
    
    OUT0(0,c,1) = INF(0,c,1) + sign * ( -INF(1,c,2) ); 
    OUT0(1,c,1) = INF(1,c,1) + sign * (  INF(0,c,2) ); 
    
    /* spin project with [1 + sign * gamma_1] */
    OUT1(0,c,0) = INF(0,c,0) + sign * ( -INF(0,c,3) ); 
    OUT1(1,c,0) = INF(1,c,0) + sign * ( -INF(1,c,3) ); 
    
    OUT1(0,c,1) = INF(0,c,1) + sign * (  INF(0,c,2) ); 
    OUT1(1,c,1) = INF(1,c,1) + sign * (  INF(1,c,2) ); 
    
    /* spin project with [1 + sign * gamma_2] */
    OUT2(0,c,0) = INF(0,c,0) + sign * ( -INF(1,c,2) ); 
    OUT2(1,c,0) = INF(1,c,0) + sign * (  INF(0,c,2) ); 
    
    OUT2(0,c,1) = INF(0,c,1) + sign * (  INF(1,c,3) ); 
    OUT2(1,c,1) = INF(1,c,1) + sign * ( -INF(0,c,3) ); 
    
    /* spin project with [1 + sign * gamma_3] */
    OUT3(0,c,0) = INF(0,c,0) + sign * (  INF(0,c,2) ); 
    OUT3(1,c,0) = INF(1,c,0) + sign * (  INF(1,c,2) ); 
    
    OUT3(0,c,1) = INF(0,c,1) + sign * (  INF(0,c,3) ); 
    OUT3(1,c,1) = INF(1,c,1) + sign * (  INF(1,c,3) ); 
  }

}
Esempio n. 14
0
void GDEFWrite(hotCtx g)
	{
	GDEFCtx h = g->ctx.GDEF;

	/* Perform checksum adjustment */
	OUT4(h->tbl.version);
	OUT2(h->tbl.GlyphClassDefOffset);
	OUT2(h->tbl.AttachTableOffset);
	OUT2(h->tbl.LigCaretTableOffset);
	OUT2(h->tbl.MarkClassDefOffset);
	if (h->tbl.MarkGlyphSetsDefOffset) /* If this is zero, then we write a Verion 1,0 table, whcih doesn't have this offset. */
		OUT2(h->tbl.MarkGlyphSetsDefOffset);
	
	if (h->tbl.GlyphClassDefOffset)
		otlClassWrite(g, h->glyphClassTable);
	if ((h->tbl.AttachTableOffset))
		writeAttachTable(g,h);
	if ((h->tbl.LigCaretTableOffset))
		writeLigCaretTable(g,h);
	if (h->tbl.MarkClassDefOffset)
		otlClassWrite(g, h->markAttachClassTable);
	if (h->tbl.MarkGlyphSetsDefOffset)
		writeMarkSetClassTable(g, h);
	}
Esempio n. 15
0
void
ps_output_encoding (FILE *f)
{
  unsigned c;
  int range_start = -1;

  fprintf (f, "/Encoding %d array\n", ENCODING_VECTOR_SIZE);

  for (c = 0; c < ENCODING_VECTOR_SIZE; c++)
    { /* Write sequences of .notdef's and characters we didn't output
         using a loop.  */
      if (!ps_char_output_p[c]
	  || STREQ (ENCODING_CHAR_NAME (encoding, c), ".notdef"))
	{ /* Start or continue a loop.  */
	  if (range_start == -1)
            range_start = c;
	}
      else
	{ /* Finish a loop if one is started, then output the current
             character.  */
          if (range_start != -1)
            { /* Loop started, finish it.  */
              out_notdef_loop (f, range_start, c - 1);
              range_start = -1;
            }
          
          /* Output the current character.  */
          OUT2 ("  dup %d /%s put\n", c, ENCODING_CHAR_NAME (encoding, c));
	}
    }
  
  /* If the encoding ends with .notdef's, we'll be in the midst of a
     loop. */
  if (range_start != -1)
    out_notdef_loop (f, range_start, c - 1);
  
  /* Define it.  */
  OUT_LINE ("  readonly def");
}
Esempio n. 16
0
/*
 * ��גמה םא ‎ךנאם pos םמלונ ןףםךעא לום‏
 */
void print_level3_text_menu_by_position(unsigned char pos) {
  ClearDisplay();
  switch (pos) {
    case 1:
      OUT1( blokirovka );
      if ( settingsState.stateword.a0 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 2:
      OUT1( product );
      if ( settingsState.stateword.a1 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 3:
      OUT1( sirena );
      if ( settingsState.stateword.a2 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 4:
      OUT1( naladka );
      if ( settingsState.stateword.a3 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 5:
      OUT1( dozator );
      if ( settingsState.stateword.a4 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 6:
      OUT1( vverh );
      if ( settingsState.stateword.a5 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 7:
      OUT1( vakuum );
      if ( settingsState.stateword.a6 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 8:
      OUT1( obduv );
      if ( settingsState.stateword.a7 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 9:
      OUT1( transporter );
      if ( settingsState.stateword.a8 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 10:
      OUT1( prijim_pop );
      if ( settingsState.stateword.a9 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 11:
      OUT1( prijim_prod );
      if ( settingsState.stateword.a10 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 12:
      OUT1( nagrev_pop );
      if ( settingsState.stateword.a11 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
    case 13:
      OUT1( nagrev_prod );
      if ( settingsState.stateword.a12 == 1 ) {
        OUT2( "[���.] ����." );
      }
      else {
        OUT2( "���. [����.]" );
      }
      break;
  }
}
Esempio n. 17
0
void config2(INT numbinX, INT numbinY, DOUBLE wire_red_ratio )
{

    INT inst ;                      /* counter */
    INT numinst ;                   /* number of cell instances */
    INT l, r, b, t, cell, tempint, side, soft_count ;
    CELLBOXPTR cellptr ;
    TILEBOXPTR tileptr ;
    DOUBLE totalArea, temp ;
    DOUBLE temp1, fraction ;
    INSTBOXPTR instptr ;


    /*
     *   Sum the areas of the cells over all instances
     */
    totalArea = 0.0 ;
    for( cell = 1 ; cell <= numcellsG ; cell++ ) {
	cellptr = cellarrayG[cell] ;
	/* look at all the instances */
	if( instptr = cellptr->instptr ){
	    numinst = instptr->numinstances ;
	} else {
	    numinst = 1 ;
	}
	for( inst = 0 ; inst < numinst; inst++ ){
	    if( instptr ){
		tileptr = instptr->tile_inst[inst] ;
	    } else {
		tileptr = cellptr->tiles ;
	    }
	    for( ; tileptr ; tileptr = tileptr->next ) {
		l = tileptr->left   ;
		r = tileptr->right  ;
		b = tileptr->bottom ;
		t = tileptr->top    ;
		totalArea += (DOUBLE) (r - l) * (t - b) ;
	    }
	}
    }

    temp = avg_funcG / wire_red_ratio ;
    totNetLenG = (INT) temp ;
    /* calculate number of softiles */
    soft_count=0 ;
    for( cell = 1; cell <= numcellsG ; cell++ ) {
	if( cellarrayG[cell]->softflag == 1 ) {
	    soft_count++ ;
	}
    }
    fraction = (DOUBLE) soft_count / (DOUBLE) numcellsG ;
    temp1 = (DOUBLE) (totNetLenG) / 
		(1.0 + (fraction / (sqrt( (DOUBLE) numcellsG )))) ;
    totNetLenG = (INT) temp1 ;

    if( coreGivenG == 0 ) {
	blockrG = blocktG = (INT) sqrt( totalArea ) ;
	totChanLenG = perimG / 2 - (blockrG + blocktG) ;
	temp = ((DOUBLE) totNetLenG / (DOUBLE) totChanLenG) /
		    ((DOUBLE) layersFactorG) ; 
    } else {
	r = t = (INT) sqrt( totalArea ) ;
	totChanLenG = perimG / 2 - (r + t) ;
	temp = ((DOUBLE) totNetLenG / (DOUBLE) totChanLenG) /
		    ((DOUBLE) layersFactorG) ; 
    }

    side = (INT)(sqrt(((DOUBLE) totalArea) / (DOUBLE) numcellsG))  ;
    OUT2("\n\nAVERAGE CELL SIDE WITHOUT ROUTING AREA: %d\n\n",side );

    tempint = (INT)( temp ) + 3 ; /* d+1 tracks + roundoff */
    tempint += defaultTracksG ;
    tempint *= (track_spacingXG + track_spacingYG) / 2 ;

    aveChanWidG = ( (DOUBLE) tempint / 1.8) + 2.0 ;

    OUT2("\n\nConfiguration Data\nInternal Channel Length:%d\n",
							    totChanLenG ) ;
    OUT2("Average Channel Width (un-normalized):%f\n\n", temp ) ;
    OUT2("Average Channel Width:%f\n\n", aveChanWidG ) ;

    reconfigure( numbinX, numbinY, (DOUBLE) totalArea ) ;

    return ;
}
Esempio n. 18
0
void hheaWrite(hotCtx g)
	{
	hheaCtx h = g->ctx.hhea;

	OUT4(h->tbl.version);
	OUT2(h->tbl.ascender);
	OUT2(h->tbl.descender);
	OUT2(h->tbl.lineGap);
	OUT2(h->tbl.advanceWidthMax);
	OUT2(h->tbl.minLeftSideBearing);
	OUT2(h->tbl.minRightSideBearing);
	OUT2(h->tbl.xMaxExtent);
	OUT2(h->tbl.caretSlopeRise);
	OUT2(h->tbl.caretSlopeRun);
	OUT2(h->tbl.caretOffset);
	OUT2(h->tbl.reserved[0]);
	OUT2(h->tbl.reserved[1]);
	OUT2(h->tbl.reserved[2]);
	OUT2(h->tbl.reserved[3]);
	OUT2(h->tbl.metricDataFormat);
	OUT2(h->tbl.numberOfLongHorMetrics);
	}
Esempio n. 19
0
/* Write CID font dicts */
static void writeCIDDicts(tcCtx g, Font *font) {
    OffSize offSize;
    unsigned count;
    Offset offset;
    int i;
    long sizeFDs;

    /* Only output fd's which contained a character. */
    /* The FDSelect which is written syncs with this. See cidAddChars. */
    count = 0;
    sizeFDs = 0;
    for (i = 0; i < font->fdCount; i++) {
        FDInfo *info = &font->fdInfo[i];
        if (info->seenChar) {
            sizeFDs += info->FD.cnt;
            count++;
        }
    }

    /* Font dict index */
    OUT2(count);
    offSize = INDEX_OFF_SIZE(sizeFDs);
    OUT1(offSize);
    offset = 1;
    OUTOFF(offSize, offset);
    for (i = 0; i < font->fdCount; i++) {
        FDInfo *info = &font->fdInfo[i];
        if (info->seenChar) {
            offset += info->FD.cnt;
            OUTOFF(offSize, offset);
        }
    }
    for (i = 0; i < font->fdCount; i++) {
        FDInfo *info = &font->fdInfo[i];
        if (info->seenChar) {
            OUTN(info->FD.cnt, info->FD.array);
        }
    }

    /* Private dicts */
    for (i = 0; i < font->fdCount; i++) {
        FDInfo *info = &font->fdInfo[i];
        if (info->seenChar) {
            OUTN(info->Private.cnt, info->Private.array);
        }
    }

#if TC_SUBR_SUPPORT
    /* Subrs */
    for (i = 0; i < font->fdCount; i++) {
        FDInfo *info = &font->fdInfo[i];
        if (info->seenChar && info->size.Subrs != 0) {
            subrWriteLocal(g, &info->subrs);
        }
    }
#endif /* TC_SUBR_SUPPORT */

#if 0
    for (i = 0; i < font->fdCount; i++) {
        printf("--- FD/PD[%d]\n", i);
        dictDump(g, &font->fdInfo[i].FD);
        dictDump(g, &font->fdInfo[i].Private);
    }
#endif
}
Esempio n. 20
0
/* perform a low temperature anneal on pins */
final_pin_place()
{

    INT i ;               /* counter */
    INT attempts ;        /* number of moves made */
    INT nummoves ;        /* number of moves to do on a cell */
    INT selection ;       /* select a cell with softpins */
    INT nsoftpin_cells ;  /* number of cells with softpins */
    CELLBOXPTR acellptr;  /* current cell with softpins */

    /* don't perform if cost only is specified in input file */
    /* scale data variable is necessary for recursive TimberWolfMC call */
    if( /* cost_onlyG || */ scale_dataG > 1 ){
	return ;
    }

    /* now check to see if we have any soft pins if not return */
    if( (nsoftpin_cells = (int) softPinArrayG[HOWMANY] ) == 0 ){
	return ;
    }

    /* make new site arrays for pins */
    for( i = 1; i <= nsoftpin_cells; i++ ){
	update_sites( softPinArrayG[i] ) ;
    }
    findcost() ;

    /* continue with a low Temp anneal */
    TG = 10.0 ;
    attempts = 0 ;
    if( overpenalG ){  
	/* make pinFactor 1 order more important than wirelength */
	pinFactorG =  10.0 * (DOUBLE) funccostG / (DOUBLE) overpenalG ;
	/* also set softPinArrayG to look at cells with overlap */
    } else {
	/* otherwise use previous pinFactorG */
	/* make 1 order more important */
	pinFactorG *= 10.0 ;
    }

    while( attempts < attmaxG ) {

	/* to make pin moves more efficient, use softPinArrayG */
	/* which keeps track of all softcells which have pins */
	/* which can move. softPinArrayG[0] holds size of array */
	selection = PICK_INT( 1, (int) softPinArrayG[HOWMANY] );
	/* now get cellptr */
	acellptr = softPinArrayG[selection] ;
	/* pick number of pins moves to be attempted */
	/* PIN_MOVE is beginning of sequence.  */
	if( overpenalG && !(doPartitionG) ){  
	    /* if a penalty exists do many moves */
	    nummoves = acellptr->numsoftpins ;
	} else {
	    nummoves = 1 ; /* no penalty try to reduce wirelen */
	}

	/* *********** NOW EVALUATE THE PROPOSED MOVE ********* */
	/* now try softpin moves */
	for( i=1; i<= nummoves; i++ ){
	    selectpin( acellptr ) ;
	}
	/* *********** END OF PROPOSED MOVE  EVALUATION ********* */
	attempts++ ;

	D( "finalpin", checkcost() ) ; /* if debug on check cost after each move */

    } /* ****** END OF ANNEALING LOOP **************** */

    /* verify incremental and current costs after each iteration */
    D( "finalpin", checkcost() ) ;

    /* ----------------------------------------------------------------- 
       now output statistics for this temperature.
    */

    OUT1("\n\nPin place optimizer\n");
    OUT1("\nI     T     funccost  overpen  x pinFact = overfill pinflips\n");
    OUT2("%3d ",iterationG ); 
    OUT2("%4.2le ",TG ); 
    OUT2("%4.2le ",(DOUBLE) funccostG ); 
    OUT2("%4.2le ",(DOUBLE) overpenalG ); 
    OUT2("%4.2le ",(DOUBLE) pinFactorG ); 
    OUT2("%4.2le ",(DOUBLE) overfillG ); 
    OUT3("%3d/%3d\n\n",flippG,attpG ); 
    FLUSHOUT() ;

    return ;
} /* end final_pin_place */
Esempio n. 21
0
/* Write font set file */
static void writeSet(tcCtx g) {
    tcprivCtx h = g->ctx.tcpriv;
    int i;
    int nSynthetics;
    Offset offset;
    struct {
        char header[1024];
        char trailer[128];
    } wrap;

    if (h->FontSet.name != NULL) {
        /* Create wrappers */
        fillWrapHeader(g, wrap.header);
        fillWrapTrailer(g, wrap.trailer);
        h->FontSet.size += strlen(wrap.header) + strlen(wrap.trailer);
    }

    if (g->cb.cffSize != NULL) {
        /* Report FontSet size to client */
        g->cb.cffSize(g->cb.ctx, h->FontSet.size,
                      (g->status & TC_EURO_ADDED) != 0);
    }

    if (h->FontSet.name != NULL) {
        OUTN(strlen(wrap.header), wrap.header);
    }

    /* Write header */
    OUT1(h->cffHdr.major);
    OUT1(h->cffHdr.minor);
    OUT1(h->cffHdr.hdrSize);
    OUT1(h->cffHdr.offSize);

    /* Write name index */
    OUT2(h->nameHdr.count);
    OUT1(h->nameHdr.offSize);
    offset = 1;
    OUTOFF(h->nameHdr.offSize, offset);
    for (i = 0; i < h->set.cnt; i++) {
        offset += h->set.array[i].size.FontName;
        OUTOFF(h->nameHdr.offSize, offset);
    }
    for (i = 0; i < h->set.cnt; i++) {
        OUTN(h->set.array[i].size.FontName, h->set.array[i].FontName);
    }

    /* Write top dict index */
    OUT2(h->dictHdr.count);
    OUT1(h->dictHdr.offSize);
    offset = 1;
    OUTOFF(h->dictHdr.offSize, offset);
    for (i = 0; i < h->set.cnt; i++) {
        offset += h->set.array[i].size.dict;
        OUTOFF(h->dictHdr.offSize, offset);
    }
    for (i = 0; i < h->set.cnt; i++) {
        OUTN(h->set.array[i].dict.cnt, h->set.array[i].dict.array);
    }

#if 0
    for (i = 0; i < h->set.cnt; i++) {
        dictDump(g, &h->set.array[i].dict);
    }
#endif

    sindexWrite(g);     /* Write string table */
    subrWriteGlobal(g); /* Write global subrs */

    /* Write charsets, encodings, and fdIndexes */
    encodingWrite(g);
    charsetWrite(g);
    fdselectWrite(g);

    /* Write remainder of font data */
    nSynthetics = 0;
    for (i = 0; i < h->set.cnt; i++) {
        Font *font = &h->set.array[i];

        if (font->flags & FONT_SYNTHETIC) {
            nSynthetics++;
        } else if (font->flags & FONT_CHAMELEON) {
            OUTN(font->size.Private, font->chameleon.data);
        } else {
            DICT *Private = &font->Private;

            csWriteChars(g, font); /* Write CharsStrings */
            if (font->flags & FONT_CID) {
                /* Write font and Private dict indexes */
                writeCIDDicts(g, font);
            } else {
                /* Write Private dict */
                OUTN(Private->cnt, Private->array);
            }
#if TC_SUBR_SUPPORT
            subrWriteLocal(g, &font->subrs); /* Write Subrs */
#endif                                       /* TC_SUBR_SUPPORT */
        }
    }

    /* Write legal text */
    if (h->copyright != NULL) {
        OUTN(strlen(h->copyright), h->copyright);
    } else if (g->flags & TC_NONOTICE && h->set.cnt > 1) {
        tcWarning(g, "no copyright notice specified");
    }

    if (h->FontSet.name != NULL) {
        OUTN(strlen(wrap.trailer), wrap.trailer);
    }

#if TC_STATISTICS
    if (g->stats.gather) {
        showStats(h);
    } else {
        fprintf(stderr,
                "Created: %s (fonts=%ld+%d=%ld, size=%ld, %ld/font)\n",
                (g->cb.cffId == NULL) ? "?" : g->cb.cffId(g->cb.ctx),
                h->set.cnt - nSynthetics, nSynthetics,
                h->set.cnt, h->FontSet.size, h->FontSet.size / h->set.cnt);
    }
#endif /* TC_STATISTICS */
}
Esempio n. 22
0
void
metafont_output_char (bzr_char_type c)
{
  unsigned this_list;
  spline_list_array_type shape = BZR_SHAPE (c);
  
  int offset = CHAR_LSB (c);

  fprintf (mf_file, "\nbeginchar (%d, %.2fu#, %.2fu#, %.2fu#);\n", 
           CHARCODE (c), CHAR_SET_WIDTH (c), CHAR_HEIGHT (c), CHAR_DEPTH (c));

  /* Go through the list of splines once, assigning the control points
     to Metafont variables.  This allows us to produce more information
     on proofsheets.  */
  for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape);
       this_list++)
    {
      unsigned this_spline;
      spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list);

      OUT_ZASSIGNMENT (INDENT "z%u\\%us", this_list, 0,
                       START_POINT (SPLINE_LIST_ELT (list, 0))); 

      for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list);
           this_spline++) 
        {
          spline_type s = SPLINE_LIST_ELT (list, this_spline);

          if (SPLINE_DEGREE (s) == CUBIC)
            {
              OUT_ZASSIGNMENT (INDENT "z%u\\%uc1", this_list, this_spline,
                               CONTROL1 (s)); 
              OUT_ZASSIGNMENT (INDENT "z%u\\%uc2", this_list, this_spline,
                               CONTROL2 (s)); 
            }

          /* The last point in the list is also the first point, and we
             don't want to output two variables for the same point.  */
          if (this_spline < SPLINE_LIST_LENGTH (list) - 1)
            OUT_ZASSIGNMENT (INDENT "z%u\\%u", this_list, this_spline,
                             END_POINT (s));
        }
    }


  /* Go through the list of splines again, outputting the
     path-construction commands.  */

  for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape);
       this_list++)
    {
      unsigned this_spline;
      spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list);

      OUT2 (INDENT "fill_or_unfill z%u\\%us\n", this_list, 0);

      for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list);
           this_spline++)
        {
          spline_type s = SPLINE_LIST_ELT (list, this_spline);

          if (SPLINE_DEGREE (s) == LINEAR)
            OUT_STRING (INDENT INDENT "--");
          else
            {
              OUT_STRING (INDENT INDENT "..controls ");
              OUT2 ("z%u\\%uc1 and ", this_list, this_spline);
              OUT2 ("z%u\\%uc2..", this_list, this_spline);
            }
	  
          if (this_spline < SPLINE_LIST_LENGTH (list) - 1)
            OUT2 ("z%u\\%u\n", this_list, this_spline);
        }
        
      OUT_STRING ("cycle;\n");
    }
  
  /* The plain Metafont `labels' command makes it possible to produce
     proofsheets with all the points labeled.  We always want labels for
     the starting and ending points, and possibly labels for the control
     points on each spline, so we have our own
     command `proof_labels', defined in `bzrsetup.mf'.  */
  OUT_LINE (INDENT "proof_labels (");
  for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape);
       this_list++)
    {
      unsigned this_spline;
      spline_list_type list = SPLINE_LIST_ARRAY_ELT (shape, this_list);

      for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list);
           this_spline++)
        OUT2 (INDENT INDENT "%u\\%u,\n", this_list, this_spline);
    }
  OUT_STRING (");\n");

  OUT_STATEMENT ("endchar");
  mf_char_output_p[CHARCODE (c)] = true;
}
Esempio n. 23
0
static inline int
NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *addr, int len)
{
  int *ctrl = &((struct NCR5380_hostdata *)instance->hostdata)->ctrl;
  int oldctrl = *ctrl;
  unsigned long *laddr;
#ifdef NOT_EFFICIENT
  int iobase = instance->io_port;
  int dma_io = iobase & ~(0x3C0000>>2);
#else
  volatile unsigned char *iobase = (unsigned char *)ioaddr(instance->io_port);
  volatile unsigned char *dma_io = (unsigned char *)((int)iobase & ~0x3C0000);
#endif

  if(!len) return 0;

  CTRL(iobase, 0x02);
  laddr = (unsigned long *)addr;
  while(len >= 32)
  {
    int status;
    unsigned long v;
    status = STAT(iobase);
    if(status & 0x80)
      goto end;
    if(!(status & 0x40))
      continue;
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    v=*laddr++; OUT2(L(v),dma_io); OUT2(H(v),dma_io);
    len -= 32;
    if(len == 0)
      break;
  }

  addr = (unsigned char *)laddr;
  CTRL(iobase, 0x12);
  while(len > 0)
  {
    int status;
    status = STAT(iobase);
    if(status & 0x80)
      goto end;
    if(status & 0x40)
    {
      OUT(*addr++, dma_io);
      if(--len == 0)
        break;
    }

    status = STAT(iobase);
    if(status & 0x80)
      goto end;
    if(status & 0x40)
    {
      OUT(*addr++, dma_io);
      if(--len == 0)
        break;
    }
  }
end:
  CTRL(iobase, oldctrl|0x40);
  return len;
}
Esempio n. 24
0
void maxpWrite(hotCtx g) {
    maxpCtx h = g->ctx.maxp;

    OUT4(h->tbl.version);
    OUT2(h->tbl.numGlyphs);
}
Esempio n. 25
0
void MMSDWrite(hotCtx g) {
    int i;
    MMSDCtx h = g->ctx.MMSD;

    /* Write header */
    OUT4(h->tbl.version);
    OUT2(h->tbl.flags);
    OUT2(h->tbl.axis);
    OUT2(h->tbl.instance);
    OUT2(h->tbl.style);

    /* Write axis table */
    OUT2(h->tbl.axis_.nAxes);
    OUT2(h->tbl.axis_.axisSize);
    for (i = 0; i < h->tbl.axis_.nAxes; i++) {
        AxisRec *axis = &h->tbl.axis_.axis_[i];
        OUT2(axis->longLabel);
        OUT2(axis->shortLabel);
    }

    if (h->tbl.instance != 0) {
        /* Write instance table */
        OUT2(h->tbl.instance_.nInstances);
        OUT2(h->tbl.instance_.instanceSize);
        for (i = 0; i < h->tbl.instance_.nInstances; i++) {
            OUT2(h->tbl.instance_.instance_[i].nameSuffix);
        }
    }

    if (h->tbl.style != 0) {
        /* Write style table */
        OUT2(h->tbl.style_.nStyles);
        OUT2(h->tbl.style_.styleSize);
        for (i = 0; i < h->tbl.style_.nStyles; i++) {
            StyleRec *style = &h->tbl.style_.style_[i];
            OUT1(style->axis);
            OUT1(style->flags);
            OUT4(style->action[0].point);
            OUT4(style->action[0].delta);
            OUT4(style->action[1].point);
            OUT4(style->action[1].delta);
        }
    }

    /* Write string table */
    for (i = 0; i < h->tbl.axis_.nAxes; i++) {
        AxisRec *axis = &h->tbl.axis_.axis_[i];
        hotWritePString(g, axis->longLabel_);
        hotWritePString(g, axis->shortLabel_);
    }
    if (h->tbl.instance != 0) {
        for (i = 0; i < h->tbl.instance_.nInstances; i++) {
            hotWritePString(g, h->tbl.instance_.instance_[i].nameSuffix_);
        }
    }
}
Esempio n. 26
0
void wirecosts()
{

NETBOXPTR dimptr ;
PINBOXPTR pinptr ;

INT limitNets, withPads , withOutPads ;
INT x , y , xmin , xmax , ymin , ymax , net ;
INT cell, celltype, bbox ;

withPads = 0 ;
withOutPads = 0 ;
limitNets = 0 ;

for( net = 1 ; net <= numnetsG ; net++ ) {
    dimptr =  netarrayG[net] ;

    xmin = 0 ;
    xmax = 0 ;
    ymin = 0 ;
    ymax = 0 ;
    for( pinptr = dimptr->pins ;pinptr;pinptr = pinptr->next ) {
	cell = pinptr->cell ;
	celltype = cellarrayG[cell]->celltype ;
	if( celltype == PADCELLTYPE || celltype == PADGROUPTYPE ){
	    continue ;
	}
	xmin = xmax = pinptr->xpos ;
	ymin = ymax = pinptr->ypos ;
	pinptr = pinptr->next ;
	break ;
    }
    for( ; pinptr ; pinptr = pinptr->next ) {
	cell = pinptr->cell ;
	celltype = cellarrayG[cell]->celltype ;
	if( celltype == PADCELLTYPE || celltype == PADGROUPTYPE ){
	    continue ;
	}
	x = pinptr->xpos ;
	y = pinptr->ypos ;

	if( x < xmin ) {
	    xmin = x ;
	} else if( x > xmax ) {
	    xmax = x ;
	}
	if( y < ymin ) {
	    ymin = y ;
	} else if( y > ymax ) {
	    ymax = y ;
	}
    }
    withOutPads += (xmax - xmin) + (ymax - ymin) ;

    dimptr =  netarrayG[net] ;
    pinptr = dimptr->pins ;
    xmin = 0 ;
    xmax = 0 ;
    ymin = 0 ;
    ymax = 0 ;
    if( pinptr ) {
	xmin = xmax = pinptr->xpos ;
	ymin = ymax = pinptr->ypos ;
	pinptr = pinptr->next ;
    }
    for( ; pinptr ; pinptr = pinptr->next ) {
	x = pinptr->xpos ;
	y = pinptr->ypos ;

	if( x < xmin ) {
	    xmin = x ;
	} else if( x > xmax ) {
	    xmax = x ;
	}
	if( y < ymin ) {
	    ymin = y ;
	} else if( y > ymax ) {
	    ymax = y ;
	}
    }
    withPads += bbox = (xmax - xmin) + (ymax - ymin) ;

    if(!(dimptr->skip)){
	limitNets += bbox ;
    }
}
OUT1("Wirelength:\n") ;
OUT2("\tAll nets             :%d\n", withPads ) ;
OUT2("\tLimited nets         :%d\n", limitNets ) ;
OUT2("\tAll nets without pads:%d\n", withOutPads ) ;
return ;

}
Esempio n. 27
0
DOUBLE analyze()
{

INT **number , i , net , net1 , net2 , num , cell ;
INT *count , different , cnum , c2num , *arraynet ;
INT num_nets , tot_cels ;
DOUBLE C , C1 , C2 , C3 , wireRatio ;
PINBOXPTR pinptr ;
INT comparex() ;
DOUBLE weight_past_runs( /* wireRatio */ ) ;

count  = (INT *) Ysafe_malloc( (1 + numcellsG) * sizeof( INT ) ) ;
number = (INT **) Ysafe_malloc( (1 + numnetsG) * sizeof( INT *) ) ;
howmanyS = (INT *) Ysafe_malloc( (1 + numnetsG) * sizeof( INT ) ) ;
arraynet = (INT *) Ysafe_malloc( (1 + numnetsG) * sizeof( INT ) ) ;
for( net = 0 ; net <= numnetsG ; net++ ) {
    number[net] = (INT *) Ysafe_malloc( (1 + numcellsG) * sizeof(INT) ) ;
}

for( net = 1 ; net <= numnetsG ; net++ ) {
    for( cell = 0 ; cell <= numcellsG ; cell++ ) {
	count[cell] = 0 ;
	number[net][cell] = 0 ;
    }
    for( pinptr=netarrayG[net]->pins;pinptr; pinptr = pinptr->next ){
	if( pinptr->cell <= numcellsG ) {
	    count[pinptr->cell] = 1 ;
	}
    }
    /*
     *  I would like to find the number of distinct nets
     */
    for( cell = 1 ; cell <= numcellsG ; cell++ ) { 
	if( count[cell] == 1 ) {
	    number[net][ ++number[net][0] ] = cell ;
	}
    }
}
/* ********************************************************** */
num_nets = 0 ;
tot_cels = 0 ;
for( net1 = 1 ; net1 <= numnetsG ; net1++ ) {
    if( number[net1][0] <= 1 ) {
	continue ;
    }
    num_nets++ ;
    tot_cels += number[net1][0] ;
}


OUT1("\n\n*************************************\n");
OUT2("AVERAGE NUMBER OF CELLS PER NET: %f\n",
		( (DOUBLE) tot_cels / (DOUBLE) num_nets	)  ) ;
OUT1("*************************************\n\n\n");
/* ********************************************************** */
for( net1 = 1 ; net1 <= numnetsG ; net1++ ) {
    if( number[net1][0] == 0 ) {
	howmanyS[net1] = 0 ;
	continue ;
    }
    if( number[net1][0] == 1 ) {
	number[net1][0] = 0 ;
	howmanyS[net1] = 0 ;
	continue ;
    }
    howmanyS[net1] = 1 ;
    for( net2 = net1 + 1 ; net2 <= numnetsG ; net2++ ) {
	if( number[net2][0] != number[net1][0] ) {
	    continue ;
	}
	different = 0 ;
	for( i = 1 ; i <= numcellsG ; i++ ) {
	    if( number[net2][i] != number[net1][i] ) {
		different = 1 ;
		break ;
	    }
	}
	if( ! different ) {
	    number[net2][0] = 0 ;
	    howmanyS[net1]++ ;
	}
    }
}

arraynet[0] = 0 ;
for( net = 1 ; net <= numnetsG ; net++ ) {
    if( howmanyS[net] <= 0 ) {
	continue ;
    }
    arraynet[ ++arraynet[0] ] = net ;
}
num = arraynet[0] ;
arraynet[0] = arraynet[ arraynet[0] ] ;
Yquicksort( (char *) arraynet ,  num , sizeof( INT ), comparex  ) ;
/*  sorted: most occurrences first  */

num = 0 ;
cnum = 0 ;
c2num = 0 ;
for( net = 1 ; net <= numnetsG ; net++ ) {
    if( number[net][0] > 0 ) {
	cnum += number[net][0] - 1 ;
	c2num += number[net][0] ;
	num++ ;
    }
}

C = (DOUBLE) num / (DOUBLE) numcellsG ;
C1 = (DOUBLE) cnum / (DOUBLE) num ;
C2 = (DOUBLE) c2num / (DOUBLE) num ;
C3 = (DOUBLE) cnum / (DOUBLE)(numcellsG - 1) ;
OUT1("\n\n\n**********************************************\n\n");
OUT1("The average number of distinct nets per cell is\n");
OUT2("given by: %6.2f\n\n", C );
OUT1("The average number of cells per net is\n");
OUT2("given by: %6.2f\n\n", C2 );
OUT1("The average number of other cells per net is\n");
OUT2("given by: %6.2f\n\n", C1 );
OUT1("The ratio of total cells specified per net to\n");
OUT2("numcells is given by: %6.2f\n\n", C3 );
OUT1("The average number of cells connected to a cell is\n");
OUT2("given by: %6.2f\n\n", C * C1 );
OUT1("**********************************************\n\n\n");
wireRatio = EXPECTEDWIRERATIO ;

OUT2("Expected Wire Reduction Relative to Random:%6.2f\n\n",wireRatio);
FLUSHOUT();

wireRatio = weight_past_runs( wireRatio ) ;
sprintf( YmsgG,"\n\nWire ratio updated to:%4.2f\n\n", wireRatio ) ;
M( MSG, "analyze", YmsgG ) ;

return( wireRatio );
}
Esempio n. 28
0
static void
out_notdef_loop (FILE *f, charcode_type start, charcode_type end)
{
  /* Assume the Encoding array is the top of the operand stack.  */
  OUT2 ("  %d 1 %d { 1 index exch /.notdef put } bind for\n", start, end);
}
Esempio n. 29
0
void MPEGaudio::computebuffer(REAL *fraction,REAL buffer[2][CALCBUFFERSIZE])
{
	REAL p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,pa,pb,pc,pd,pe,pf;
	REAL q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,qa,qb,qc,qd,qe,qf;
	REAL *out1,*out2;

	out1=buffer[currentcalcbuffer]+calcbufferoffset;
	out2=buffer[currentcalcbuffer^1]+calcbufferoffset;
#define OUT1(v,t) out1[(32-(v))*16]  =(-(out1[(v)*16]=t))
#define OUT2(v)  out2[(96-(v)-32)*16]=out2[((v)-32)*16]

	// compute new values via a fast cosine transform:
	{
		register REAL *x=fraction;
		p0=x[ 0]+x[31];p1=x[ 1]+x[30];p2=x[ 2]+x[29];p3=x[ 3]+x[28];
		p4=x[ 4]+x[27];p5=x[ 5]+x[26];p6=x[ 6]+x[25];p7=x[ 7]+x[24];
		p8=x[ 8]+x[23];p9=x[ 9]+x[22];pa=x[10]+x[21];pb=x[11]+x[20];
		pc=x[12]+x[19];pd=x[13]+x[18];pe=x[14]+x[17];pf=x[15]+x[16];
	}
	//
	q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
	q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
	q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
	qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
	qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
	qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);

	p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
	p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
	p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
	p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
	pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
	pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);

	q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
	q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
	q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
	qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);

	p0=q0+q1;p1=hcos_4*(q0-q1);p2=q2+q3;p3=hcos_4*(q2-q3);
	p4=q4+q5;p5=hcos_4*(q4-q5);p6=q6+q7;p7=hcos_4*(q6-q7);
	p8=q8+q9;p9=hcos_4*(q8-q9);pa=qa+qb;pb=hcos_4*(qa-qb);
	pc=qc+qd;pd=hcos_4*(qc-qd);pe=qe+qf;pf=hcos_4*(qe-qf);
	//
	{
		register REAL tmp;
		tmp=p6+p7;
		OUT2(36)=-(p5+tmp);
		OUT2(44)=-(p4+tmp);
		tmp=pb+pf;
		OUT1(10,tmp);
		OUT1(6,pd+tmp);
		tmp=pe+pf;
		OUT2(46)=-(p8+pc+tmp);
		OUT2(34)=-(p9+pd+tmp);
		tmp+=pa+pb;
		OUT2(38)=-(pd+tmp);
		OUT2(42)=-(pc+tmp);
		OUT1(2,p9+pd+pf);
		OUT1(4,p5+p7);
		OUT2(48)=-p0;
		out2[0]=-(out1[0]=p1);
		OUT1( 8,p3);
		OUT1(12,p7);
		OUT1(14,pf);
		OUT2(40)=-(p2+p3);
	}
	{
		register REAL *x=fraction;
		p0=hcos_64[ 0]*(x[ 0]-x[31]);p1=hcos_64[ 1]*(x[ 1]-x[30]);
		p2=hcos_64[ 2]*(x[ 2]-x[29]);p3=hcos_64[ 3]*(x[ 3]-x[28]);
		p4=hcos_64[ 4]*(x[ 4]-x[27]);p5=hcos_64[ 5]*(x[ 5]-x[26]);
		p6=hcos_64[ 6]*(x[ 6]-x[25]);p7=hcos_64[ 7]*(x[ 7]-x[24]);
		p8=hcos_64[ 8]*(x[ 8]-x[23]);p9=hcos_64[ 9]*(x[ 9]-x[22]);
		pa=hcos_64[10]*(x[10]-x[21]);pb=hcos_64[11]*(x[11]-x[20]);
		pc=hcos_64[12]*(x[12]-x[19]);pd=hcos_64[13]*(x[13]-x[18]);
		pe=hcos_64[14]*(x[14]-x[17]);pf=hcos_64[15]*(x[15]-x[16]);
	}

	q0=p0+pf;q1=p1+pe;q2=p2+pd;q3=p3+pc;
	q4=p4+pb;q5=p5+pa;q6=p6+p9;q7=p7+p8;
	q8=hcos_32[0]*(p0-pf);q9=hcos_32[1]*(p1-pe);
	qa=hcos_32[2]*(p2-pd);qb=hcos_32[3]*(p3-pc);
	qc=hcos_32[4]*(p4-pb);qd=hcos_32[5]*(p5-pa);
	qe=hcos_32[6]*(p6-p9);qf=hcos_32[7]*(p7-p8);

	p0=q0+q7;p1=q1+q6;p2=q2+q5;p3=q3+q4;
	p4=hcos_16[0]*(q0-q7);p5=hcos_16[1]*(q1-q6);
	p6=hcos_16[2]*(q2-q5);p7=hcos_16[3]*(q3-q4);
	p8=q8+qf;p9=q9+qe;pa=qa+qd;pb=qb+qc;
	pc=hcos_16[0]*(q8-qf);pd=hcos_16[1]*(q9-qe);
	pe=hcos_16[2]*(qa-qd);pf=hcos_16[3]*(qb-qc);

	q0=p0+p3;q1=p1+p2;q2=hcos_8[0]*(p0-p3);q3=hcos_8[1]*(p1-p2);
	q4=p4+p7;q5=p5+p6;q6=hcos_8[0]*(p4-p7);q7=hcos_8[1]*(p5-p6);
	q8=p8+pb;q9=p9+pa;qa=hcos_8[0]*(p8-pb);qb=hcos_8[1]*(p9-pa);
	qc=pc+pf;qd=pd+pe;qe=hcos_8[0]*(pc-pf);qf=hcos_8[1]*(pd-pe);

	p0=q0+q1;p1=hcos_4*(q0-q1);
	p2=q2+q3;p3=hcos_4*(q2-q3);
	p4=q4+q5;p5=hcos_4*(q4-q5);
	p6=q6+q7;p7=hcos_4*(q6-q7);
	p8=q8+q9;p9=hcos_4*(q8-q9);
	pa=qa+qb;pb=hcos_4*(qa-qb);
	pc=qc+qd;pd=hcos_4*(qc-qd);
	pe=qe+qf;pf=hcos_4*(qe-qf);

	{
		REAL tmp;
		tmp=pd+pf;
		OUT1(5,p5+p7+pb+tmp);
		tmp+=p9;
		OUT1(1,p1+tmp);
		OUT2(33)=-(p1+pe+tmp);
		tmp+=p5+p7;
		OUT1(3,tmp);
		OUT2(35)=-(p6+pe+tmp);
		tmp=pa+pb+pc+pd+pe+pf;
		OUT2(39)=-(p2+p3+tmp-pc);
		OUT2(43)=-(p4+p6+p7+tmp-pd);
		OUT2(37)=-(p5+p6+p7+tmp-pc);
		OUT2(41)=-(p2+p3+tmp-pd);
		tmp=p8+pc+pe+pf;
		OUT2(47)=-(p0+tmp);
		OUT2(45)=-(p4+p6+p7+tmp);
		tmp=pb+pf;
		OUT1(11,p7+tmp);
		tmp+=p3;
		OUT1( 9,tmp);
		OUT1( 7,pd+tmp);
		OUT1(13,p7+pf);
		OUT1(15,pf);
	}
}