Commit f2945e12 by Alan Mishchenko

Upgrading epd and mtr packages to be compatible with the latest release of CUDD 2.4.2

parent e3f2dde1
...@@ -57,9 +57,9 @@ ABC_NAMESPACE_HEADER_START ...@@ -57,9 +57,9 @@ ABC_NAMESPACE_HEADER_START
/* Constant declarations */ /* Constant declarations */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define EPD_MAX_BIN 1023 #define EPD_MAX_BIN 1023
#define EPD_MAX_DEC 308 #define EPD_MAX_DEC 308
#define EPD_EXP_INF 0x7ff #define EPD_EXP_INF 0x7ff
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Structure declarations */ /* Structure declarations */
...@@ -74,15 +74,15 @@ ABC_NAMESPACE_HEADER_START ...@@ -74,15 +74,15 @@ ABC_NAMESPACE_HEADER_START
SeeAlso [] SeeAlso []
******************************************************************************/ ******************************************************************************/
#ifdef EPD_BIG_ENDIAN #ifdef EPD_BIG_ENDIAN
struct IeeeDoubleStruct { /* BIG_ENDIAN */ struct IeeeDoubleStruct { /* BIG_ENDIAN */
unsigned int sign: 1; unsigned int sign: 1;
unsigned int exponent: 11; unsigned int exponent: 11;
unsigned int mantissa0: 20; unsigned int mantissa0: 20;
unsigned int mantissa1: 32; unsigned int mantissa1: 32;
}; };
#else #else
struct IeeeDoubleStruct { /* LITTLE_ENDIAN */ struct IeeeDoubleStruct { /* LITTLE_ENDIAN */
unsigned int mantissa1: 32; unsigned int mantissa1: 32;
unsigned int mantissa0: 20; unsigned int mantissa0: 20;
unsigned int exponent: 11; unsigned int exponent: 11;
...@@ -99,8 +99,8 @@ struct IeeeDoubleStruct { /* LITTLE_ENDIAN */ ...@@ -99,8 +99,8 @@ struct IeeeDoubleStruct { /* LITTLE_ENDIAN */
SeeAlso [] SeeAlso []
******************************************************************************/ ******************************************************************************/
#ifdef EPD_BIG_ENDIAN #ifdef EPD_BIG_ENDIAN
struct IeeeNanStruct { /* BIG_ENDIAN */ struct IeeeNanStruct { /* BIG_ENDIAN */
unsigned int sign: 1; unsigned int sign: 1;
unsigned int exponent: 11; unsigned int exponent: 11;
unsigned int quiet_bit: 1; unsigned int quiet_bit: 1;
...@@ -108,7 +108,7 @@ struct IeeeNanStruct { /* BIG_ENDIAN */ ...@@ -108,7 +108,7 @@ struct IeeeNanStruct { /* BIG_ENDIAN */
unsigned int mantissa1: 32; unsigned int mantissa1: 32;
}; };
#else #else
struct IeeeNanStruct { /* LITTLE_ENDIAN */ struct IeeeNanStruct { /* LITTLE_ENDIAN */
unsigned int mantissa1: 32; unsigned int mantissa1: 32;
unsigned int mantissa0: 19; unsigned int mantissa0: 19;
unsigned int quiet_bit: 1; unsigned int quiet_bit: 1;
...@@ -127,14 +127,14 @@ struct IeeeNanStruct { /* LITTLE_ENDIAN */ ...@@ -127,14 +127,14 @@ struct IeeeNanStruct { /* LITTLE_ENDIAN */
******************************************************************************/ ******************************************************************************/
union EpTypeUnion { union EpTypeUnion {
double value; double value;
struct IeeeDoubleStruct bits; struct IeeeDoubleStruct bits;
struct IeeeNanStruct nan; struct IeeeNanStruct nan;
}; };
struct EpDoubleStruct { struct EpDoubleStruct {
union EpTypeUnion type; union EpTypeUnion type;
int exponent; int exponent;
}; };
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
......
...@@ -96,20 +96,20 @@ ABC_NAMESPACE_HEADER_START ...@@ -96,20 +96,20 @@ ABC_NAMESPACE_HEADER_START
#endif #endif
/* Flag definitions */ /* Flag definitions */
#define MTR_DEFAULT 0x00000000 #define MTR_DEFAULT 0x00000000
#define MTR_TERMINAL 0x00000001 #define MTR_TERMINAL 0x00000001
#define MTR_SOFT 0x00000002 #define MTR_SOFT 0x00000002
#define MTR_FIXED 0x00000004 #define MTR_FIXED 0x00000004
#define MTR_NEWNODE 0x00000008 #define MTR_NEWNODE 0x00000008
/* MTR_MAXHIGH is defined in such a way that on 32-bit and 64-bit /* MTR_MAXHIGH is defined in such a way that on 32-bit and 64-bit
** machines one can cast a value to (int) without generating a negative ** machines one can cast a value to (int) without generating a negative
** number. ** number.
*/ */
#if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4 #if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
#define MTR_MAXHIGH (((MtrHalfWord) ~0) >> 1) #define MTR_MAXHIGH (((MtrHalfWord) ~0) >> 1)
#else #else
#define MTR_MAXHIGH ((MtrHalfWord) ~0) #define MTR_MAXHIGH ((MtrHalfWord) ~0)
#endif #endif
...@@ -150,8 +150,8 @@ typedef struct MtrNode { ...@@ -150,8 +150,8 @@ typedef struct MtrNode {
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Flag manipulation macros */ /* Flag manipulation macros */
#define MTR_SET(node, flag) (node->flags |= (flag)) #define MTR_SET(node, flag) (node->flags |= (flag))
#define MTR_RESET(node, flag) (node->flags &= ~ (flag)) #define MTR_RESET(node, flag) (node->flags &= ~ (flag))
#define MTR_TEST(node, flag) (node->flags & (flag)) #define MTR_TEST(node, flag) (node->flags & (flag))
......
...@@ -7,20 +7,20 @@ ...@@ -7,20 +7,20 @@
Synopsis [Basic manipulation of multiway branching trees.] Synopsis [Basic manipulation of multiway branching trees.]
Description [External procedures included in this module: Description [External procedures included in this module:
<ul> <ul>
<li> Mtr_AllocNode() <li> Mtr_AllocNode()
<li> Mtr_DeallocNode() <li> Mtr_DeallocNode()
<li> Mtr_InitTree() <li> Mtr_InitTree()
<li> Mtr_FreeTree() <li> Mtr_FreeTree()
<li> Mtr_CopyTree() <li> Mtr_CopyTree()
<li> Mtr_MakeFirstChild() <li> Mtr_MakeFirstChild()
<li> Mtr_MakeLastChild() <li> Mtr_MakeLastChild()
<li> Mtr_CreateFirstChild() <li> Mtr_CreateFirstChild()
<li> Mtr_CreateLastChild() <li> Mtr_CreateLastChild()
<li> Mtr_MakeNextSibling() <li> Mtr_MakeNextSibling()
<li> Mtr_PrintTree() <li> Mtr_PrintTree()
</ul> </ul>
] ]
SeeAlso [cudd package] SeeAlso [cudd package]
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
******************************************************************************/ ******************************************************************************/
#include "util.h" #include "util_hack.h"
#include "mtrInt.h" #include "mtrInt.h"
ABC_NAMESPACE_IMPL_START ABC_NAMESPACE_IMPL_START
...@@ -119,7 +119,7 @@ Mtr_AllocNode(void) ...@@ -119,7 +119,7 @@ Mtr_AllocNode(void)
{ {
MtrNode *node; MtrNode *node;
node = ALLOC(MtrNode,1); node = ABC_ALLOC(MtrNode,1);
return node; return node;
} /* Mtr_AllocNode */ } /* Mtr_AllocNode */
...@@ -140,7 +140,7 @@ void ...@@ -140,7 +140,7 @@ void
Mtr_DeallocNode( Mtr_DeallocNode(
MtrNode * node /* node to be deallocated */) MtrNode * node /* node to be deallocated */)
{ {
FREE(node); ABC_FREE(node);
return; return;
} /* end of Mtr_DeallocNode */ } /* end of Mtr_DeallocNode */
...@@ -224,18 +224,18 @@ Mtr_CopyTree( ...@@ -224,18 +224,18 @@ Mtr_CopyTree(
if (copy == NULL) return(NULL); if (copy == NULL) return(NULL);
copy->parent = copy->elder = copy->child = copy->younger = NULL; copy->parent = copy->elder = copy->child = copy->younger = NULL;
if (node->child != NULL) { if (node->child != NULL) {
copy->child = Mtr_CopyTree(node->child, expansion); copy->child = Mtr_CopyTree(node->child, expansion);
if (copy->child == NULL) { if (copy->child == NULL) {
Mtr_DeallocNode(copy); Mtr_DeallocNode(copy);
return(NULL); return(NULL);
} }
} }
if (node->younger != NULL) { if (node->younger != NULL) {
copy->younger = Mtr_CopyTree(node->younger, expansion); copy->younger = Mtr_CopyTree(node->younger, expansion);
if (copy->younger == NULL) { if (copy->younger == NULL) {
Mtr_FreeTree(copy); Mtr_FreeTree(copy);
return(NULL); return(NULL);
} }
} }
copy->flags = node->flags; copy->flags = node->flags;
copy->low = node->low * expansion; copy->low = node->low * expansion;
...@@ -243,11 +243,11 @@ Mtr_CopyTree( ...@@ -243,11 +243,11 @@ Mtr_CopyTree(
copy->index = node->index * expansion; copy->index = node->index * expansion;
if (copy->younger) copy->younger->elder = copy; if (copy->younger) copy->younger->elder = copy;
if (copy->child) { if (copy->child) {
MtrNode *auxnode = copy->child; MtrNode *auxnode = copy->child;
while (auxnode != NULL) { while (auxnode != NULL) {
auxnode->parent = copy; auxnode->parent = copy;
auxnode = auxnode->younger; auxnode = auxnode->younger;
} }
} }
return(copy); return(copy);
...@@ -275,9 +275,9 @@ Mtr_MakeFirstChild( ...@@ -275,9 +275,9 @@ Mtr_MakeFirstChild(
child->elder = NULL; child->elder = NULL;
if (parent->child != NULL) { if (parent->child != NULL) {
#ifdef MTR_DEBUG #ifdef MTR_DEBUG
assert(parent->child->elder == NULL); assert(parent->child->elder == NULL);
#endif #endif
parent->child->elder = child; parent->child->elder = child;
} }
parent->child = child; parent->child = child;
return; return;
...@@ -306,14 +306,14 @@ Mtr_MakeLastChild( ...@@ -306,14 +306,14 @@ Mtr_MakeLastChild(
child->younger = NULL; child->younger = NULL;
if (parent->child == NULL) { if (parent->child == NULL) {
parent->child = child; parent->child = child;
child->elder = NULL; child->elder = NULL;
} else { } else {
for (node = parent->child; for (node = parent->child;
node->younger != NULL; node->younger != NULL;
node = node->younger); node = node->younger);
node->younger = child; node->younger = child;
child->elder = node; child->elder = node;
} }
child->parent = parent; child->parent = parent;
return; return;
...@@ -398,7 +398,7 @@ Mtr_MakeNextSibling( ...@@ -398,7 +398,7 @@ Mtr_MakeNextSibling(
{ {
second->younger = first->younger; second->younger = first->younger;
if (first->younger != NULL) { if (first->younger != NULL) {
first->younger->elder = second; first->younger->elder = second;
} }
second->parent = first->parent; second->parent = first->parent;
first->younger = second; first->younger = second;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment