Center for Communications and Digital Signal Processing (CCDSP)


CCDSP Silicon DSP Corporation CCDSP Tech Blog

README for CapsimTMK 64 Bit MSYS2

Capsim 64 Bit MSYS2 Announcement

CapsimTMK Installation and User Guides

Congratulations on downloading and installing CAPSIM Text Mode Kernel.

Always check the "Getting Started" section at:
http://capsimtmk.sourceforge.net ( redirected to http://www.ccdsp.or)

To get started you need to define the CAPSIM environment variable.

Execute the command:
pwd

in this directory to get the PATH_TO_CAPSIM_DIRECTORY.

Then set the CAPSIM environment variable:

export CAPSIM=PATH_TO_CAPSIM_DIRECTORY

A good idea is to add this command to your .profile file in your HOME
directory.

An easy way to get started is to go to the directories in the
APPLICATIONS directory in CAPSIM and try out the various applications.

Each application has a README file.

For MSYS2 platform, check the $CAPSIM/MSYS2/BIN directory for a capsim executable.

Point to it to run the provide applications.

An executable CAPSIM is provided in the CAPSIM BIN directory.
To execute CAPSIM from anywhere just type

winpty $CAPSIM/BIN/MSYS2/capsim -b

This will bring up CAPSIM in text mode.

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

1- Create a working directory anywhere. For example call it WORK.
mkdir WORK
2- Change directory to WORK
cd WORK
3- Type ( DO this once!)
bash $CAPSIM/TOOLS/precapsim_msys2.sh


4- The precapsim_msys2.sh bash shell will do all the work. It will create
the BLOCKS directory and copy a dummy block to this directroy.
It will create the SUBS directory. It will copy a Makefile
to the WORK directory. The Makefile will be used to maintain
Blocks and Subroutines to your custom CAPSIM.

Note if you add a new block in the BLOCKS directory use:
bash $CAPSIM/TOOLS/precapsim_msys2.sh
instead of make for the first type to add the blcok to the datatbase. Then use make when you modify blocks.

5 - You must type "make"
make

6- A CAPSIM executable "capsim" will be created in the WORK directory.

7 - To run CAPSIM type

winpty ./capsim -b
on MSYS2.

8- To run CAPSIM with TCL command interpretor active type:

winpty ./capsim -c
on MSYS2.


10- To create a block and add it to Capsim do the following:
A- Change directory to the BLOCKS directory in the WORK directory:
cd BLOCKS
B- Type the following to bring up the Block Generation Graphical Tool:
java -jar $CAPSIM/TOOLS/BlockBuilder.jar
A Graphical Interface will Appear so you can generate a block source code.


C- Select Source Block and set a name (for example xsource).
D- Click on Generate Block.
type the command
perl $CAPSIM/TOOLS/blockgen.pl
to complete the process.
E- The block is generated. View the file:
xsource.s
Or using the name you provided.

F- Change directory to WORK
cd ..
G- Type
bash $CAPSIM/TOOLS/precapsim_msys2.sh
Then type:
make

Once a block is added type make once when you change a block's
source code or a subroutines source code.

H- Bring up CAPSIM
winpty ./capsim -b


I- Type

block xsource
block prfile
connect xsource0 prfile0

J- Store the topology:
store test

K- type
display s
to see "xsource" in the list of blocks

L- Run the simulation.

type:

run


M- You should see a print out with of a constant DC source.
N- Now lets change the source code for "xsource.s".
O- Change directory to BLOCKS.
P- Edit "xsource.s" or your block name.
Change the following in the MAIN_CODE section:
/*
* output the sample
*/
x(0)=1.0*sampleCount*sampleCount/numberOfSamples;

Q- This will output a parabola.
R- Save the block.
S- Change directory to WORK and type make.
cd ..
make
T- Run capsim. Open the saved topology. Run the simulation.
You should see a print of a parabola.
Store in a file and plot.

U- If you run into any errors make sure you check all the
messages for compilation errors.
One thing you can do is go to the BLOCKS directory and type
make -f blocks.mak
Check for errors. Correct. Then type make -f blocks.mak again. When all
errors have been corrected type:
cd ..
make
Run CAPSIM
winpty ./capsim -b


See the CAPSIM Tutorial on using the Block Generation tool.

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_msys2.sh
2- Add the library to the link path
3- Edit your Makefile to use the modified precapsim_msys2.sh file.

++++++++++

http://capsimtmk.sourceforge.net

=======


© 2007-2017 Silicon DSP Corporation