diff options
author | Staf Verhaegen <staf@stafverhaegen.be> | 2018-01-03 21:54:38 +0000 |
---|---|---|
committer | Staf Verhaegen <staf@stafverhaegen.be> | 2018-01-03 21:54:38 +0000 |
commit | e4875df4e5eda55414fe707f1a6ced96a4a83a30 (patch) | |
tree | 97472b365cc2dee35e89369b3e795a5db2f8a1c4 | |
parent | f3dcf87cea40e92eb34a107719bce0f1b609351f (diff) | |
download | abc-e4875df4e5eda55414fe707f1a6ced96a4a83a30.tar.gz abc-e4875df4e5eda55414fe707f1a6ced96a4a83a30.tar.bz2 abc-e4875df4e5eda55414fe707f1a6ced96a4a83a30.zip |
Value of properties can be expression.
Example found in the 2007.03 Liberty Reference Manual that was also found
in the wild:
input_voltage(CMOS) {
vil : 0.3 * VDD ;
vih : 0.7 * VDD ;
vimin : -0.5 ;
vimax : VDD + 0.5 ;
}
Current implementation just parses the expression but no interpretation is done.
-rw-r--r-- | src/map/scl/sclLiberty.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c index b48cfbe1..fc06bc47 100644 --- a/src/map/scl/sclLiberty.c +++ b/src/map/scl/sclLiberty.c @@ -399,6 +399,18 @@ int Scl_LibertyBuildItem( Scl_Tree_t * p, char ** ppPos, char * pEnd ) if ( Scl_LibertySkipSpaces( p, ppPos, pEnd, 1 ) ) goto exit; pNext = *ppPos; + while ( *pNext == '+' || *pNext == '-' || *pNext == '*' || *pNext == '/' ) + { + (*ppPos) += 1; + if ( Scl_LibertySkipSpaces( p, ppPos, pEnd, 0 ) ) + goto exit; + if ( Scl_LibertySkipEntry( ppPos, pEnd ) ) + goto exit; + Head.End = *ppPos - p->pContents; + if ( Scl_LibertySkipSpaces( p, ppPos, pEnd, 1 ) ) + goto exit; + pNext = *ppPos; + } if ( *pNext != ';' && *pNext != '\n' ) goto exit; *ppPos = pNext + 1; |