diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-08-12 15:33:09 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-08-12 15:33:09 -0700 |
commit | b74b7dfc2d2065eebc800c9165a3e15caeb4453d (patch) | |
tree | 20b8cebe1340b0f3ebac2650f93e420bd7b83f4a | |
parent | 5c8ee4a2c142d133afe4cbfe567b300fe4d040a8 (diff) | |
download | abc-b74b7dfc2d2065eebc800c9165a3e15caeb4453d.tar.gz abc-b74b7dfc2d2065eebc800c9165a3e15caeb4453d.tar.bz2 abc-b74b7dfc2d2065eebc800c9165a3e15caeb4453d.zip |
Extending &sim_read to use non-64-divisible pattern counts.
-rw-r--r-- | src/misc/vec/vecWrd.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/misc/vec/vecWrd.h b/src/misc/vec/vecWrd.h index 3e25c066..663b7a88 100644 --- a/src/misc/vec/vecWrd.h +++ b/src/misc/vec/vecWrd.h @@ -1300,10 +1300,20 @@ static inline Vec_Wrd_t * Vec_WrdReadHex( char * pFileName, int * pnWords, int f p = Vec_WrdAlloc( 1000 ); while ( (c = fgetc(pFile)) != EOF ) { - if ( c == '\n' && nWords == -1 ) - nWords = Vec_WrdSize(p); - if ( c == '\n' || c == '\r' || c == '\t' || c == ' ' ) + if ( c == '\r' || c == '\t' || c == ' ' ) continue; + if ( c == '\n' ) + { + if ( nChars > 0 ) + { + Vec_WrdPush( p, Num ); + nChars = 0; + Num = 0; + } + if ( nWords == -1 && Vec_WrdSize(p) > 0 ) + nWords = Vec_WrdSize(p); + continue; + } Num |= (word)Vec_WrdReadHexOne((char)c) << (nChars * 4); if ( ++nChars < 16 ) continue; |