OpenCores
URL https://opencores.org/ocsvn/ion/ion/trunk

Subversion Repositories ion

[/] [ion/] [trunk/] [doc/] [src/] [tex/] [sw_samples.tex] - Rev 220

Go to most recent revision | Compare with Previous | Blame | View Log

\chapter{Code samples}
\label{samples}
 
    Directory /src directory contains a few test applications that can be 
    simulated and run on real hardware, except for the opcode test which can 
    only be simulated. See the readme file and the makefile for each program.\\
 
    Please read the /src/reame.txt file for information that will probably be
    more up-to-date than this doc.\\
 
    The makefiles have been tested with the CodeSourcery toolchain for windows 
    (that can be downloaded from www.codesourcery.com) and with the Buildroot 
    toolchain for GNU/Linux.\\
 
    Most makefiles have two targets, to create a simulation test bench and a
    synthesizable demo.\\
 
    Target 'sim' will build the simulation test bench package files as described 
    in section~\ref{logic_simulation}.
 
    Target 'demo' will build a synthesizable demo; it will compile the sample
    sources and place the resulting object code in file 
    '/vhdl/demo/code\_rom\_pkg.vhdl' (note that the 'sim' target has to do this 
    too).\\
 
    The build process will produce two or more binary files ('*.code' and 
    '*.data', or '*.bin') that can be run on the software simulator, plus a 
    listing file (*.lst) handy for debugging.\\
 
    All projects include a DOS batch file 'swsim.bat' that invokes the 
    software simulator with the proper parameters. As an example, these are the 
    contents of the 'swsim.bat' file for the 'hello' demo:
 
    \begin{verbatim}
    @rem Run software simulator in hands-off mode
    ..\..\tools\slite\slite\bin\Debug\slite.exe ^
        --bram=hello.code ^
        --trigger=bfc00000 ^
        --noprompt ^
        --nomips32 ^
        --map=hello.map ^
        --trace_log=trace_log.txt
    \end{verbatim}\\
 
    As you can see, the simulator is invoked in 'batch' or 'hands-off' mode, so
    the simulated program will be run to completion, generating a simulation 
    log. The point of this is comparing that log to the log generated by the 
    Modelsim simulation of the same program, as has already been explained.
 
    The python script 'bin2hdl.py' is used to insert binary data on vhdl 
    templates. 
    Assuming you have Python 2.5 or later in your machine, call the script with:
 
    \begin{verbatim}
    python bin2hdl.py --help
    \end{verbatim}\\
 
    to get a short description (see section~\ref{python_script}).
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.