📄 fttriv.c
字号:
/**CFile**************************************************************** FileName [ftTriv.c] PackageName [MVSIS 2.0: Multi-valued logic synthesis system.] Synopsis [Trivial case of factoring.] Author [MVSIS Group] Affiliation [UC Berkeley] Date [Ver. 1.0. Started - February 1, 2003.] Revision [$Id: ftTriv.c,v 1.2 2003/05/27 23:14:49 alanmi Exp $]***********************************************************************/#include "ft.h"/////////////////////////////////////////////////////////////////////////// DECLARATIONS ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// FUNCTION DEFITIONS ////////////////////////////////////////////////////////////////////////////**Function************************************************************* Synopsis [Factoring the cover, which has no algebraic divisors.] Description [] SideEffects [] SeeAlso []***********************************************************************/Ft_Node_t * Ft_FactorTrivial( Ft_Tree_t * pTree, Mvc_Cover_t * pCover ){ Ft_Node_t * pNode; Mvc_Cube_t * pCube; // iterate through the cubes pNode = NULL; Mvc_CoverForEachCube( pCover, pCube ) { if ( pNode == NULL ) pNode = Ft_FactorTrivialCube( pTree, pCover, pCube ); else pNode = Ft_TreeNodeCreate( pTree, FT_NODE_OR, pNode, Ft_FactorTrivialCube( pTree, pCover, pCube ) ); } assert( pNode ); // if this assertion fails, the input cover is not SCC-free return pNode;}/**Function************************************************************* Synopsis [Factoring the cube.] Description [] SideEffects [] SeeAlso []***********************************************************************/Ft_Node_t * Ft_FactorTrivialCube( Ft_Tree_t * pTree, Mvc_Cover_t * pCover, Mvc_Cube_t * pCube ){ Ft_Node_t * pNode; int iLit, Value; // iterate through the literals pNode = NULL; Mvc_CubeForEachLiteral( pCover, pCube, iLit, Value ) { if ( Value ) { if ( pNode == NULL ) pNode = Ft_FactorTrivialNode( pTree, iLit ); else pNode = Ft_TreeNodeCreate( pTree, FT_NODE_AND, pNode, Ft_FactorTrivialNode( pTree, iLit ) ); } } assert( pNode ); // if this assertion fails, the input cover is not SCC-free return pNode;}/**Function************************************************************* Synopsis [Factoring the cube.] Description [] SideEffects [] SeeAlso []***********************************************************************/Ft_Node_t * Ft_FactorTrivialNode( Ft_Tree_t * pTree, int iLit ){ Vm_VarMap_t * pVm; int * pValuesFirst, * pValues; int nValuesIn, nVarsIn; Ft_Node_t * pNode; int iVar; pVm = pTree->pVm; pValues = Vm_VarMapReadValuesArray(pVm); pValuesFirst = Vm_VarMapReadValuesFirstArray(pVm); nValuesIn = Vm_VarMapReadValuesInNum(pVm); nVarsIn = Vm_VarMapReadVarsInNum(pVm); assert( iLit < nValuesIn ); for ( iVar = 0; iVar < nVarsIn; iVar++ ) if ( iLit < pValuesFirst[iVar] + pValues[iVar] ) break; assert( iVar < nVarsIn ); pNode = Ft_TreeNodeCreate( pTree, FT_NODE_LEAF, NULL, NULL ); pNode->VarNum = iVar; pNode->nValues = pValues[iVar]; pNode->uData = FT_MV_MASK(pNode->nValues) ^ (1 << (iLit - pValuesFirst[iVar])); return pNode;}/////////////////////////////////////////////////////////////////////////// END OF FILE ///////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -