summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKathy Gray2014-07-30 18:49:49 +0100
committerKathy Gray2014-07-30 18:49:49 +0100
commit8e6d2121d7e02eef90465f9fc21aa605c14bb057 (patch)
tree43ca591575433a00822fe1e2e9052421015369f8 /src/test
parent7c0435413b58eb82a22602d4a3b65f45323dc03b (diff)
working dec vectors
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test1.sail4
-rw-r--r--src/test/test2.sail7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/test/test1.sail b/src/test/test1.sail
index 1ca615c5..489206d3 100644
--- a/src/test/test1.sail
+++ b/src/test/test1.sail
@@ -1,3 +1,4 @@
+default Order inc
default Nat 'i
default Order 'o
default bool b
@@ -7,7 +8,6 @@ val forall Type 'i, 'b. ('i, 'b) -> 'i effect pure fst
typedef int_list [name = "il"] = list<nat>
typedef reco = const struct forall 'i, 'a, 'b. { 'a['i] v; 'b w; }
typedef maybe = const union forall 'a. { Nne; 'a Sme; }
-typedef colors = enumerate { red; green; blue }
typedef creg = register bits [5:10] { 5 : h ; 6..7 : j}
let bool e = true
val forall Nat 'a, Nat 'b. bit['a:'b] sliced
@@ -41,6 +41,8 @@ function unit a (bit) b = if identity(b) then (identity()) else ()
function bit sw s = switch s { case 0 -> bitzero }
+typedef colors = enumerate { red; green; blue }
+
let colors rgb = red
function bit enu (red) = 0
diff --git a/src/test/test2.sail b/src/test/test2.sail
index 57542d3f..ab0a72b7 100644
--- a/src/test/test2.sail
+++ b/src/test/test2.sail
@@ -1,3 +1,5 @@
+default Order dec
+
function nat id ( n ) = n
register (bit[5]) c
@@ -8,7 +10,10 @@ function unit f() = {
else
a := 4
);
- c := (bit[5]) (3 + 0b00001) mod 2;
+ a:= (nat) 0b010101;
+ a:= (nat) (0b0101010 + 0b0101000);
+ c := (bit[5]) (3 + 0b00101) mod 3;
+ if c[1] then c:= 31 else c:= 0;
b := a;
}