示例#1
0
outpin()
{

    INT net ;               /* counter */
    char filename[LRECL] ;  /* open this filename for writing */
    NETBOXPTR netptr ;      /* current net info */
    PINBOXPTR pinptr ;      /* current pin info */

    sprintf( filename, "%s.mpin", cktNameG ) ;
    fpS = TWOPEN( filename , "w", ABORT ) ;

    output_alreadyS = (BOOL *) Ysafe_calloc( numpinsG+1, sizeof(BOOL) ) ;
    output_typeS = NONE ;
    for( net = 1 ; net <= numnetsG ; net++ ) {
	netptr =  netarrayG[net] ;
	if( netptr->numpins <= 1 ){
	    /* no need to global route 1 pin nets */
	    continue ;
	}
	if( netptr->analog_info ){
	    process_analog_net( netptr ) ;
	    output_typeS |= ANALOG ;
	    continue ;
	}
	fprintf(fpS,"net %s\n", netptr->nname ) ;
	for( pinptr = netptr->pins ;pinptr;pinptr = pinptr->next ) {
	    output_pin( pinptr ) ;
	    output_typeS |= DIGITAL ;
	}
	fprintf( fpS,"\n" ) ;
    }
    output_matches() ;
    TWCLOSE(fpS);
    return ;
} /* end outpins */
示例#2
0
int main (int argc, char **argv)
{
	int nrow = DEFAULT_NROW,
	which_seq = 0,
	do_order = 0,
	misses_allowed = 0,
	output_mode = -1;
    float cutoff = DEFAULT_CUTOFF;
    char *strand = NULL,
	 *id = NULL;
    struct mafFile *file = NULL;
    struct mafAli *ali = NULL;
    struct mafComp *comp = NULL;
    struct MOTIF *motif = NULL;
    struct MATCH *matches = NULL;

    id = ckalloc (STRSIZE);
    get_args (argc, argv, &output_mode, &file, &id, &motif, &do_order, &nrow, &cutoff, &misses_allowed);
    strand = ckalloc (sizeof (char) * (nrow + 1));

    while (NULL != (ali = mafNext (file)))
    {
        for (comp = ali->components, which_seq = 0; comp; comp = comp->next, which_seq++)
            strand[which_seq] = comp->strand;
        strand[which_seq] = '\0';

	/* skip blocks that don't have all seqs in them */
 	if (which_seq != nrow)
	{
            mafAliFree (&ali);
	    continue;
	}

	/* forward strand */
	get_matches (&matches, FORWARD, ali, nrow, motif, do_order, misses_allowed);

	/* reverse strand */
        for (comp = ali->components; comp; comp = comp->next)
            do_revcomp((uchar *)comp->text, ali->textSize );

        get_matches (&matches, REVERSE, ali, nrow, motif, do_order, misses_allowed);

	/* output matches */
        if (matches)
            output_matches (matches, strand, id, nrow, motif);
        free_match_list (&matches);

        mafAliFree (&ali);
    }

    mafFileFree (&file);
    free (strand);
    free_motif_list (&motif);
    free (id);

    return 0;
}