diff options
| author | azidar | 2015-05-05 17:37:27 -0700 |
|---|---|---|
| committer | azidar | 2015-05-05 17:37:27 -0700 |
| commit | 791334cced721789fad180b6479cfa783963032f (patch) | |
| tree | 057c3bf7bbd4e2a37daa5cdaec77a17d479108d9 /test/errors | |
| parent | 5b23a9a645db190cea69f30aa1cd370c257fe774 (diff) | |
Added a bunch of tests. In the middle of implementing check kinds and check types. Does not compile
Diffstat (limited to 'test/errors')
| -rw-r--r-- | test/errors/high-form/InstanceNotModule.fir | 8 | ||||
| -rw-r--r-- | test/errors/high-form/InvalidLOC.fir | 18 | ||||
| -rw-r--r-- | test/errors/high-form/InvalidSubexp.fir | 9 | ||||
| -rw-r--r-- | test/errors/high-form/NegUInt.fir | 7 | ||||
| -rw-r--r-- | test/errors/high-form/Prefix.fir | 9 | ||||
| -rw-r--r-- | test/errors/high-form/Unique.fir | 16 | ||||
| -rw-r--r-- | test/errors/high-form/WrongReset.fir | 15 | ||||
| -rw-r--r-- | test/errors/parser/InstanceNotRef.fir | 8 |
8 files changed, 90 insertions, 0 deletions
diff --git a/test/errors/high-form/InstanceNotModule.fir b/test/errors/high-form/InstanceNotModule.fir new file mode 100644 index 00000000..3b228d37 --- /dev/null +++ b/test/errors/high-form/InstanceNotModule.fir @@ -0,0 +1,8 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: Module Top2 is not defined. + +circuit Top : + module Top : + wire x : UInt<1> + inst t of Top2 + diff --git a/test/errors/high-form/InvalidLOC.fir b/test/errors/high-form/InvalidLOC.fir new file mode 100644 index 00000000..5270577b --- /dev/null +++ b/test/errors/high-form/InvalidLOC.fir @@ -0,0 +1,18 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. +; CHECK: Invalid connect to an expression that is not a reference or a WritePort. + +circuit Top : + module Top : + wire x : UInt + add(x,x) := UInt(1) + Pad(x,?) := UInt(1) + Register(x,x) := UInt(1) + ReadPort(x,x,x) := UInt(1) + UInt(1) := UInt(1) + SInt(1) := UInt(1) + diff --git a/test/errors/high-form/InvalidSubexp.fir b/test/errors/high-form/InvalidSubexp.fir new file mode 100644 index 00000000..85fad6fb --- /dev/null +++ b/test/errors/high-form/InvalidSubexp.fir @@ -0,0 +1,9 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: Invalid index access to non-reference. +; CHECK: Invalid subfield access to non-reference. + +circuit Top : + module Top : + wire x : UInt<4> + add(x,x)[10] := UInt(1) + add(x,x).x := UInt(1) diff --git a/test/errors/high-form/NegUInt.fir b/test/errors/high-form/NegUInt.fir new file mode 100644 index 00000000..a92da633 --- /dev/null +++ b/test/errors/high-form/NegUInt.fir @@ -0,0 +1,7 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: UIntValue cannot be negative. + +circuit Top : + module Top : + wire x : UInt<4> + x := UInt(-2) diff --git a/test/errors/high-form/Prefix.fir b/test/errors/high-form/Prefix.fir new file mode 100644 index 00000000..17be36f6 --- /dev/null +++ b/test/errors/high-form/Prefix.fir @@ -0,0 +1,9 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: Reference x$y and x share a prefix. + +circuit Top : + module Top : + wire x : UInt<1> + wire x$y : UInt<2> + + diff --git a/test/errors/high-form/Unique.fir b/test/errors/high-form/Unique.fir new file mode 100644 index 00000000..de95e6cd --- /dev/null +++ b/test/errors/high-form/Unique.fir @@ -0,0 +1,16 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s + +; CHECK: Reference x does not have a unique name. +; CHECK: Reference p does not have a unique name. +; CHECK-NOT: Reference q does not have a unique name. + +circuit Top : + module Top : + wire x : UInt<1> + wire x : UInt<2> + wire p : UInt<3> + wire q : UInt<3> + when p : + wire p : UInt<4> + module Other : + wire q : UInt<3> diff --git a/test/errors/high-form/WrongReset.fir b/test/errors/high-form/WrongReset.fir new file mode 100644 index 00000000..c936f0b3 --- /dev/null +++ b/test/errors/high-form/WrongReset.fir @@ -0,0 +1,15 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s + +; CHECK: Module Top has a reset that is not of type UInt<1>. +; CHECK: Module B has a reset that is not of type UInt<1>. +; CHECK: Module C has a reset that is not of type UInt<1>. + +circuit Top : + module Top : + input reset : SInt<1> + module B : + input reset : UInt + module C : + output reset : UInt<1> + + diff --git a/test/errors/parser/InstanceNotRef.fir b/test/errors/parser/InstanceNotRef.fir new file mode 100644 index 00000000..a6996fee --- /dev/null +++ b/test/errors/parser/InstanceNotRef.fir @@ -0,0 +1,8 @@ +; RUN: firrtl -i %s -o %s.flo -x X -p c | tee %s.out | FileCheck %s +; CHECK: FIRRTL Parsing Error: Expected a reference expression here. + +circuit Top : + module Top : + wire x : UInt<1> + inst t of add(UInt(1),UInt(1)) + |
