Page 1 of 1

Single thread at high speed?

Posted: Sat Dec 12, 2009 2:30 pm
by Juhizo
Hi,
is it possible to run single "thread" at full 400 MIPS speed on some core? I'll see from MIPS chart that four thread gets 100 mips each and so on, could these join to calculate single code without threading? And sorry about my bad english ;)

Re: Single thread at high speed?

Posted: Sat Dec 12, 2009 2:52 pm
by Berni
Nope sadly you cant do that. You need to use threads to get all the MIPS.

You will get used to using threads once you work with it a while.

Re: Single thread at high speed?

Posted: Sat Dec 12, 2009 3:56 pm
by Juhizo
Another question. I've modified VGA 8bpp code and want to do some maths to render graphics. I can't find solution to use sin, cos etc. operands inside XC file. Even including math includes.

Re: Single thread at high speed?

Posted: Sat Dec 12, 2009 4:06 pm
by Heater
XC does not support floating point types.

Do your float maths in C functions called from XC. Or have your main program in C making calls to XC functions to do the output.

You will have to cast to/from floats appropriately. But that has to happen to get onto the display anyway.

Alternatively, harder, find away to do what you want using fixed point arithmetic.

Re: Single thread at high speed?

Posted: Sat Dec 12, 2009 4:55 pm
by Juhizo
Heater wrote:XC does not support floating point types.

Do your float maths in C functions called from XC. Or have your main program in C making calls to XC functions to do the output.

You will have to cast to/from floats appropriately. But that has to happen to get onto the display anyway.

Alternatively, harder, find away to do what you want using fixed point arithmetic.
Thanks, just found that myself from "Programming XC" PDF. Now have to learn how those calls must be done between XC and C. These things are just amazing, learning new things all the time :)

Re: Single thread at high speed?

Posted: Sat Dec 12, 2009 5:10 pm
by Heater
Normal calling from C to XC and vice-versa should be no problem as long as you don't use the unsupported XC types and pointers of course.

By the way, I just discovered that you can pass things like XC chanend and such into C and pass them back from C to XC. Have a look in compat.h

Very useful when you need your C code to input/output data on a channel at some point. Just pass the chanend in to C and have it pass that back to an XC function when it needs to do I/O.

Re: Single thread at high speed?

Posted: Tue Dec 15, 2009 10:57 pm
by yzoer
Fixed point is the way to go, particularly if you need performance. VDP-2 uses a single sine table with an extra 90 degrees worth of data tacked on the end to save space.

-Yvo