|
Redirecting
simulation output to a file will help if
you are generating many text messages via
ODB, printf's, etc. After running the simulation,
you can then search in the text file, "diff"
it vs. previous runs, etc.
---------------------
Windows NT Directions
---------------------
On Windows, to get
redirection to work you need to directly
execute op_runsim_dev (executing op_runsim
will not work). First, select Start->Programs->OPNET->OPNET
Console. This will bring up a DOS prompt
with the correct environment for running
OPNET related programs. Then execute:
op_runsim_dev
-net_name project1-scenario1 [plus any additional
flags] > c:\temp\out.txt
You
can't see the ODB prompt when running like
this. A simple technique is to create a
text file with all your sequential ODB commands.
For example, if you want to turn on "fulltrace"
starting at time 101, you create a file
c:\temp\odb_commands.txt with the following
contents:
tstop
101
cont
fulltrace
cont
Then
execute:
op_runsim_dev
-net_name project1-scenario1 [plus any additional
flags] < c:\temp\odb_commands.txt >
c:\temp\out.txt
---------------
UNIX Directions
---------------
On UNIX, the easiest
way to do this is to execute the "script"
command:
prompt%
script
This
command starts a new shell and logs all
output to a file called "typescript".
Run your simulation from the prompt:
prompt%
op_runsim -net_name project1-scenario1 [plus
any additional flags]
If
you are using ODB, you can interact with
your simulation as you normally would. When
your simulation is done, exit the shell:
prompt%
exit
This
will flush output to the file "typescript",
which you can then examine.
An
alternative to using the "script"
command on UNIX is to redirect your simulation
output:
prompt% op_runsim -net_name project1-scenario1
[plus any additional flags] > /tmp/out.txt
You
can't see the ODB prompt when running like
this. A simple technique is to create a
text file with all your sequential ODB commands.
For example, if you want to turn on "fulltrace"
starting at time 101, you create a file
/tmp/odb_commands.txt with the following
contents:
tstop
101
cont
fulltrace
cont
Then
execute:
op_runsim -net_name project1-scenario1 [plus
any additional flags] < /tmp/odb_commands.txt
> /tmp/out.txt
If
you are doing this, you can also use the
UNIX command "tail -f /tmp/out.txt"
to see a continously streaming update of
your output file.
|