Problems debugging with 11.2.0 tools

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
MaxFlashrom
Experienced Member
Posts: 82
Joined: Fri Nov 05, 2010 2:59 pm

Problems debugging with 11.2.0 tools

Post by MaxFlashrom »

Hi, I've recently installed the latest version of the XMOS tools(11.2.0) on Linux(x86_64) and Windows.
I was running 10.4.2 before.

I am having problems with the debugger in the new version. After changing the XN file to the new format (Packages required) and recompiling, the behaviour is not the same, or as good as the old version. Specifically when I debug code and hit a breakpoint, the debug view no longer shows all the threads which were running and are now suspended, it only shows the thread in which the breakpoint occurred. Also if one just runs with no breakpoints and subsequently presses "suspend" then an arbitrary thread is selected and this is the only one shown. One cannot see what any of the other threads were doing.

Also if one single steps this code snippet the delay takes about 12 seconds.

Code: Select all

#define ONE_MS_DLY 100000U

	timer tmr;
	unsigned t;

	tmr :> t;
	tmr when timerafter(t + ONE_MS_DLY) :> void;
If the event is missed I perhaps could understand a delay of about 2^32 * 10^-9 seconds (100MHz reference clock running a 32-bit timer) = 43 seconds or perhaps half that depending on how before/after is defined. What's less understandable is that the code still runs very slowly in debug mode even with no breakpoints set. The same code steps without delay under the new Linux version.

I believe the L1 does not have hardware breakpoint support and I didn't set any watches. Why can it not run full speed? Many embedded platforms with Von Neumann architectures (shared code and data) simply patch the code at breakpoint locations with software interrupt instructions, replacing it with the original opcodes as required to execute subsequently when stepping.

The code runs fast in debug mode in Linux and works. It runs very slowly in debug mode in Windows and does not execute properly either. It hangs on I/O instructions or they take a very long time in the Windows version; it's behaving as if the L1 reference clock is not running properly.

I am using this XN config file.
I modified for an existing template from the IDE. The tools documentation says the ReferenceFrequency attribute is optional and defaults to 100MHz, which is fine.

Code: Select all

 <Type>Board</Type>
  <Name>XK-1 Development Board</Name>

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

  <Packages>
    <Package id="0" Type="XS1-L1A-TQ128">
      <Nodes>
        <Node Id="0" InPackageId="0" Type="XS1-L1A" Oscillator="13MHz" SystemFrequency="400MHz">
          <Boot>
            <Source Location="SPI:bootFlash"/>
          </Boot>
          <Core Number="0" Reference="stdcore[0]">
			<!-- 
            <Port Location="XS1_PORT_1I" Name="PORT_UART_RX"/>
            <Port Location="XS1_PORT_1J" Name="PORT_UART_TX"/>
     		-->

            <Port Location="XS1_PORT_1J" Name="PORT_BUT_A"/>
            <Port Location="XS1_PORT_1K" Name="PORT_BUT_B"/>
    
            <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"/>

            <Port Location="XS1_PORT_32A" Name="PORT_CTL"/>
          </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"/>
  </JTAGChain>

</Network>

I am just a lucky trailblazing beta tester then?
Max.


User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Post by kris »

Hi Max,

The issue with the threads in the Debug view is known and has been fixed this end. This fix should be available in a point release within the next few weeks. (It was caused by a late change that unfortunately slipped through our testing unnoticed!). Apologies for this.

However, not so sure about the second issue. In general, single stepping over this type of code can prove problematic due to the timer wrapping. We'll take a look this end and let you know.

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

Post by Folknology »

If the Xn had a an xml schema it would make checking it prior to usage much easier both in supporting editors/IDE and the command line, all of the relevant Apache libbraries can be found in XML projects. It would also help point out problems with radical changes on new releases and or simplify migrations from older to newer versions.

Just a thought

regards
Al
User avatar
aleonard
Member
Posts: 15
Joined: Thu Sep 16, 2010 8:19 pm

Post by aleonard »

I am also seeing long delays when debugging with the 11.2.0 tools. I am running them on a mac. I was previously running 10.4.2. Often the debugger will appear to just hang and terminating does not work. The problem is so bad that I've been restarting the IDE when I want to restart my program rather than waiting for the IDE to complete its process. I am using the XC-2 dev board.
Post Reply