Module print

Source
Expand description

Utilities to print to the simulator’s standard output.

sim_print!() and sim_println!() are analogous to the standard print!() and println!() macros but print to the simulator’s standard output instead of the regular Rust standard output (though these are often the same).

There is also a SimulatorPrinter similar to the standard Stdout that is useful if you need a [Writer] corresponding to the simulator’s output.

Since these use vpi_printf() internally, and according to the IEEE 1800-2017 standard, it is not safe to call it from a startup routine, if you do, a panic will occur or you’ll get an Err depending on exactly what you’re working with. This will also happen if you call printing functions / invoke printing macros from a thread other than the main one, which also isn’t permissible.

Structs§

SimulatorPrinter
A handle to the simulator’s output.