Toolchain‎ > ‎

Emulator

Compilation with emulation is the default execution option for the main 'damson' program. In order to emulate a damson program it should be passed to the damson executable as the first argument. During emulation any printf output is directed to the console; e.g

damson helloworld.d

produces the following console output;

DAMSON Version 5.3
(C) Copyright Dave Allerton 2013
Wed Aug 14 10:47:02 2013

1   Hello World...
Node (1) Exit 0
Workspace: 65896 bytes
Execution time: 0.000028 secs
Computing ticks: 10 (0.000000 s)
Standby ticks: 0 (0.000000 s)   0.00%

Upon exiting the last alias node Damson prints some statistics relating to the workspace size, execution time and number of computing ticks. 

Profiling

More advanced emulator profiling can be obtained by running damson in profiling mode using the '-pr' switch with a alias node number argument. e.g.

damson factorial.d -pr 1

produces the usual emulator output in the console but will create a file 'factorial_1.pr' with the following profiling output (with a similar format to gprof);

node 1
  %time      ticks       time      calls       name
 78.01%       610   0.000003         55       f
 21.87%       171   0.000001          1        main
  0.13%           1   0.000000                   idle

Comments