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
3da93578
Unverified
Commit
3da93578
authored
Apr 18, 2022
by
Miodrag Milanović
Committed by
GitHub
Apr 18, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from YosysHQ/micko/read_cex_fix
Make read_cex able to append if some latches are missing
parents
00b674d5
43a15df9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
src/base/io/io.c
+13
-5
No files found.
src/base/io/io.c
View file @
3da93578
...
@@ -705,11 +705,14 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
...
@@ -705,11 +705,14 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
nFrames
=
-
1
;
nFrames
=
-
1
;
int
status
=
0
;
int
status
=
0
;
int
i
;
int
i
;
int
nRegsNtk
=
0
;
Abc_Obj_t
*
pObj
;
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
nRegsNtk
++
;
Buffer
=
ABC_ALLOC
(
char
,
MaxLine
);
Buffer
=
ABC_ALLOC
(
char
,
MaxLine
);
while
(
fgets
(
Buffer
,
MaxLine
,
pFile
)
!=
NULL
)
while
(
fgets
(
Buffer
,
MaxLine
,
pFile
)
!=
NULL
)
{
{
if
(
Buffer
[
0
]
==
'#'
)
if
(
Buffer
[
0
]
==
'#'
||
Buffer
[
0
]
==
'c'
||
Buffer
[
0
]
==
'f'
||
Buffer
[
0
]
==
'u'
)
continue
;
continue
;
Buffer
[
strlen
(
Buffer
)
-
1
]
=
'\0'
;
Buffer
[
strlen
(
Buffer
)
-
1
]
=
'\0'
;
if
(
state
==
0
&&
strlen
(
Buffer
)
>
1
)
{
if
(
state
==
0
&&
strlen
(
Buffer
)
>
1
)
{
...
@@ -719,7 +722,7 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
...
@@ -719,7 +722,7 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
iPo
=
0
;
iPo
=
0
;
status
=
1
;
status
=
1
;
}
}
if
(
state
==
1
&&
Buffer
[
0
]
!=
'b'
&&
Buffer
[
0
]
!=
'
c
'
)
{
if
(
state
==
1
&&
Buffer
[
0
]
!=
'b'
&&
Buffer
[
0
]
!=
'
j
'
)
{
// old format detected, first line was actually register
// old format detected, first line was actually register
*
fOldFormat
=
1
;
*
fOldFormat
=
1
;
state
=
3
;
state
=
3
;
...
@@ -766,6 +769,14 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
...
@@ -766,6 +769,14 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
}
}
}
}
nRegs
=
Vec_IntSize
(
vNums
);
nRegs
=
Vec_IntSize
(
vNums
);
if
(
nRegs
<
nRegsNtk
)
{
printf
(
"WARNING: Register number is smaller then in Ntk. Appending.
\n
"
);
for
(
i
=
0
;
i
<
nRegsNtk
-
nRegs
;
i
++
)
{
Vec_IntPush
(
vNums
,
0
);
}
nRegs
=
Vec_IntSize
(
vNums
);
}
state
=
3
;
state
=
3
;
break
;
break
;
default:
default:
...
@@ -786,12 +797,9 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
...
@@ -786,12 +797,9 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex,
if
(
usedX
)
if
(
usedX
)
printf
(
"Warning: Using 0 instead of x in latches or primary inputs
\n
"
);
printf
(
"Warning: Using 0 instead of x in latches or primary inputs
\n
"
);
Abc_Obj_t
*
pObj
;
int
iFrameCex
=
nFrames
;
int
iFrameCex
=
nFrames
;
int
nRegsNtk
=
0
;
int
nPiNtk
=
0
;
int
nPiNtk
=
0
;
int
nPoNtk
=
0
;
int
nPoNtk
=
0
;
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
nRegsNtk
++
;
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
nPiNtk
++
;
Abc_NtkForEachPi
(
pNtk
,
pObj
,
i
)
nPiNtk
++
;
Abc_NtkForEachPo
(
pNtk
,
pObj
,
i
)
nPoNtk
++
;
Abc_NtkForEachPo
(
pNtk
,
pObj
,
i
)
nPoNtk
++
;
if
(
nRegs
<
0
)
if
(
nRegs
<
0
)
...
...
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