Single thread at high speed?

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
Juhizo
Member
Posts: 11
Joined: Thu Dec 10, 2009 10:16 pm
Location: Finland

Single thread at high speed?

Post 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 ;)


User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm
Contact:

Post 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.
User avatar
Juhizo
Member
Posts: 11
Joined: Thu Dec 10, 2009 10:16 pm
Location: Finland

Post 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.
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Post 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.
User avatar
Juhizo
Member
Posts: 11
Joined: Thu Dec 10, 2009 10:16 pm
Location: Finland

Post 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 :)
Heater
Respected Member
Posts: 296
Joined: Thu Dec 10, 2009 10:33 pm

Post 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.
yzoer
XCore Addict
Posts: 133
Joined: Tue Dec 15, 2009 10:23 pm

Post 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
Post Reply