NAME
nsim - nanoprocessor simulator
SYNOPSIS
nsim
file
[
-q
]
[
-v
]
[
-o
output_file
]
[
-b
]
[
-h
]
[
-a parameters
]
[
-c | [-n] -i
interpreter options
]
DESCRIPTION
nsim is a generic cross-platform compiler, simulator and debugger. It processes source code in nanoassembler.
nsim
does not prescribe any specific instruction set.nsim
provides developers possibility to create own instruction
set and to perform simulation of the code written in so
created nanoassembler language.
For complete nanoassembler language specification
(including instruction set specification) see
REFERENCES.
The nanoprocessor may have any inputs and outputs.
These parameters may be passed to the nanoprocessor as
interpreter options
written after parameter-i(see above).
Note that these parameters are prescribed by
the developer of a nanoprocessor--so their list may be
found in a proper documentation of the desired nanoprocessor.
It is recommended (but not required) that interpreter options
can be obtaining by the following command:
nsim program -i -h
For comprehensive information about developing undernsim see sections REFERENCES and SEE ALSO below.
PARAMETERS
- -q
- quiet parser output
- -v
- prints program version
- -o
- specifies output file with the compiled program; default output is 64bit binary
- -b
- text mode where output is stored in binary numbers
- -h
- text mode where output is stored in hexadecimal numbers
- -a
- parametersis a string which is passed to the inner call of C compiler (nsimuses a C compiler---gcc by default---in the process of generating processor specific interpreter). This option is very useful for advanced nanoassembler programming techniques.
- -c
- executes just compilation without debugger or interpreter (default)
- -i
- executes the interpreter and the debugger after the compilation; debugger can be disabled (see -n directive)
- -n
- this parameter combined with -i parameter executes the interpreter without the debugger. Inputs are converted to outputs only.
EXAMPLES
nsim program.hfe -c -q -o hfe.bin
performs a compilation of the source code, stored in the file nsim program.hfe and saves compiled nanoprogram into file hfe.bin
nsim sampling.prg -n -i -d signal.bin -s sampled.bin
compiles nanoprogram sampling.prg and executes it (without debugging) with parameters -d -s
nsim program.lup -o program.bin -i -i packets.bin -o headers.bin
performs compilation of the nanoprogram program.lup and invokes debugging of the compiled nanoprogram
nsim program.xor -o ope.bin -n -i -s numbers.txt -o xors.txt
performs compilation of program.xor and executes (without debugging) the compiled nanoprogram with its specific parameters -s -o
ENVIRONMENT VARIABLES
- NSIM_TMPPATH
- directory used by nsim for temporary files created during compilation; if not set, /tmp directory is used implicitly nsim creates for each running instance directory named nsim.<pid> in specified location
- NSIM_LIBPATH
- path with object files which are necessary for linking of processor specific interpreter default location /usr/local/lib
- NSIM_SRCPATH
- directory with C codes which are used for building of processor specific interpreter default location /usr/local/share
NOTES
Succesfull run of nsim requires a C compiler, make utility and readline library
REFERENCES
- [1]
- Hofer, Filip: Packet Analysis for IPv6 Router Implemented by a PCI Acceleration card url: http://www.cesnet.cz/doc/techzpravy/2003/
- [2]
- Project Liberouterurl: http://www.liberouter.org
PORTABILITY
Linux, NetBSD, FreeBSD, Windows
AUTHORS
Filip Hofer, Tomáš Rybka


