Question about xk-1.xn and XN files in general

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
landon
Experienced Member
Posts: 71
Joined: Mon Sep 06, 2010 4:05 pm

Question about xk-1.xn and XN files in general

Post by landon »

I read on page 13 of XK-1 hardware manual about the xk-1 XN file - refers to the port mapping, etc.

I've done a find/grep on everything I've imported and the only xk-1.xn files I've seen so far exist under xk1-led-test and xk1-uart-test projects.

Other projects such as the app_xk1_demo.1v0 do not have an .xn file at all though the Makefile has the TARGET = XK-1 variable.

My basic questions are:

1) How is the xk-1.xn file picked up by the compiler?
a) in the case of the app_xk1_demo.1v0, how does the compiler see the port mappings when there is no .xn file in the project at all?

2) In the cases where I've seen an XK-1.xn file, it exists right below the root project folder under which are the build configurations "Debug", etc. Is that the proper place for an .xn

3) I see the tools guide shows the .xn file mainly being used as the target option during xburn or xflash. Is it used any time before that stage?

Very little is said about the .xn file in the Tools Guide or elsewhere [edit: I see now the section on "Describing Target Hardware" in Tools Guide], so I'm trying to understand more about how it's used, when it's used, why it doesn't exist in some example projects and does in others.

Getting my feet wet in XMOS,

Landon


m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Post by m_y »

landon wrote:1) How is the xk-1.xn file picked up by the compiler?
a) in the case of the app_xk1_demo.1v0, how does the compiler see the port mappings when there is no .xn file in the project at all?
There's an environment variable XCC_DEVICE_PATH which is a list of paths searched by the tools for an XN file which matches the -target option. If a project appears to have no XN file, it's because it's picking one up using the -target option.
landon wrote:2) In the cases where I've seen an XK-1.xn file, it exists right below the root project folder under which are the build configurations "Debug", etc. Is that the proper place for an .xn
I'm not sure what the XDE expects but from the tools' point of view it doesn't matter where the XN file is, so long as it can be found in the XCC_DEVICE_PATH (for the -target option), or it's passed in to the compiler along with the rest of the source code.
landon wrote:3) I see the tools guide shows the .xn file mainly being used as the target option during xburn or xflash. Is it used any time before that stage?
Yes. It is used by a number of the underlying tools, notably xcc (the compiler front end) and xmap (the linker).
landon wrote:Getting my feet wet in XMOS,
Don't forget to dry between your toes.
User avatar
landon
Experienced Member
Posts: 71
Joined: Mon Sep 06, 2010 4:05 pm

Post by landon »

Thanks for your answers, I appreciate it.

@m_y:
Don't forget to dry between your toes.
That's great advice!