Debugging Operations

These operations are available for use on the CPU and during simulation to aid runtime debugging.


Methods

def assert(cond: MBoolean, msg: String): Unit
Checks that the given condition cond is true at runtime.
If not, exits the program with the given message.
def assert(cond: MBoolean): Unit
Checks that the given condition cond is true at runtime.
If not, exits the program with a generic exception.
def println(): Unit
Prints an empty line to the console.
def print[T:Type](x: T): Unit
Prints a String representation of the given value to the console.
def println[T:Type](x: T): Unit
Prints a String representation of the given value to the console followed by a linebreak.
def print(x: String): Unit
Prints the given String to the console.
def println(x: String): Unit
Prints the given String to the console, followed by a linebreak.
def printArray[T:Type](array: Array[T], heading: String = “”): Unit
Prints the given Array to the console, preceded by an optional heading.
def printMatrix[T:Type](matrix: Matrix[T], heading: String = “”): Unit
Prints the given Matrix to the console, preceded by an optional heading.
def printTensor3[T:Type](tensor: Tensor3[T], heading: String = “”): Unit
Prints the given Tensor3 to the console, preceded by an optional heading.
def printTensor4[T:Type](tensor: Tensor4[T], heading: String = “”): Unit
Prints the given Tensor4 to the console, preceded by the an optional heading.
def printTensor5[T:Type](tensor: Tensor5[T], heading: String = “”): Unit
Prints the given Tensor5 to the console, preceded by the an optional heading.