>>

Tips and Tricks¶

This document presents a number of programming techniques for the XMOS XCore XS1 architecture. Some of these methods put instructions specific to the XCore XS1 (eg CRC, LMUL) to, possibly, unexpected uses.

Table of Contents¶

  • Serial and Stream processing
    • Realigning a data stream
      • Using MACCU instructions
      • Realignment using a channel
    • Parsing bit streams
      • Encoding the state in code space
      • Encoding the state transitions in a hash table
      • Parsing an aligned bit stream by sampling
      • Finding the alignment of a bit stream
    • Generating bit streams
  • Numeric processing
    • Pseudo Random Numbers
    • Performing fixed point arithmetic
      • Single word arithmetic
        • Representation
        • Arithmetic
        • Rounding
        • Overflow and Saturation
        • Example code sequence
      • Multi-word arithmetic
    • Computing a logarithm or sqrt
    • Division and modulo
    • Multiplying a double word with a word
  • Computing and Checking CRCs
    • CRC mathematics
    • CRC using digital electronics
    • The polynomial
    • Bit ordering
    • The initial value
    • The CRC that is transmitted
    • Computing a CRC over an odd number of bits
    • XS1 CRC instructions
  • Hash tables
  • Building short FIFOs
  • Using multiple threads for super linear speedup
    • Code structure
    • Timings
    • Code listings for threads
  • Assembly Tips and Tricks
    • Clearing two registers simultaneously
    • Using extra registers
    • Implementing a modulo counter
    • Copying a register simultaneous with a computation

Tips and Tricks

  • Serial and Stream processing
  • Numeric processing
  • Computing and Checking CRCs
  • Hash tables
  • Building short FIFOs
  • Using multiple threads for super linear speedup
  • Assembly Tips and Tricks

Search