DSPRelated.com
Forums

Re: TMS320C30 simulator (sim30)

Started by Keith E. Larson November 1, 2001
Hi Halle

I am not a Matlab user, but I can tell you a little bit about the TI
simulator. Basicaly I dont use the simulator that much, but have had to use
it from time to time.

SIM30 code is generated with the TI C-compiler or assembler and then loaded
in COFF format. Data can also be embedded into the executable COFF file,
but is usualy loaded point by point via a data file that is connected to a
probe point (a breakpoint that is tagged with a different attribute).
Another option requiring a little bit of COFF knowledge is to move an entire
data set in a COFF file of data only. Similarily output is either in the
form of a data or coff file.

Note that MatLab can be used for the following making your original question
a bit vague.

- Create a C source representing your design
- Create coefficients and an input data set
- Create an input output data stream

The last would require a handshake between the two tools. If not one or the
other would speed on past and the data would become unsynchronized. I dont
think MATLAB or SIM30 has handshaking built in so I imagine this would be a
kludge. Example

SIM30 stops at probe point and reads a software gate switch
(a one or zero) from an IO file. SIM30 advances on switch
transistion... NOT LEVEL

MATLAB writes data to/from IO file

MATLAB changes state of switch allowing SIM30 to continue

Repeat...

Then again, MatLab might be able to call SIM30 as a background task (no
GUI)... I dont know. I think you need to enlighten me more with what you
are trying to do

And, BTW, if you have a DSK, the source code can be modified (hopefully by
you) to do anything required. I dont want to say 'I' here since this is not
my project and my schedule these days is pretty full.

Best regards,
Keith Larson
================================================
At 03:44 AM 11/1/01 -0800, you wrote:
>Hi Keith
>
>Sorry to bother you but I need your help/guidance
>
>I am trying to simulate pulse amplitude modulation
>(PAM) using the TI TMS320C30 DSP simulator (SIM3X). >My plan is to generate a source file from within
>matlab (version 5.3) send the information into the
>Sim3x (the sim30 will PAM modulate the data) and
>receive it back into matlab workspace and display it
>using matlab command.
>
>I've been trying to do this but without any success!
>
>My question is do I need a software driver to
>interface matlab and the sim30 (DSP simulator) or it
>can be done without any driver software! >Thanks for your help.
>
>Halle >__________________________________________________
>





hi,Halle
I noticed that mathworks and TI have cooperated on the co-work of
CCS and Matlab. Seems that have a tool kit for simulation with ccs and
matlab together.you can visit www.mathworks.com
good luck
wgchen

-----????-----
???: Keith E. Larson [mailto:]
????: 2001?11?1? 23:22
???: S H;
??: [c3x] Re: TMS320C30 simulator (sim30) Hi Halle

I am not a Matlab user, but I can tell you a little bit about the TI
simulator. Basicaly I dont use the simulator that much, but have had to use
it from time to time.

SIM30 code is generated with the TI C-compiler or assembler and then loaded
in COFF format. Data can also be embedded into the executable COFF file,
but is usualy loaded point by point via a data file that is connected to a
probe point (a breakpoint that is tagged with a different attribute).
Another option requiring a little bit of COFF knowledge is to move an entire
data set in a COFF file of data only. Similarily output is either in the
form of a data or coff file.

Note that MatLab can be used for the following making your original question
a bit vague.

- Create a C source representing your design
- Create coefficients and an input data set
- Create an input output data stream

The last would require a handshake between the two tools. If not one or the
other would speed on past and the data would become unsynchronized. I dont
think MATLAB or SIM30 has handshaking built in so I imagine this would be a
kludge. Example

SIM30 stops at probe point and reads a software gate switch
(a one or zero) from an IO file. SIM30 advances on switch
transistion... NOT LEVEL

MATLAB writes data to/from IO file

MATLAB changes state of switch allowing SIM30 to continue

Repeat...

Then again, MatLab might be able to call SIM30 as a background task (no
GUI)... I dont know. I think you need to enlighten me more with what you
are trying to do

And, BTW, if you have a DSK, the source code can be modified (hopefully by
you) to do anything required. I dont want to say 'I' here since this is not
my project and my schedule these days is pretty full.

Best regards,
Keith Larson
================================================
At 03:44 AM 11/1/01 -0800, you wrote:
>Hi Keith
>
>Sorry to bother you but I need your help/guidance
>
>I am trying to simulate pulse amplitude modulation
>(PAM) using the TI TMS320C30 DSP simulator (SIM3X). >My plan is to generate a source file from within
>matlab (version 5.3) send the information into the
>Sim3x (the sim30 will PAM modulate the data) and
>receive it back into matlab workspace and display it
>using matlab command.
>
>I've been trying to do this but without any success!
>
>My question is do I need a software driver to
>interface matlab and the sim30 (DSP simulator) or it
>can be done without any driver software! >Thanks for your help.
>
>Halle >__________________________________________________
>


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Cobra Gas Powered Scooter. Top speed exceeds 25 mph.
Originally $599.95.
Now $399.95 at Youcansave.com.
http://us.click.yahoo.com/K11sED/OkNDAA/ySSFAA/26EolB/TM
---------------------------------~->

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://groups.yahoo.com/group/c3x

More Groups: http://www.dsprelated.com ">http://docs.yahoo.com/info/terms/



Hi,
halle i think what u want to do is, generate some test data in matlab, which should be loaded as a i/p in simulator, and then the o/p of sim should be able to use by matlab , isn't it?
well, use the memory save command from simulator , the data will be saved as obj file, this obj file contains some header portion and the rest will be data , better open the obj file in VC++, and scroll through, u will notice that ur data is indeed there, now it has to be converted to some txt file so that it can be read in matlab...
obj files donot have EOF charecter, but the length is stored somewhere in the header, locate that, starting from the first data, write this to a txt file till the length which u got from header.
and presto! u got the txt file which can be used in matlab
feel free to contact me in case u have furthur doubts..
bye
manoj
----- Original Message -----
From: Weiguo.Chen
To: Keith E. Larson ; S H ; c...@yahoogroups.com
Sent: Thursday, November 01, 2001 9:17 PM
Subject: [c3x] Re: TMS320C30 simulator (sim30)

hi,Halle
I noticed that mathworks and TI have cooperated on the co-work of
CCS and Matlab. Seems that have a tool kit for simulation with ccs and
matlab together.you can visit www.mathworks.com
good luck
wgchen

-----????-----
???: Keith E. Larson [mailto:k...@ti.com]
????: 2001?11?1? 23:22
???: S H; c...@yahoogroups.com
??: [c3x] Re: TMS320C30 simulator (sim30)Hi Halle

I am not a Matlab user, but I can tell you a little bit about the TI
simulator. Basicaly I dont use the simulator that much, but have had to use
it from time to time.

SIM30 code is generated with the TI C-compiler or assembler and then loaded
in COFF format. Data can also be embedded into the executable COFF file,
but is usualy loaded point by point via a data file that is connected to a
probe point (a breakpoint that is tagged with a different attribute).
Another option requiring a little bit of COFF knowledge is to move an entire
data set in a COFF file of data only. Similarily output is either in the
form of a data or coff file.

Note that MatLab can be used for the following making your original question
a bit vague.

- Create a C source representing your design
- Create coefficients and an input data set
- Create an input output data stream

The last would require a handshake between the two tools. If not one or the
other would speed on past and the data would become unsynchronized. I dont
think MATLAB or SIM30 has handshaking built in so I imagine this would be a
kludge. Example

SIM30 stops at probe point and reads a software gate switch
(a one or zero) from an IO file. SIM30 advances on switch
transistion... NOT LEVEL

MATLAB writes data to/from IO file

MATLAB changes state of switch allowing SIM30 to continue

Repeat...

Then again, MatLab might be able to call SIM30 as a background task (no
GUI)... I dont know. I think you need to enlighten me more with what you
are trying to do

And, BTW, if you have a DSK, the source code can be modified (hopefully by
you) to do anything required. I dont want to say 'I' here since this is not
my project and my schedule these days is pretty full.

Best regards,
Keith Larson
================================================
At 03:44 AM 11/1/01 -0800, you wrote:
>Hi Keith
>
>Sorry to bother you but I need your help/guidance
>
>I am trying to simulate pulse amplitude modulation
>(PAM) using the TI TMS320C30 DSP simulator (SIM3X).
>
>
>My plan is to generate a source file from within
>matlab (version 5.3) send the information into the
>Sim3x (the sim30 will PAM modulate the data) and
>receive it back into matlab workspace and display it
>using matlab command.
>
>I've been trying to do this but without any success!
>
>My question is do I need a software driver to
>interface matlab and the sim30 (DSP simulator) or it
>can be done without any driver software!
>
>
>Thanks for your help.
>
>Halle
>
>
>__________________________________________________
>------------------------ Yahoo! Groups Sponsor ---------------------~-->
Cobra Gas Powered Scooter. Top speed exceeds 25 mph.
Originally $599.95.
Now $399.95 at Youcansave.com.
http://us.click.yahoo.com/K11sED/OkNDAA/ySSFAA/26EolB/TM
---------------------------------~->

_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to c...@yahoogroups.com

To Post: Send an email to c...@yahoogroups.com

To Leave: Send an email to c...@yahoogroups.com

Archives: http://groups.yahoo.com/group/c3x

More Groups: http://docs.yahoo.com/info/terms/" target="_blank" rel="nofollow">http://www.dsprelated.com">http://docs.yahoo.com/info/terms/



_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to c...@yahoogroups.com

To Post: Send an email to c...@yahoogroups.com

To Leave: Send an email to c...@yahoogroups.com

Archives: http://groups.yahoo.com/group/c3x

More Groups: http://www.dsprelated.com


">Yahoo! Terms of Service.



Hello Manoj, Weiguo and Halle

The COFF header definitions are given in the TMS320C3x/C4x Assembly Language
Tools Guide, SPRU035C. Also, not that it matters much, but COFF formated
*.OBJ and *.OUT files are quite similar. And in this case (I am pretty sure
of this but did not actualy fire up SIM30) that file should carry a *.OUT
'executable' extension. The importance of this (should it become important)
would be that the length and location information will also be contained in
the header information.

From your comments it sounds like human readbable ASCII files are easiest.
In this case I would use the DSK utility FILECVRT to create a HEX boot
image. The example below shows a HEX file which includes prepended bus
control, length and load location information. Simply skip those lines.

The DSK debugger also has the ablity to convert numerous data formats, but
not FILECVRT. Luckily I have maintained an open source for this DSK so you
can build whatever tool you need. Again, I would start with FILECVRT and
change the fprintf() to print TI float, decimal or whatever is needed. I
can provide assistance if needed, though I expect this is simple enough.

Cheers,
Keith Larson
TMS320C3x/C4x/VC33 Applications
Texas Instruments Incorporated

FYI: It has been a long time since I have tried this, but if you try to load
a *.OBJ file, or link a *.OBJ to *.OUT without a command file, all sections
are assumed to begin to have linker offset values of zero. In other words,
all sections will attempt to load to address zero, but are otherwise valid
code. I used to see this from time to time when the applications engineers
used to sit on the Hotline. I dont know if the newer tool interfaces are
any smarter or dumber in this regard.

.start "TEST",0x809800
.sect "TEST"
.entry LOOP
LOOP ldp @0F00000h
ldi 5152,AR0
br LOOP

FILE2HEX
0x00000008 Bus Width
0x000010f8 Bus Control ws=7
0x00000001 Dummy Section size
0x00809800 Dummy Start Address
0x00000000 Dummy Data
0x00000003 Section Size
0x00809800 Start Address 'TEST'
0x507000f0
0x08681420
0x60809800
0x00000000 Terminate Load

---
Hi,
halle i think what u want to do is, generate some test data in matlab, which
should be loaded as a i/p in simulator, and then the o/p of sim should be
able to use by matlab , isn't it?

well, use the memory save command from simulator , the data will be saved as
obj file, this obj file contains some header portion and the rest will be
data , better open the obj file in VC++, and scroll through, u will notice
that ur data is indeed there, now it has to be converted to some txt file so
that it can be read in matlab...

obj files donot have EOF charecter, but the length is stored somewhere in
the header, locate that, & starting from the first data, write this to a txt
file till the length which u got from header. and presto! u got the txt
file which can be used in matlab feel free to contact me in case u have
furthur doubts..

bye
manoj


Hello group

This how i have been trying to accept data from the
simulator(Sim30) to MATLAB unfortunately it is not
working.
the following matlab code is an example for a sampled
swept frequency wave which is fed to a the C30
simulator. The C30 simulator program generates an
output file which is then processed by Matlab to
display the frequency response.
-----------------
clear,clc

%get data to matlab produced by C30 simulator

fid = fopen('out1.dat','r');
dsim1 = fscanf(fid,'%x');
fclose('all'); %perform conversion from 2s complement
% This is required due to incompatibility between the
% SIM30 and MATLAB
if dsim1~=[] i=find(dsim1>=2^31);
dsim1(i)=dsim1(i)-2^32;
end

%save to MAT file

save iir.mat dsim1
-------------- Halle --- manoj cherukat <> wrote:
> Hi,
> halle i think what u want to do is, generate some
> test data in matlab, which should be loaded as a i/p
> in simulator, and then the o/p of sim should be able
> to use by matlab , isn't it?
> well, use the memory save command from simulator ,
> the data will be saved as obj file, this obj file
> contains some header portion and the rest will be
> data , better open the obj file in VC++, and scroll
> through, u will notice that ur data is indeed there,
> now it has to be converted to some txt file so that
> it can be read in matlab...
> obj files donot have EOF charecter, but the length
> is stored somewhere in the header, locate that, &
> starting from the first data, write this to a txt
> file till the length which u got from header.
> and presto! u got the txt file which can be used in
> matlab
> feel free to contact me in case u have furthur
> doubts..
> bye
> manoj > ----- Original Message -----
> From: Weiguo.Chen
> To: Keith E. Larson ; S H ;
> Sent: Thursday, November 01, 2001 9:17 PM
> Subject: [c3x] Re: TMS320C30 simulator (sim30) > hi,Halle
> I noticed that mathworks and TI have
> cooperated on the co-work of
> CCS and Matlab. Seems that have a tool kit for
> simulation with ccs and
> matlab together.you can visit www.mathworks.com
> good luck
> wgchen
>
> -----????-----
> ???: Keith E. Larson [mailto:]
> ????: 2001?11?1? 23:22
> ???: S H;
> ??: [c3x] Re: TMS320C30 simulator (sim30) > Hi Halle
>
> I am not a Matlab user, but I can tell you a
> little bit about the TI
> simulator. Basicaly I dont use the simulator that
> much, but have had to use
> it from time to time.
>
> SIM30 code is generated with the TI C-compiler or
> assembler and then loaded
> in COFF format. Data can also be embedded into
> the executable COFF file,
> but is usualy loaded point by point via a data
> file that is connected to a
> probe point (a breakpoint that is tagged with a
> different attribute).
> Another option requiring a little bit of COFF
> knowledge is to move an entire
> data set in a COFF file of data only. Similarily
> output is either in the
> form of a data or coff file.
>
> Note that MatLab can be used for the following
> making your original question
> a bit vague.
>
> - Create a C source representing your design
> - Create coefficients and an input data set
> - Create an input output data stream
>
> The last would require a handshake between the two
> tools. If not one or the
> other would speed on past and the data would
> become unsynchronized. I dont
> think MATLAB or SIM30 has handshaking built in so
> I imagine this would be a
> kludge. Example
>
> SIM30 stops at probe point and reads a software
> gate switch
> (a one or zero) from an IO file. SIM30 advances
> on switch
> transistion... NOT LEVEL
>
> MATLAB writes data to/from IO file
>
> MATLAB changes state of switch allowing SIM30 to
> continue
>
> Repeat...
>
> Then again, MatLab might be able to call SIM30 as
> a background task (no
> GUI)... I dont know. I think you need to
> enlighten me more with what you
> are trying to do
>
> And, BTW, if you have a DSK, the source code can
> be modified (hopefully by
> you) to do anything required. I dont want to say
> 'I' here since this is not
> my project and my schedule these days is pretty
> full.
>
> Best regards,
> Keith Larson
> ================================================
> At 03:44 AM 11/1/01 -0800, you wrote:
> >Hi Keith
> >
> >Sorry to bother you but I need your help/guidance
> >
> >I am trying to simulate pulse amplitude
> modulation
> >(PAM) using the TI TMS320C30 DSP simulator
> (SIM3X).
> >
> >
> >My plan is to generate a source file from within
> >matlab (version 5.3) send the information into
> the
> >Sim3x (the sim30 will PAM modulate the data) and
> >receive it back into matlab workspace and display
> it
> >using matlab command.
> >
> >I've been trying to do this but without any
> success!
> >
> >My question is do I need a software driver to
> >interface matlab and the sim30 (DSP simulator) or
> it
> >can be done without any driver software!
> >
> >
> >Thanks for your help.
> >
> >Halle
> >
> >
>
> >__________________________________________________
> >
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/c3x
>
> More Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ >
>
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
=== message truncated ===