sim: add trace functionality