exceptions.scala 1.55 KB
Newer Older
1 2 3 4
package uvm.refimpl

import uvm.UvmException

5
/** Parent of all exceptions in the implementation part. This does not include the data structure and parser outside uvm.refimpl. */
Kunshan Wang's avatar
Kunshan Wang committed
6 7
class UvmRefImplException(message: String = null, cause: Throwable = null) extends UvmException(message, cause)

Kunshan Wang's avatar
Kunshan Wang committed
8
/** Thrown when the micro VM cannot allocate memory. */
Kunshan Wang's avatar
Kunshan Wang committed
9
class UvmOutOfMemoryException(message: String = null, cause: Throwable = null) extends UvmRefImplException(message, cause)
10

11 12
/** Thrown when an action not required by the specification and not implemented by this refimpl is performed. */
class UnimplementedOprationException(message: String = null, cause: Throwable = null) extends UvmRefImplException(message, cause)
Kunshan Wang's avatar
Kunshan Wang committed
13 14 15

/**
 * Thrown when a dynamic error (errors that cannot be found at compile time) happens. This refimpl may sometimes throw
Kunshan Wang's avatar
Kunshan Wang committed
16
 * exceptions on static errors rather than checking before running because the micro VM has undefined behaviour on static
Kunshan Wang's avatar
Kunshan Wang committed
17 18 19 20
 * errors. (It has undefined behaviour on dynamic errors, too.)
 */
class UvmRuntimeException(message: String = null, cause: Throwable = null) extends UvmRefImplException(message, cause)

21
/** Thrown when a division by zero is executed and the exception clause is not present. */
22 23 24 25
class UvmDivisionByZeroException(message: String = null, cause: Throwable = null) extends UvmRuntimeException(message, cause)

/** Thrown when accessing Mu memory but the address is outside the allocated region. */
class UvmIllegalMemoryAccessException(message: String = null, cause: Throwable = null) extends UvmRuntimeException(message, cause)