/**CFile**************************************************************** FileName [fxuPrint.c] PackageName [MVSIS 2.0: Multi-valued logic synthesis system.] Synopsis [Various printing procedures.] Author [MVSIS Group] Affiliation [UC Berkeley] Date [Ver. 1.0. Started - February 1, 2003.] Revision [$Id: fxuPrint.c,v 1.0 2003/02/01 00:00:00 alanmi Exp $] ***********************************************************************/ #include "fxuInt.h" ABC_NAMESPACE_IMPL_START //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Fxu_MatrixPrint( FILE * pFile, Fxu_Matrix * p ) { Fxu_Var * pVar; Fxu_Cube * pCube; Fxu_Double * pDiv; Fxu_Single * pSingle; Fxu_Lit * pLit; Fxu_Pair * pPair; int i, LastNum; int fStdout; fStdout = 1; if ( pFile == NULL ) { pFile = fopen( "matrix.txt", "w" ); fStdout = 0; } fprintf( pFile, "Matrix has %d vars, %d cubes, %d literals, %d divisors.\n", p->lVars.nItems, p->lCubes.nItems, p->nEntries, p->nDivs ); fprintf( pFile, "Divisors selected so far: single = %d, double = %d.\n", p->nDivs1, p->nDivs2 ); fprintf( pFile, "\n" ); // print the numbers on top of the matrix for ( i = 0; i < 12; i++ ) fprintf( pFile, " " ); Fxu_MatrixForEachVariable( p, pVar ) fprintf( pFile, "%d", pVar->iVar % 10 ); fprintf( pFile, "\n" ); // print the rows Fxu_MatrixForEachCube( p, pCube ) { fprintf( pFile, "%4d", pCube->iCube ); fprintf( pFile, " " ); fprintf( pFile, "%4d", pCube->pVar->iVar ); fprintf( pFile, " " ); // print the literals LastNum = -1; Fxu_CubeForEachLiteral( pCube, pLit ) { for ( i = LastNum + 1; i < pLit->pVar->iVar; i++ ) fprintf( pFile, "." ); fprintf( pFile, "1" ); LastNum = i; } for ( i = LastNum + 1; i < p->lVars.nItems; i++ ) fprintf( pFile, "." ); fprintf( pFile, "\n" ); } fprintf( pFile, "\n" ); // print the double-cube divisors fprintf( pFile, "The double divisors are:\n" ); Fxu_MatrixForEachDouble( p, pDiv, i ) { fprintf( pFile, "Divisor #%3d (lit=%d,%d) (w=%2d): ", pDiv->Num, pDiv->lPairs.pHead->nLits1, pDiv->lPairs.pHead->nLits2, pDiv->Weight ); Fxu_DoubleForEachPair( pDiv, pPair ) fprintf( pFile, " <%d, %d> (b=%d)", pPair->pCube1->iCube, pPair->pCube2->iCube, pPair->nBase ); fprintf( pFile, "\n" ); } fprintf( pFile, "\n" ); // print the divisors associated with each cube fprintf( pFile, "The cubes are:\n" ); Fxu_MatrixForEachCube( p, pCube ) { fprintf( pFile, "Cube #%3d: ", pCube->iCube ); if ( pCube->pVar->ppPairs ) { Fxu_CubeForEachPair( pCube, pPair, i ) fprintf( pFile, " <%d %d> (d=%d) (b=%d)", pPair->iCube1, pPair->iCube2, pPair->pDiv->Num, pPair->nBase ); } fprintf( pFile, "\n" ); } fprintf( pFile, "\n" ); // print the single-cube divisors fprintf( pFile, "The single divisors are:\n" ); Fxu_MatrixForEachSingle( p, pSingle ) { fprintf( pFile, "Single-cube divisor #%5d: Var1 = %4d. Var2 = %4d. Weight = %2d\n", pSingle->Num, pSingle->pVar1->iVar, pSingle->pVar2->iVar, pSingle->Weight ); } fprintf( pFile, "\n" ); /* { int Index; fprintf( pFile, "Distribution of divisors in the hash table:\n" ); for ( Index = 0; Index < p->nTableSize; Index++ ) fprintf( pFile, " %d", p->pTable[Index].nItems ); fprintf( pFile, "\n" ); } */ if ( !fStdout ) fclose( pFile ); } /**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Fxu_MatrixPrintDivisorProfile( FILE * pFile, Fxu_Matrix * p ) { Fxu_Double * pDiv; int WeightMax; int * pProfile; int Counter1; // the number of -1 weight int CounterL; // the number of less than -1 weight int i; WeightMax = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble ); pProfile = ABC_ALLOC( int, (WeightMax + 1) ); memset( pProfile, 0, sizeof(int) * (WeightMax + 1) ); Counter1 = 0; CounterL = 0; Fxu_MatrixForEachDouble( p, pDiv, i ) { assert( pDiv->Weight <= WeightMax ); if ( pDiv->Weight == -1 ) Counter1++; else if ( pDiv->Weight < 0 ) CounterL++; else pProfile[ pDiv->Weight ]++; } fprintf( pFile, "The double divisors profile:\n" ); fprintf( pFile, "Weight < -1 divisors = %6d\n", CounterL ); fprintf( pFile, "Weight -1 divisors = %6d\n", Counter1 ); for ( i = 0; i <= WeightMax; i++ ) if ( pProfile[i] ) fprintf( pFile, "Weight %3d divisors = %6d\n", i, pProfile[i] ); fprintf( pFile, "End of divisor profile printout\n" ); ABC_FREE( pProfile ); } //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// ABC_NAMESPACE_IMPL_END ' href='#n62'>62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
/dts-v1/;

/include/ "rt3050.dtsi"

/ {
	compatible = "UR-336UN", "ralink,rt3052-soc";
	model = "UPVEL UR-336UN";

	pinctrl {
		state_default: pinctrl0 {
			gpio {
				ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
				ralink,function = "gpio";
			};
		};
	};

	cfi@1f000000 {
		compatible = "cfi-flash";
		reg = <0x1f000000 0x800000>;
		bank-width = <2>;
		device-width = <2>;
		#address-cells = <1>;
		#size-cells = <1>;
	};

	/* FIXME: no partitions defined */
/*	ethernet@10100000 {
		mtd-mac-address = <&factory 0x4004>;
	};
*/
	esw@10110000 {
		ralink,portmap = <0x2f>;
	};

	/* FIXME: no partitions defined */
/*	wmac@10180000 {
		ralink,mtd-eeprom = <&factory 0>;
	};
*/
	gpio-leds {
		compatible = "gpio-leds";

		3g {
			label = "ur-336un:green:3g";
			gpios = <&gpio0 9 1>;
		};

		gateway {
			label = "ur-336un:green:gateway";
			gpios = <&gpio0 11 1>;
		};

		ap {
			label = "ur-336un:green:ap";
			gpios = <&gpio0 12 1>;
		};

		wps {
			label = "ur-336un:green:wps";
			gpios = <&gpio0 14 1>;
		};

		station {
			label = "ur-336un:green:station";
			gpios = <&gpio0 13 1>;
		};
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		#address-cells = <1>;
		#size-cells = <0>;
		poll-interval = <20>;

		reset_wps {
			label = "reset_wps";
			gpios = <&gpio0 10 1>;
			linux,code = <0x198>;
		};

		mode {
			label = "mode";
			gpios = <&gpio0 7 1>;
			linux,code = <0x32>;
		};
	};

	otg@101c0000 {
		status = "okay";
	};
};