Data types

New to XMOS and XCore? Get started here.
PiotrSzymkowiak
New User
Posts: 2
Joined: Sun Nov 10, 2013 8:56 pm

Data types

Postby PiotrSzymkowiak » Sun Nov 10, 2013 10:25 pm

Hi,

Code: Select all

#include <xs1.h>

out port p = XS1_PORT_1A;

float f;
long long g;

int main(void) {

}
1) It is my first program stored in main.xc file. Why this program is compiled without error (In XC language float and long long are unsupported) ?

2) How does the compiler recognizes the language (by extension - .cpp, .c, .xc) ?

3) How can I view assembler version my main function ?

4) XS1-U8A-64-FB96 has 9 (1-bit) ports called P1A-P1L, but only 5 available when SPI is in use. Is there any way to treat 4-bit P4C, P4D like 1-bit ? For example - for 8 channel I2S audio i need 6 outputs: BCLK, LRCLK, DATA0-3 and additional 3 inputs and 1 output for SPI slave interface.
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Mon Nov 11, 2013 8:17 am

1) floats are supported in the latest tools. I can't speak about long long but I assume the same

2) I believe the tools recognize by extension. You can however provide a flag that tells what kind of source file it is. I believe there is something about this topic inthe tools userguide. I can't check right now, I'm in a train.

3) If you use the command line you can use the --save-temps flag or the -S flag.
The IDE has a disassembly window.

4) if the physical pin is not connected to a 1-bit port you cannot change the multibit ports to 1-bit. However the ports used for spi boot can be reused by the application.
PiotrSzymkowiak
New User
Posts: 2
Joined: Sun Nov 10, 2013 8:56 pm

Postby PiotrSzymkowiak » Mon Nov 11, 2013 11:49 am

Thanks for fast answer !
Bianco wrote: 3) If you use the command line you can use the --save-temps flag or the -S flag.
The IDE has a disassembly window.

4) if the physical pin is not connected to a 1-bit port you cannot change the multibit ports to 1-bit. However the ports used for spi boot can be reused by the application.
3) When I open dissasembly window (Window -> Show view -> Other... -> Debug -> Dissasembly) and click "Project -> Build project" disassembly window is empty.

When I change my Make file:

XCC_FLAGS_Debug = -O0 -g
XCC_FLAGS_Release = -O2 -g

to:

XCC_FLAGS_Debug = -O0 -g -S
XCC_FLAGS_Release = -O2 -g -S

this still don't work. What I have to change in xTIMEcomposer environment ?

4) In the XS1-U6A datasheet (page 27) are connections between XS1 and M25P40: XOD0 -> SO, XOD1 -> CS, XOD10 -> SCK, XOD11 -> SI.

OK. If XOD1 = 1 then 3 pins from 4 are for reuse. Is it necessary to drive XOD1 high at the beginning of my program ? Maybe it is done automatically after booting from flash device ?

5) In the XS1-U6A datasheet (page 17) is information "The USB_VBUS pin must be connected to the USB-connector." but on page 27 this pin is left unconnected. Similary in "Slicekit SU1 Core Board" schematic, too. Why ?

6) Maybe I'm stupid, but I can not feel the difference between "on tile[0]" and "on stdcore[0]".

a) Simple "par" statement run processes on different logical cores (up to 6 or 8),
b) Simple "par" + [[combine]] -> pseudo parallel on the same logical core,
c) "par" + "on tile[x]" -> parallel on different physical cores/tiles (on devices where logical cores > 8),
d) In the "Audio USB 2.0 DJ" reference desig files in main.xc file all process are run on stdcore[0]. I think that it is not logical core, but what ?
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Postby Bianco » Mon Nov 11, 2013 1:36 pm

3) try --save-temps instead of -S. The latter will make the compiler stop after generating the assembly, thus building will not complete. I'm not sure whether this works with the IDE, the IDE may delete all temp files after building.

4) after booting the port resources are released, I assume they will be hi-Z

6) stdcore[] and tile[] are exactly the same. The former has been deprecated in favor of the latter. You should use tile[]

Who is online

Users browsing this forum: No registered users and 2 guests