Thread Subject: Porting Matlab code to tms320dm6437 evm

Subject: Porting Matlab code to tms320dm6437 evm

From: Kent System Kulkarni

Date: 12 Mar, 2009 17:42:02

Message: 1 of 7

Hi,
I have my Matlab code ready in the form of different self-designed functions. I want to know which is the best way to port my code on the tms320dm6437 evm board. Which is the best option among the following:
1. Using Matlab compiler to get C code and port it on my board via CCS.
2. Using Embedded Matlab function in Simulink and Real Time Workshop to target my
 board.
3. Manually converting all the code (about 1000 lines) to C and port it via CCS.

Please reply at the earliest.
Thank you in advance.

Sincerely,
Prathamesh Kulkarni.

Subject: Porting Matlab code to tms320dm6437 evm

From: Arnaud Miege

Date: 12 Mar, 2009 20:43:36

Message: 2 of 7


"Kent System Kulkarni" <kulkarniprathamesh@rocketmail.com> wrote in message
news:gpbhha$6t4$1@fred.mathworks.com...
> Hi,
> I have my Matlab code ready in the form of different self-designed
> functions. I want to know which is the best way to port my code on the
> tms320dm6437 evm board. Which is the best option among the following:
> 1. Using Matlab compiler to get C code and port it on my board via CCS.
> 2. Using Embedded Matlab function in Simulink and Real Time Workshop to
> target my
> board.
> 3. Manually converting all the code (about 1000 lines) to C and port it
> via CCS.
>
> Please reply at the earliest.
> Thank you in advance.
>
> Sincerely,
> Prathamesh Kulkarni.

Hi,
Option 1 won't work, that's not what the MATLAB compiler does. Option 2 is
in my view preferable to option 3, but there is actualy an option 4: since
you have Real-Time Workshop, you can generate embeddable C code directly
from MATLAB code using Embedded MATLAB. Embedded MATLAB is a subset of the
MATLAB language that supports code generation for real-time embedded
systems. Have a look at:

http://www.mathworks.com/products/featured/embeddedmatlab/index.html
http://www.mathworks.com/access/helpdesk/help/toolbox/eml/index.html

It might be that you need to modify your MATLAB code slightly to make it
Embedded MATLAB compliant.

HTH,

Arnaud

Subject: Porting Matlab code to tms320dm6437 evm

From: pratham.delight@gmail.com

Date: 14 Mar, 2009 07:47:17

Message: 3 of 7

On Mar 13, 1:43=A0am, "Arnaud Miege"
<arnaud.mi...@nospam.mathworks.co.uk> wrote:
> "Kent System Kulkarni" <kulkarnipratham...@rocketmail.com> wrote in messa=
genews:gpbhha$6t4$1@fred.mathworks.com...
>
>
>
>
>
> > Hi,
> > I have my Matlab code ready in the form of different self-designed
> > functions. I want to know which is the best way to port my code on the
> > tms320dm6437 evm board. Which is the best option among the following:
> > 1. Using Matlab compiler to get C code and port it on my board via CCS.
> > 2. Using Embedded Matlab function in Simulink and Real Time Workshop to
> > target my
> > board.
> > 3. Manually converting all the code (about 1000 lines) to C and port it
> > via CCS.
>
> > Please reply at the earliest.
> > Thank you in advance.
>
> > Sincerely,
> > Prathamesh Kulkarni.
>
> Hi,
> Option 1 won't work, that's not what the MATLAB compiler does. Option 2 i=
s
> in my view preferable to option 3, but there is actualy an option 4: sinc=
e
> you have Real-Time Workshop, you can generate embeddable C code directly
> from MATLAB code using Embedded MATLAB. Embedded MATLAB is a subset of th=
e
> MATLAB language that supports code generation for real-time embedded
> systems. Have a look at:
>
> http://www.mathworks.com/products/featured/embeddedmatlab/index.htmlhttp:=
//www.mathworks.com/access/helpdesk/help/toolbox/eml/index.html
>
> It might be that you need to modify your MATLAB code slightly to make it
> Embedded MATLAB compliant.
>
> HTH,
>
> Arnaud- Hide quoted text -
>
> - Show quoted text -

Hi,
Thank you for your apt reply. My doubt about the fourth option is
whether the C code generated by the Real Time Workshop will be
embeddable in the dm6437 or whether I'll have to port it into the
processor via the Code Composer Studio. Also, as far as I know, I wont
be able to use a few Matlab functions in the Embedded Matlab code.
However, for these functions, there are redy-made blocks in Simulink.
So should I prefer using the second option?

Thank You.
Sincerely,
Prathamesh Kulkarni.

Subject: Porting Matlab code to tms320dm6437 evm

From: Arnaud Miege

Date: 14 Mar, 2009 22:01:15

Message: 4 of 7


<pratham.delight@gmail.com> wrote in message
news:86b43c11-d47b-472a-a49d-7c50dc2915f5@e36g2000prg.googlegroups.com...

Hi,
Thank you for your apt reply. My doubt about the fourth option is
whether the C code generated by the Real Time Workshop will be
embeddable in the dm6437 or whether I'll have to port it into the
processor via the Code Composer Studio. Also, as far as I know, I wont
be able to use a few Matlab functions in the Embedded Matlab code.
However, for these functions, there are redy-made blocks in Simulink.
So should I prefer using the second option?

Thank You.
Sincerely,
Prathamesh Kulkarni.

---------------

Hi,

The C code generated by Real-Time Workshop and Real-Time Workshop Embedded
Coder is ISO-ANSI C code, so should be embeddable on any real-time target,
provided the correct wrapper is wrriten for it. In your case, I would
recommend using Embedded IDE Link CC
(http://www.mathworks.com/products/ccslink/), which will allow to port the C
code generated to Code Composer Studio, which will make it easier to target
your specific processor. Whether you generate the code directly from MATLAB
or from Simulink is difficult to answer without looking at the actual code
(+it's not something I am very familiar with). If you know that there are
MATLAB functions in your code that are not compliant with Embedded MATLAB,
and that it would be difficult/time-consuming to modify the code to make it
compliant with Embedded MATLAB, then maybe you should consider Simulink. I
guess it's what environment you are feeling more at ease with.

HTH,

Arnaud

Subject: Porting Matlab code to tms320dm6437 evm

From: Kent System Kulkarni

Date: 20 Mar, 2009 17:28:01

Message: 5 of 7

"Arnaud Miege" <arnaud.miege@nospam.mathworks.co.uk> wrote in message <gph9fc$kjc$1@fred.mathworks.com>...
>
> <pratham.delight@gmail.com> wrote in message
> news:86b43c11-d47b-472a-a49d-7c50dc2915f5@e36g2000prg.googlegroups.com...
>
> Hi,
> Thank you for your apt reply. My doubt about the fourth option is
> whether the C code generated by the Real Time Workshop will be
> embeddable in the dm6437 or whether I'll have to port it into the
> processor via the Code Composer Studio. Also, as far as I know, I wont
> be able to use a few Matlab functions in the Embedded Matlab code.
> However, for these functions, there are redy-made blocks in Simulink.
> So should I prefer using the second option?
>
> Thank You.
> Sincerely,
> Prathamesh Kulkarni.
>
> ---------------
>
> Hi,
>
> The C code generated by Real-Time Workshop and Real-Time Workshop Embedded
> Coder is ISO-ANSI C code, so should be embeddable on any real-time target,
> provided the correct wrapper is wrriten for it. In your case, I would
> recommend using Embedded IDE Link CC
> (http://www.mathworks.com/products/ccslink/), which will allow to port the C
> code generated to Code Composer Studio, which will make it easier to target
> your specific processor. Whether you generate the code directly from MATLAB
> or from Simulink is difficult to answer without looking at the actual code
> (+it's not something I am very familiar with). If you know that there are
> MATLAB functions in your code that are not compliant with Embedded MATLAB,
> and that it would be difficult/time-consuming to modify the code to make it
> compliant with Embedded MATLAB, then maybe you should consider Simulink. I
> guess it's what environment you are feeling more at ease with.
>
> HTH,
>
> Arnaud
>
Hi,
What I'm planning to do is:
For the inbuilt MATLAB functions like thresholding, which I need, I'll use ready made Simulink blocksets and for inserting my own code in the model, I'll use the Embedded MATLAB block in Simulink. Now, to put your code into this block, it has to be made compatible with the Emedded MATLAB subset. This is achievable to me since I've very few inbuilt functions in my code. I've the model ready in Simulink. However, the problem is it takes infinite time to simulate. I can convert this code to an embeddable code for DM6437 using the Real Time Workshop which creates a CCS project for my code. I can load this project into the board.
My question is: Is the above stated method recommended and widely used method for dumping a Matlab code on a daVinci board? Should I proceed with this?
I have only 15 days in hand. So at this stage should I consider re-writing the code in C?

Subject: Porting Matlab code to tms320dm6437 evm

From: Arnaud Miege

Date: 22 Mar, 2009 08:37:43

Message: 6 of 7

>>
> Hi,
> What I'm planning to do is:
> For the inbuilt MATLAB functions like thresholding, which I need, I'll use
> ready made Simulink blocksets and for inserting my own code in the model,
> I'll use the Embedded MATLAB block in Simulink. Now, to put your code into
> this block, it has to be made compatible with the Emedded MATLAB subset.
> This is achievable to me since I've very few inbuilt functions in my code.
> I've the model ready in Simulink. However, the problem is it takes
> infinite time to simulate. I can convert this code to an embeddable code
> for DM6437 using the Real Time Workshop which creates a CCS project for my
> code. I can load this project into the board.
> My question is: Is the above stated method recommended and widely used
> method for dumping a Matlab code on a daVinci board? Should I proceed with
> this?
> I have only 15 days in hand. So at this stage should I consider re-writing
> the code in C?

I am not a production code generation expert, and without actually seeing
the code/model, it's difficult to answer, but it seems like a reasonable
approach to me. You might also want to consider:

* Real-Time Workshop Embedded Coder
(http://www.mathworks.co.uk/products/rtwembedded/). For the differences
betwen RTW and RTW-EC, see this thread
http://www.mathworks.com/matlabcentral/newsreader/view_thread/246935
* Target Support Package TC2 (for TI C2000 DSP)
(http://www.mathworks.co.uk/products/tic2000/) - if that corresponds to your
processor
* Target Support Package TC6 (for TI C6000 DSP)
(http://www.mathworks.co.uk/products/tic6000/) - if that corresponds to your
processor
* Embedded IDE Link CC (for TI Code Composer Studio)
(http://www.mathworks.co.uk/products/ccslink/)

I would recommend the use of The MathWorks Consulting
(http://www.mathworks.co.uk/services/consulting/jumpstart/) to coach you on
code generation and help you get up to speed quickly with your project,
particularly if you only have 15 days. Contact your MathWorks account
manager who will put you in touch with a consultant.

HTH,

Arnaud

Subject: Porting Matlab code to tms320dm6437 evm

From: ahmed

Date: 4 May, 2009 17:50:17

Message: 7 of 7

I use Target for TI C6000™ to realize DSP feature extraction algorithm from an image on TMS320C6713 processor. I Have CCS 3.3 evaluation version. I like to know the memory storage required for this algorithm and the time of execution, using Simulink or CCS software, is it possible? Notice that I don’t have any DSK.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com