Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
14aae240
Commit
14aae240
authored
Feb 28, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to LUT mappers.
parent
3048be2c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/map/if/ifDsd.c
+11
-11
No files found.
src/map/if/ifDsd.c
View file @
14aae240
...
@@ -596,53 +596,53 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
...
@@ -596,53 +596,53 @@ If_DsdMan_t * If_DsdManLoad( char * pFileName )
char
pBuffer
[
10
];
char
pBuffer
[
10
];
unsigned
*
pSpot
;
unsigned
*
pSpot
;
word
*
pTruth
;
word
*
pTruth
;
int
i
,
Num
;
int
i
,
Num
,
RetValue
;
FILE
*
pFile
=
fopen
(
pFileName
,
"rb"
);
FILE
*
pFile
=
fopen
(
pFileName
,
"rb"
);
if
(
pFile
==
NULL
)
if
(
pFile
==
NULL
)
{
{
printf
(
"Reading DSD manager file
\"
%s
\"
has failed.
\n
"
,
pFileName
);
printf
(
"Reading DSD manager file
\"
%s
\"
has failed.
\n
"
,
pFileName
);
return
NULL
;
return
NULL
;
}
}
fread
(
pBuffer
,
4
,
1
,
pFile
);
RetValue
=
fread
(
pBuffer
,
4
,
1
,
pFile
);
if
(
pBuffer
[
0
]
!=
'd'
&&
pBuffer
[
1
]
!=
's'
&&
pBuffer
[
2
]
!=
'd'
&&
pBuffer
[
3
]
!=
'0'
)
if
(
pBuffer
[
0
]
!=
'd'
&&
pBuffer
[
1
]
!=
's'
&&
pBuffer
[
2
]
!=
'd'
&&
pBuffer
[
3
]
!=
'0'
)
{
{
printf
(
"Unrecognized format of file
\"
%s
\"
.
\n
"
,
pFileName
);
printf
(
"Unrecognized format of file
\"
%s
\"
.
\n
"
,
pFileName
);
return
NULL
;
return
NULL
;
}
}
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
p
=
If_DsdManAlloc
(
Num
,
0
);
p
=
If_DsdManAlloc
(
Num
,
0
);
ABC_FREE
(
p
->
pStore
);
ABC_FREE
(
p
->
pStore
);
p
->
pStore
=
Abc_UtilStrsav
(
pFileName
);
p
->
pStore
=
Abc_UtilStrsav
(
pFileName
);
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
p
->
LutSize
=
Num
;
p
->
LutSize
=
Num
;
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
assert
(
Num
>=
2
);
assert
(
Num
>=
2
);
Vec_PtrFillExtra
(
p
->
vObjs
,
Num
,
NULL
);
Vec_PtrFillExtra
(
p
->
vObjs
,
Num
,
NULL
);
Vec_IntFill
(
p
->
vNexts
,
Num
,
0
);
Vec_IntFill
(
p
->
vNexts
,
Num
,
0
);
for
(
i
=
2
;
i
<
Vec_PtrSize
(
p
->
vObjs
);
i
++
)
for
(
i
=
2
;
i
<
Vec_PtrSize
(
p
->
vObjs
);
i
++
)
{
{
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
pObj
=
(
If_DsdObj_t
*
)
Mem_FlexEntryFetch
(
p
->
pMem
,
sizeof
(
word
)
*
Num
);
pObj
=
(
If_DsdObj_t
*
)
Mem_FlexEntryFetch
(
p
->
pMem
,
sizeof
(
word
)
*
Num
);
fread
(
pObj
,
sizeof
(
word
)
*
Num
,
1
,
pFile
);
RetValue
=
fread
(
pObj
,
sizeof
(
word
)
*
Num
,
1
,
pFile
);
Vec_PtrWriteEntry
(
p
->
vObjs
,
i
,
pObj
);
Vec_PtrWriteEntry
(
p
->
vObjs
,
i
,
pObj
);
pSpot
=
If_DsdObjHashLookup
(
p
,
pObj
->
Type
,
(
int
*
)
pObj
->
pFans
,
pObj
->
nFans
,
If_DsdObjTruthId
(
p
,
pObj
)
);
pSpot
=
If_DsdObjHashLookup
(
p
,
pObj
->
Type
,
(
int
*
)
pObj
->
pFans
,
pObj
->
nFans
,
If_DsdObjTruthId
(
p
,
pObj
)
);
assert
(
*
pSpot
==
0
);
assert
(
*
pSpot
==
0
);
*
pSpot
=
pObj
->
Id
;
*
pSpot
=
pObj
->
Id
;
}
}
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
pTruth
=
ABC_ALLOC
(
word
,
p
->
nWords
);
pTruth
=
ABC_ALLOC
(
word
,
p
->
nWords
);
for
(
i
=
0
;
i
<
Num
;
i
++
)
for
(
i
=
0
;
i
<
Num
;
i
++
)
{
{
fread
(
pTruth
,
sizeof
(
word
)
*
p
->
nWords
,
1
,
pFile
);
RetValue
=
fread
(
pTruth
,
sizeof
(
word
)
*
p
->
nWords
,
1
,
pFile
);
Vec_MemHashInsert
(
p
->
vTtMem
,
pTruth
);
Vec_MemHashInsert
(
p
->
vTtMem
,
pTruth
);
}
}
ABC_FREE
(
pTruth
);
ABC_FREE
(
pTruth
);
assert
(
Num
==
Vec_MemEntryNum
(
p
->
vTtMem
)
);
assert
(
Num
==
Vec_MemEntryNum
(
p
->
vTtMem
)
);
for
(
i
=
0
;
i
<
Vec_MemEntryNum
(
p
->
vTtMem
);
i
++
)
for
(
i
=
0
;
i
<
Vec_MemEntryNum
(
p
->
vTtMem
);
i
++
)
{
{
fread
(
&
Num
,
4
,
1
,
pFile
);
RetValue
=
fread
(
&
Num
,
4
,
1
,
pFile
);
vSets
=
Vec_IntAlloc
(
Num
);
vSets
=
Vec_IntAlloc
(
Num
);
fread
(
Vec_IntArray
(
vSets
),
sizeof
(
int
)
*
Num
,
1
,
pFile
);
RetValue
=
fread
(
Vec_IntArray
(
vSets
),
sizeof
(
int
)
*
Num
,
1
,
pFile
);
vSets
->
nSize
=
Num
;
vSets
->
nSize
=
Num
;
Vec_PtrPush
(
p
->
vTtDecs
,
vSets
);
Vec_PtrPush
(
p
->
vTtDecs
,
vSets
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment