FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > DSP

DSP comp.dsp newsgroup, mailing list

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2010, 04:57 PM
brain
Guest
 
Posts: n/a
Default Porting C54x code to C55x

Hi group!

I'm porting some code written for the C54x to run on the C55x, and one
of the instructions is really giving me a headache. The code:

.cpl_on ; Tell compiler CPL=1
ST #0, 4 ; Store #0 at (SP + 4)

The compiler (cl55) tells me:
"example.asm", ERROR! at line 2: [E0003] This address mode is
invalid in CPL=1
mode
ST #0, 4 ; Store #0 at (SP + 4)

1 Assembly Error, No Assembly Warnings

The code compiles fine with a C54x compiler. I've tried to google the
problem, without finding any solution. Any help with greatly
appreciated.

Reply With Quote
  #2 (permalink)  
Old 02-03-2010, 06:04 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

brain wrote:
> Hi group!
>
> I'm porting some code written for the C54x to run on the C55x, and one
> of the instructions is really giving me a headache. The code:
>
> .cpl_on ; Tell compiler CPL=1
> ST #0, 4 ; Store #0 at (SP + 4)
>
> The compiler (cl55) tells me:
> "example.asm", ERROR! at line 2: [E0003] This address mode is
> invalid in CPL=1
> mode
> ST #0, 4 ; Store #0 at (SP + 4)
>
> 1 Assembly Error, No Assembly Warnings
>
> The code compiles fine with a C54x compiler. I've tried to google the
> problem, without finding any solution. Any help with greatly
> appreciated.


What does the C54 compiler manual say about what .cpl_on does?

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #3 (permalink)  
Old 02-03-2010, 10:22 PM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 3, 6:04*pm, Jerry Avins <j...@ieee.org> wrote:

> What does the C54 compiler manual say about what .cpl_on does?


"The .cpl_on directive begins a block of code in which direct memory
addressing (DMA) is relative to the stack pointer. "
Reply With Quote
  #4 (permalink)  
Old 02-03-2010, 10:30 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

brain wrote:
> On Feb 3, 6:04 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> What does the C54 compiler manual say about what .cpl_on does?

>
> "The .cpl_on directive begins a block of code in which direct memory
> addressing (DMA) is relative to the stack pointer. "


Can the C55x handle DMA the same way?

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #5 (permalink)  
Old 02-03-2010, 11:21 PM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 3, 10:30*pm, Jerry Avins <j...@ieee.org> wrote:

> Can the C55x handle DMA the same way?


To my knowledge, yes.
Reply With Quote
  #6 (permalink)  
Old 02-04-2010, 02:06 AM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

brain wrote:
> On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> Can the C55x handle DMA the same way?

>
> To my knowledge, yes.


Then there's probably a way to tell the compiler to do it, but evidently
the syntax has changed. Can you write a macro that incorporates inline
assembler?

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #7 (permalink)  
Old 02-04-2010, 09:43 AM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 4, 2:06*am, Jerry Avins <j...@ieee.org> wrote:
> brain wrote:
> > On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:

>
> >> Can the C55x handle DMA the same way?

>
> > To my knowledge, yes.

>
> Then there's probably a way to tell the compiler to do it, but evidently
> the syntax has changed. Can you write a macro that incorporates inline
> assembler?


Why should I have to tell the C55x-compiler to do direct memory
addressing like the C54x if they're doing it the same way? One thing
that seems to have changed is how to tell the compiler that it should
do direct memory addressing _relative_ to the SP. The C55x compiler
doesn't understand the ".cpl_on" directive, this information has to be
fed to it via command line options.

I really don't understand your suggestion about inline assembler, I am
already writing in assembler.

/Reine
Reply With Quote
  #8 (permalink)  
Old 02-04-2010, 10:06 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

brain wrote:
> On Feb 4, 2:06 am, Jerry Avins <j...@ieee.org> wrote:
>> brain wrote:
>>> On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:
>>>> Can the C55x handle DMA the same way?
>>> To my knowledge, yes.

>> Then there's probably a way to tell the compiler to do it, but evidently
>> the syntax has changed. Can you write a macro that incorporates inline
>> assembler?

>
> Why should I have to tell the C55x-compiler to do direct memory
> addressing like the C54x if they're doing it the same way? One thing
> that seems to have changed is how to tell the compiler that it should
> do direct memory addressing _relative_ to the SP. The C55x compiler
> doesn't understand the ".cpl_on" directive, this information has to be
> fed to it via command line options.
>
> I really don't understand your suggestion about inline assembler, I am
> already writing in assembler.


In that case, the suggestion makes no sense. It was based on a
misconception. If a command-line option works, is the problem solved?

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #9 (permalink)  
Old 02-04-2010, 11:26 PM
Clay
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 3, 10:57*am, brain <reine...@gmail.com> wrote:
> Hi group!
>
> I'm porting some code written for the C54x to run on the C55x, and one
> of the instructions is really giving me a headache. The code:
>
> * * * * .cpl_on * * * * * * * * ; Tell compiler CPL=1
> * * * * ST #0, 4 * * * * * * * *; Store #0 at (SP+ 4)
>
> The compiler (cl55) tells me:
> "example.asm", ERROR! * at line 2: [E0003] This address mode is
> invalid in CPL=1
> * * * * * * * * * * * * * * * * * * * * mode
> * * * * * * * * ST #0, 4 * * * * * * * *;Store #0 at (SP + 4)
>
> 1 Assembly Error, No Assembly Warnings
>
> The code compiles fine with a C54x compiler. I've tried to google the
> problem, without finding any solution. Any help with greatly
> appreciated.


Does this help?

http://www.datasheetarchive.com/data...A00511910.html


It is TI's C54 to C55 migration guide.

Clay


Reply With Quote
  #10 (permalink)  
Old 02-05-2010, 10:16 AM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 4, 10:06*pm, Jerry Avins <j...@ieee.org> wrote:

> In that case, the suggestion makes no sense. It was based on a
> misconception. If a command-line option works, is the problem solved?


No, the problem isn't solved. Both the C54x and C55x compiler can be
told to do direct memory adressing using the stack pointer, but if
differs in how to tell them (command line versus assembler directive).
But the problem isn't that the compiler doesn't understand that it
should do direct memory addressing relative the stack pointer, the
problem is that the C55x compiler for some reason has a problem
translating the C54x instruction " ST #immediate, Smem" when using SP-
relative addressing.

Thanks for trying to help me.
Reply With Quote
  #11 (permalink)  
Old 02-05-2010, 10:25 AM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 4, 11:26*pm, Clay <c...@claysturner.com> wrote:
> On Feb 3, 10:57*am, brain <reine...@gmail.com> wrote:


> http://www.datasheetarchive.com/data...A00511910.html
>
> It is TI's C54 to C55 migration guide.


Thanks, but I've already read it, and most of the other reference
documentation from TI about C54x/C55x. But this documention gives no
hints that this instruction / way of addressing would be a problem
when porting C54x code to C55x.

/Reine
Reply With Quote
  #12 (permalink)  
Old 02-05-2010, 03:59 PM
Jerry Avins
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

brain wrote:
> On Feb 4, 10:06 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> In that case, the suggestion makes no sense. It was based on a
>> misconception. If a command-line option works, is the problem solved?

>
> No, the problem isn't solved. Both the C54x and C55x compiler can be
> told to do direct memory adressing using the stack pointer, but if
> differs in how to tell them (command line versus assembler directive).
> But the problem isn't that the compiler doesn't understand that it
> should do direct memory addressing relative the stack pointer, the
> problem is that the C55x compiler for some reason has a problem
> translating the C54x instruction " ST #immediate, Smem" when using SP-
> relative addressing.
>
> Thanks for trying to help me.


Thanks for not much, though. I assume that where you wrote "compiler",
you meant "assembler".

Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Reply With Quote
  #13 (permalink)  
Old 02-05-2010, 04:21 PM
brain
Guest
 
Posts: n/a
Default Re: Porting C54x code to C55x

On Feb 5, 3:59*pm, Jerry Avins <j...@ieee.org> wrote:

> Thanks for not much, though. I assume that where you wrote "compiler",
> you meant "assembler".


Both yes and no. I'm actually using the the compiler frontend (cl55),
which itself uses the assembler backend, even if it's perfectly OK to
use the assembler directly yourself.

/Reine
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Simple Q': TI C54x assembler code [email protected] DSP 1 04-19-2006 09:14 PM
Porting Actel code Baxter FPGA 7 08-04-2005 09:51 AM
Porting a software code on a target hardware (processor) dsp_rookie DSP 0 03-02-2005 09:57 PM
32-bit implementation on the 16-bit C54X or C55X machine ??? Gennadiy Polyakov DSP 1 12-23-2004 10:31 AM
Code Migration ---- C54x to C55x Ajith DSP 0 02-12-2004 02:05 PM


All times are GMT +1. The time now is 03:16 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved