XS1-L2 and XN-File

Technical questions regarding the XTC tools and programming with XMOS.
homerJ
Member
Posts: 15
Joined: Tue Mar 08, 2011 12:06 pm

XS1-L2 and XN-File

Post by homerJ »

Hi,

i try to create the XN-File for my XC-Project with the latest xMOS XDE ( 11.2.0 (build 1871) ).
But it doesn't work.
Can somebody post an example or is a download available for this L2-Core ???

this is my XN-File with the error:
Error: XN11049 Network positioning failed (may be unsupported topology).

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">
  <Type>Board</Type>
  <Name>Test Board</Name>

  <Declarations>
    <Declaration>core stdcore[2]</Declaration>
  </Declarations>

  <Packages>
    <Package id="0" Type="XS1-L2A-QF124">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS1-L1A" Oscillator="13MHz" SystemFrequency="400MHz">
          <Boot>
          	<Source Location="SPI:bootFlash"/>
          	<Bootee NodeId="1" Core="0">
          	</Bootee>
          </Boot>
          <Core Number="0" Reference="stdcore[0]">   
            <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO"/>
            <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS"/>
            <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK"/>
            <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI"/>
          </Core>
        </Node>
      	<Node Id="1" InPackageId="1" Type="XS1-L1A" Oscillator="13MHz" SystemFrequency="400MHz">
      		<Boot>
      			<Source Location="XMOSLINK">
      			</Source>
      		</Boot>
      		<Core Number="0" Reference="stdcore[1]">
      		</Core>
      	</Node>
      </Nodes>
    </Package>
  </Packages>

  <Links>
  </Links>

  <ExternalDevices>
    <Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash" Type="AT25FS010">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO"/>
      <Attribute Name="PORT_SPI_SS"   Value="PORT_SPI_SS"/>
      <Attribute Name="PORT_SPI_CLK"  Value="PORT_SPI_CLK"/>
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI"/>
    </Device>
  </ExternalDevices>

  <JTAGChain>
     <JTAGDevice NodeId="0"/>
     <JTAGDevice NodeId="1"/>
  </JTAGChain>

</Network>
Greetings
***


User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Not sure about the boot section there, but this stuff has changed, one is meant to refer tool user guide
See if that helps at all.

*Update - Actually this one is more up to date see chapter 8 Describing Target Hardware

regards
Al
homerJ
Member
Posts: 15
Joined: Tue Mar 08, 2011 12:06 pm

Post by homerJ »

Thanks Folknology,

but in the documents i can't find more informations about L2 devices. :shock:

I'am not able to describe the two cores (internally connected through a XMOS-LINK???) and the master-slave boot sequence (slave core boots via master core)..

Why is it so complicated?
There is no config-xml file for the L2 device....why??
m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Post by m_y »

homerJ wrote:There is no config-xml file for the L2 device....why??
The file you want is an XN file rather than config-xml. You can list all the available targets (i.e. XN files) with "xcc -print-targets". The 10.4.2 and 11.2.0 tools both have a target called XS1-L2A-QF124.

From there you can either use it directly or copy it into your own filespace. The file itself is in (one of) the directories listed in the XCC_DEVICE_PATH environment variable.
User avatar
Paolomio
Experienced Member
Posts: 64
Joined: Tue Oct 05, 2010 7:33 pm

Post by Paolomio »

I'm confused about the XN file for a configuration of two L2's connected via X1LA and X0LB. But I'm even more confused about the syntax of the XN file for L2's. In particular, the links between the two processors in an L2 are defined as:

Code: Select all

  <Links>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LC"/>
      <LinkEndpoint NodeId="1" Link="X1LB"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LD"/>
      <LinkEndpoint NodeId="1" Link="X1LA"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LA"/>
      <LinkEndpoint NodeId="1" Link="X1LD"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LB"/>
      <LinkEndpoint NodeId="1" Link="X1LC"/>
    </Link>
  </Links>
But as I understand it, an L2 is just two L1's, with links E, F, G, and H connected. Shouldn't the be:

Code: Select all

  <Links>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X0LE"/>
      <LinkEndpoint NodeId="1" Link="X0LH"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X0LF"/>
      <LinkEndpoint NodeId="1" Link="X0LG"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X0LG"/>
      <LinkEndpoint NodeId="1" Link="X0LF"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X0LH"/>
      <LinkEndpoint NodeId="1" Link="X0LE"/>
    </Link>
  </Links>
But this results in parse errors...

Reverting to the (un)documented magic values for the link definitions, given a board with two L2's connected between each other X1LA to X0LB, booting separately via two flash devices, I try using the following XN file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">

  <Declarations>
    <Declaration>core stdcore[4]</Declaration>
  </Declarations>

  <Packages>
    <Package ID="0" Type="XS1-L2A-QF124">
	  <Nodes>
	    <Node Id="0" Type="XS1-L1A" InPackageId="0" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	      <Core Number="0" Reference="stdcore[0]">
	        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO0"/>
	        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS0"/>
	        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK0"/>
	        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI0"/>
	        <Port Location="XS1_PORT_1E" Name="ENABLE_XLINK"></Port>
	      	<Port Location="XS1_PORT_1H" Name="SERNUM"></Port>
	      	<Port Location="XS1_PORT_1J" Name="PARAM_RST"></Port>
	      </Core>
	      <Boot>
	      	<Source Location="SPI:bootFlash0"></Source>
	      	<Bootee NodeID="1"></Bootee>
	      </Boot>
	    </Node>
	      	
	    <Node Id="1" Type="XS1-L1A" InPackageID="1" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	    	<Core Number="0" Reference="stdcore[1]">
		      	<Port Location="XS1_PORT_1H" Name="POWER_LED"></Port>
	    	</Core>
	    	<Boot>
	    		<Source Location="XMOSLINK"></Source>
	    	</Boot>
	    </Node>
	  </Nodes>
	</Package>
    
    <Package ID="1" Type="XS1-L2A-QF124">
	    <Nodes>
		    <Node Id="2" Type="XS1-L1A" InPackageID="0" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
		    	<Core Number="0" Reference="stdcore[2]">
			        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO1"/>
			        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS1"/>
			        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK1"/>
			        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI1"/>
			        <Port Location="XS1_PORT_1K" Name="PORT_ETH_TXCLK"/>
			        <Port Location="XS1_PORT_1L" Name="PORT_ETH_TXEN"/>
			        <Port Location="XS1_PORT_1M" Name="PORT_ETH_RXCLK"/>
			        <Port Location="XS1_PORT_1N" Name="PORT_ETH_RXDV"/>
			        <Port Location="XS1_PORT_1O" Name="PORT_ETH_RXER"/>
			        <Port Location="XS1_PORT_1P" Name="PORT_ETH_MDC"/>
			        <Port Location="XS1_PORT_4E" Name="PORT_ETH_RXD"/>
			        <Port Location="XS1_PORT_4F" Name="PORT_ETH_TXD"/>
			        <Port Location="XS1_PORT_8D" Name="PORT_ETH_RST_N_MDIO"/>
		    		<Port Location="XS1_PORT_1E" Name="HB0_LED"></Port>
		    	</Core>
		    	<Boot>
			      	<Source Location="SPI:bootFlash1"></Source>
			      	<Bootee NodeID="3"></Bootee>
		    	</Boot>
		    </Node>
		    
		    <Node Id="3" Type="XS1-L1A" InPackageID="1" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
		    	<Core Number="0" Reference="stdcore[3]">
		    	</Core>
		    	<Boot>
		    		<Source Location="XMOSLINK"></Source>
		    	</Boot>
		     </Node>
	  </Nodes>
	</Package>
  </Packages>

  <Links>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LC"/>
      <LinkEndpoint NodeId="1" Link="X1LB"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LD"/>
      <LinkEndpoint NodeId="1" Link="X1LA"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LA"/>
      <LinkEndpoint NodeId="1" Link="X1LD"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LB"/>
      <LinkEndpoint NodeId="1" Link="X1LC"/>
    </Link>

    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="1" Link="X1LA"/>
      <LinkEndpoint NodeId="2" Link="X0LB"/>
    </Link>

    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LC"/>
      <LinkEndpoint NodeId="3" Link="X1LB"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LD"/>
      <LinkEndpoint NodeId="3" Link="X1LA"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LA"/>
      <LinkEndpoint NodeId="3" Link="X1LD"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LB"/>
      <LinkEndpoint NodeId="3" Link="X1LC"/>
    </Link>
  </Links>

<ExternalDevices>
    <Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash0" Type="10">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO0" />
      <Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS0" />
      <Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK0" />
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI0" />
    </Device>
    
    <Device NodeId="2" Core="0" Class="SPIFlash" Name="bootFlash1" Type="10">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO1" />
      <Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS1" />
      <Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK1" />
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI1" />
    </Device>
  </ExternalDevices>
  
  <JTAGChain>
     <JTAGDevice NodeId="0"/>
     <JTAGDevice NodeId="1"/>
     <JTAGDevice NodeId="2"/>
     <JTAGDevice NodeId="3"/>
  </JTAGChain>
 
</Network>
From this, I get the not-terribly-helpful xmap error message:

Code: Select all

C:\DOCUME~1\Admin\LOCALS~1\Temp\gs_4:102: Error: A00045 Duplicate defined label 'treeLinkProgVal6'
C:\DOCUME~1\Admin\LOCALS~1\Temp\gs_4:238: Error: A00045 Duplicate defined label 'sayHello6'
C:\DOCUME~1\Admin\LOCALS~1\Temp\gs_4:254: Error: A00045 Duplicate defined label 'waitForHello6'
C:\DOCUME~1\Admin\LOCALS~1\Temp\gs_4:259: Error: A00045 Duplicate defined label 'sayHelloAgain6'
xmap: Error: Failed to assemble goblin startup for core 1.
What am I doing wrong, and what's a "goblin startup" anyway?
bartvanderlaan
New User
Posts: 3
Joined: Mon Jan 10, 2011 4:19 pm

Post by bartvanderlaan »

Hello Paolomio,

Did you manage to find out what's wrong with the XN file? I have the exact same situation and questions. I found your posts afterwards...

Thanks,
Bart
MaxFlashrom
Experienced Member
Posts: 82
Joined: Fri Nov 05, 2010 2:59 pm

Post by MaxFlashrom »

Paolomio wrote:

Code: Select all

  <Links>
xmap: Error: Failed to assemble goblin startup for core 1.
What am I doing wrong, and what's a "goblin startup" anyway?
Perhaps, it's a new enterprise for mischievous little troglodytes paying particular attention to elfin safety :)

Seriously, I imagine it's something to do with sections of binary meta-data in an ELF file e.g Dwarf format sections provide symbolic debug information. Such wags, those CS types!

Max.
User avatar
Paolomio
Experienced Member
Posts: 64
Joined: Tue Oct 05, 2010 7:33 pm

Post by Paolomio »

Sorry for the obscenely late response...I long ago found the solution and blanked on posting it here. At least I can atone slightly for future generations...

The problem here turns out to be that the tools require that links be defined between processors if they are defined in the same XN. That is, if you have 2 L2s in your system and they are defined in the XN for that system, they MUST be interconnected via xlink pins. Looks like when the tools see there are two processors in a system they assume they are connected, and the startup routines will then want to establish communication between the parts. The compiler is complaining--via elves, dwarves, and goblins, I guess--that it doesn't know how to configure things, because the xlink definition is not present, and you've specified that the parts exist and thus must be interconnected.

Obviously.

Here's a working XN file (I've stripped out the port definitions for brevity)...

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<Network xmlns="http://www.xmos.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.xmos.com http://www.xmos.com">

  <Declarations>
    <Declaration>core stdcore[4]</Declaration>
  </Declarations>

  <Packages>
    <Package ID="0" Type="XS1-L2A-QF124">
	  <Nodes>
	    <Node Id="0" Type="XS1-L1A" InPackageId="0" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	      <Core Number="0" Reference="stdcore[0]">
	        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO0"/>
	        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS0"/>
	        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK0"/>
	        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI0"/>
	      </Core>
	      <Boot>
	      	<Source Location="SPI:bootFlash0"></Source>
	      	<Bootee NodeID="1"></Bootee>
	      </Boot>
	    </Node>
	    <Node Id="1" Type="XS1-L1A" InPackageId="1" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	    	<Core Number="0" Reference="stdcore[1]">
	    	</Core>
	    	<Boot>
	    		<Source Location="XMOSLINK"></Source>
	    	</Boot>
	    </Node>
	  </Nodes>
    </Package>
    <Package ID="1" Type="XS1-L2A-QF124">
      <Nodes>
	    <Node Id="2" Type="XS1-L1A" InPackageId="0" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	    	<Core Number="0" Reference="stdcore[2]">
		        <Port Location="XS1_PORT_1A" Name="PORT_SPI_MISO1"/>
		        <Port Location="XS1_PORT_1B" Name="PORT_SPI_SS1"/>
		        <Port Location="XS1_PORT_1C" Name="PORT_SPI_CLK1"/>
		        <Port Location="XS1_PORT_1D" Name="PORT_SPI_MOSI1"/>
	    	</Core>
	    	<Boot>
		      	<Source Location="SPI:bootFlash1"></Source>
		      	<Bootee NodeID="3"></Bootee>
	    	</Boot>
	    </Node>
	    <Node Id="3" Type="XS1-L1A" InPackageId="1" Oscillator="20MHz" SystemFrequency="400MHz" ReferenceFrequency="100MHz">
	    	<Core Number="0" Reference="stdcore[3]">
	    	</Core>
	    	<Boot>
	    		<Source Location="XMOSLINK"></Source>
	    	</Boot>
	     </Node>
	  </Nodes>
    </Package>
  </Packages>

  <Links>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LC"/>
      <LinkEndpoint NodeId="1" Link="X1LB"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LD"/>
      <LinkEndpoint NodeId="1" Link="X1LA"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LA"/>
      <LinkEndpoint NodeId="1" Link="X1LD"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="0" Link="X1LB"/>
      <LinkEndpoint NodeId="1" Link="X1LC"/>
    </Link>

    <Link Encoding="2wire" Delays="0,1">
      <LinkEndpoint NodeId="1" Link="X0LA"/>
      <LinkEndpoint NodeId="2" Link="X0LB"/>
    </Link>

    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LC"/>
      <LinkEndpoint NodeId="3" Link="X1LB"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LD"/>
      <LinkEndpoint NodeId="3" Link="X1LA"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LA"/>
      <LinkEndpoint NodeId="3" Link="X1LD"/>
    </Link>
    <Link Encoding="5wire" Delays="0,1">
      <LinkEndpoint NodeId="2" Link="X1LB"/>
      <LinkEndpoint NodeId="3" Link="X1LC"/>
    </Link>
  </Links>

<ExternalDevices>
    <Device NodeId="0" Core="0" Class="SPIFlash" Name="bootFlash0" Type="6">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO0" />
      <Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS0" />
      <Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK0" />
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI0" />
    </Device>
    
    <Device NodeId="2" Core="0" Class="SPIFlash" Name="bootFlash1" Type="6">
      <Attribute Name="PORT_SPI_MISO" Value="PORT_SPI_MISO1" />
      <Attribute Name="PORT_SPI_SS" Value="PORT_SPI_SS1" />
      <Attribute Name="PORT_SPI_CLK" Value="PORT_SPI_CLK1" />
      <Attribute Name="PORT_SPI_MOSI" Value="PORT_SPI_MOSI1" />
    </Device>
  </ExternalDevices>
  
  <JTAGChain>
     <JTAGDevice NodeId="0"/>
     <JTAGDevice NodeId="1"/>
     <JTAGDevice NodeId="2"/>
     <JTAGDevice NodeId="3"/>
  </JTAGChain>
 
</Network>
Note in my case it's the following bit that specifies the interconnect:

Code: Select all

   <Link Encoding="2wire" Delays="0,1">
      <LinkEndpoint NodeId="1" Link="X0LA"/>
      <LinkEndpoint NodeId="2" Link="X0LB"/>
    </Link>
Paul

EDIT: to clarify (maybe), the "goblin" error is really caused by specifying a link endpoint twice in the same file. In my case, the error was originally specifying X1LA twice.