Debug during sim compilation.
Adding state dump function.