Skip to content

Commit 90ef6c4

Browse files
committed
SMV: word types
This adds support for NuSMV's signed and unsigned word types, mapped to signedbv/unsignedbv.
1 parent 9b88d5d commit 90ef6c4

17 files changed

+382
-35
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SystemVerilog: typedefs from package scopes
44
* SystemVerilog: assignment patterns with keys for structs
55
* SMV: LTL V operator, xnor operator
6+
* SMV: word types and operators
67

78
# EBMC 5.5
89

regression/smv/word/basic1.desc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
basic1.smv
3+
--bound 0 --trace
4+
^ s1 = 0sd8_123 \(01111011\)$
5+
^ u1 = 0ud8_123 \(01111011\)$
6+
^EXIT=10$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring

regression/smv/word/basic1.smv

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MODULE main
2+
3+
VAR u1 : word[8];
4+
5+
ASSIGN u1 := uwconst(123, 8);
6+
7+
VAR s1 : signed word[8];
8+
9+
ASSIGN s1 := swconst(123, 8);
10+
11+
SPEC FALSE

regression/smv/word/basic2.desc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
basic2.smv
3+
--bdd
4+
^\[live\] G F counter = 0ud8_10: PROVED$
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

regression/smv/word/basic2.smv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MODULE main
2+
3+
VAR counter : word[8];
4+
5+
ASSIGN init(counter) := uwconst(0, 8);
6+
ASSIGN next(counter) := counter + uwconst(1, 8);
7+
8+
LTLSPEC NAME live := G F counter = uwconst(10, 8)

regression/smv/word/concat1.desc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
concat1.smv
3+
4+
^\[.*\] 0ud8_123 :: 0ud8_1 = 0ud16_31489: PROVED$
5+
^\[.*\] 0sd8_123 :: 0sd8_1 = 0ud16_31489: PROVED$
6+
^\[.*\] 0sd8_123 :: 0ud8_1 = 0ud16_31489: PROVED$
7+
^EXIT=0$
8+
^SIGNAL=0$
9+
--
10+
^warning: ignoring

regression/smv/word/concat1.smv

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MODULE main
2+
3+
SPEC uwconst(123, 8) :: uwconst(1, 8) = uwconst(31489, 16)
4+
5+
-- concatenation is unsigned
6+
SPEC swconst(123, 8) :: swconst(1, 8) = uwconst(31489, 16)
7+
SPEC swconst(123, 8) :: uwconst(1, 8) = uwconst(31489, 16)

regression/smv/word/extractbits1.desc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
shift1.smv
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring

regression/smv/word/extractbits1.smv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MODULE main
2+
3+
SPEC uwconst(123, 8)[0:0] = uwconst(1, 1)
4+
SPEC uwconst(123, 8)[7:7] = uwconst(0, 1)
5+
6+
-- always unsigned
7+
SPEC swconst(123, 8)[0:0] = uwconst(1, 1)
8+
SPEC swconst(123, 8)[7:7] = uwconst(0, 1)

regression/smv/word/shift1.desc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CORE
2+
shift1.smv
3+
4+
^\[.*\] 0ud8_123 >> 0 = 0ud8_123: PROVED$
5+
^\[.*\] 0ud8_123 >> 1 = 0ud8_61: PROVED$
6+
^\[.*\] 0ud8_123 >> 8 = 0ud8_0: PROVED$
7+
^\[.*\] 0ud8_123 << 0 = 0ud8_123: PROVED$
8+
^\[.*\] 0ud8_123 << 1 = 0ud8_246: PROVED$
9+
^\[.*\] 0ud8_123 << 2 = 0ud8_236: PROVED$
10+
^\[.*\] 0sd8_123 >> 0 = 0sd8_123: PROVED$
11+
^\[.*\] 0sd8_123 >> 1 = 0sd8_61: PROVED$
12+
^\[.*\] 0sd8_123 >> 8 = 0sd8_0: PROVED$
13+
^\[.*\] 0sd8_123 << 0 = 0sd8_123: PROVED$
14+
^\[.*\] 0sd8_123 << 1 = -0sd8_10: PROVED$
15+
^\[.*\] 0sd8_123 << 2 = -0sd8_20: PROVED$
16+
^EXIT=0$
17+
^SIGNAL=0$
18+
--
19+
^warning: ignoring

0 commit comments

Comments
 (0)