Capsim® Text Mode Kernel

Getting Started

Capsim® Text Mode Kernel

 

Documentation

Getting Started

TCL Scripting

Download

Platforms


MSYS/MINGW Installer

Stawberry Perl

Conversion Tool V6

Blocks (Stars)

Sample Applications

Lapack Support

Blosim Papers


Simulation Kernel and Model


SystemC Block Diagram Modeling

 

Getting Started

Download CapsimTMK from here. You can run CapsimTMK from the BIN directory, $CAPSIM/BIN/capsim. Example topologies are included the APPLICATIONS directory. Each application has a README file. To start capsim in the interative mode type:

$CAPSIM/BIN/capsim -b

Set the environment variable CAPSIM to the directory where CapsimTMK resides.

For example,

%export CAPSIM=/usr/local/CapsimTMK

 

Creating Capsim and Adding Models

 

CAPSIM provides the utility to add blocks(stars) to the library through the use of the bash shell program precapsim.sh. This is a separate program from CAPSIM and is run from the UNIX/LINUX shell not from inside CAPSIM. Another program, blockmaint.pl, is also available for library maintenance.


Precapsim and Makefile

the bash shell script precapsim.sh provides all the functionality necessary to create your own personalized version of CAPSIM.

Create a new directory any where on your system. For example WORK. You will be creating blocks and subroutines to incorporate into Capsim in this directory.

Suppose that CapsimTMK is installed in the following directory:

/usr/local/CapsimTMK

Then setup the environment variable CAPSIM as follows:

export CAPSIM=/usr/local/CapsimTMK

Next make the directory you just created the current directory and execute the following:

bash $CAPSIM/TOOLS/precapsim.sh -l

 

(-l is l as in link).

The precapsim.sh shell command will create all the necessary directories and copy all files including Makefiles and scripts from the $CAPSIM directory. It will also create the capsim executable in the current directory.

 

Following the precapsim.sh execution type:

 

make

To execute capsim type:

./capsim -b

You will be in the Capsim TMK interactive environment. Go ahead and quit.

Directory Structure

 

 

 

 

 

 

 

 

 

 

 

 

 

The shell command creates the directories BLOCKS, SUBS, and include. A dummy subroutine and block(star) are also created.

A key point is that the precapsim.sh also copies a Makefile into the current directory. With this Makefile it is very easy to build capsim using your blocks(stars) and subroutines. All you need to do is place a block in the BLOCKS directory and, in the main directory (WORK), type make (twice if first time block is added).

View the Makefile to see how this happens. The BLOCKS directory has a file called blocks.mak . This Makefile has all the necessary dependencies to create the C code from the Block ".s" code. It adds the block to the block database blockdatabase.dat and creates the file krn_libblock.c and the library libblock.a with the object files for the blocks. This is all done automatically. The file blocks.mak itself is created by a perl script blockmake.pl in the $CAPSIM/TOOLS directory. This perl script, given the name of the blocks or *.s, creates a make file for the blocks: blocks.mak.

For more info on the block database and block maintenance see the CapsimTMK document on adding blocks.

The subroutine directory SUBS also has a Makefile and any C subroutine will be compiled and added to the libsubs.a library and linked to capsim.

The include directory is where common include files to the blocks in the BLOCKS and C code in the SUBS directory should be placed. The Makefiles use this directory to search for include files when compiling the blocks and subroutines.

So in a nutshell it is real easy to get started. For the first time just execute precapsim.sh followed by make. Afterwords just type make to update. Just place blocks in the BLOCKS directory and the subroutine C code in the SUBS directory.

When running make, check for errors and correct them. For block compile errors, refer to the C code. Make sure you fix the corresponding .s code.

You can use gdb and ddd to debug the block source code.

Top

Adding Blocks to CapsimTMK

To setup CAPSIM in order to add your own blocks see the CAPSIM Tutorial.
Here is a quick guide:

Creating Blocks Using the Block Generation Tool

To create a block and add it to Capsim do the following (detailed and step by step):

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

       block xsource
       block prfile
       connect xsource0 prfile0
       store test

Its easy to create new blocks and add them to CAPSIM.

Adding C code and calling libraries and subroutines is straight forward.

Finally, if you plan on linking to additional libraries you have to:

1- create a copy of precapsim.sh
2- Add the library to the link path (see the last line in precapsim.sh)
3- Edit your Makefile to use the modified precapsim.sh file.

Top


About || ©2007-2017 Silicon DSP Corporation