<?xml version="1.0"?>
<service name="SPI_HS" type="simple" version="1.0" category="Communication">

  <parameter default="16" name="FlitWidth" type="numeric"/>
<!--  <parameter default="1" name="Payload" type="numeric"/>-->
<!--  <parameter default="0" name="Header" size="FlitWidth" type="logic"/>-->
  
  <input  name="cs_spi"   size="1" type="logic"/>
  <input  name="di_spi"   size="1" type="logic"/>
  <output name="do_spi"   size="1" type="logic"/>
  
  <output name="LedRead"  size="1" type="logic"/>
  <output name="NcWire"   size="1" type="logic"/>
  
  <input  name="Rx" size="1" type="logic"/>
  <output name="AckRx" size="1" type="logic"/>
  <input  name="DataIn" size="FlitWidth" type="logic"/>
  
  <output name="Tx" size="1" type="logic"/>
  <input  name="AckTx" size="1" type="logic"/>
  <output name="DataOut" size="FlitWidth" type="logic"/>
  
  <interface name="SPI" direction="INOUT" number="1">
<!--    <control name="clk_spi" target="clk_spi"/>-->
    <control name="cs_spi"  target="cs_spi"/>
    <data name="do_spi" target="di_spi" serialization="FlitWidth"/>
    <data name="di_spi" target="do_spi" serialization="FlitWidth"/>
    <protocol position="0" label="SPI serial data bit output" signals="do_spi, di_spi" values=""/>
  </interface>
  
  <interface name="HandShake" direction="out" number="1">
    <control name="Tx" target="Rx"/>
    <control name="AckTx" target="AckRx"/>
    <data name="DataOut" target="DataIn">
      <sets register="Header" position="0" />
      <sets register="Payload" position="1" />
    </data>
    <protocol label="NetworkOutput" position="0" signals="DataOut, Tx"/>
    <protocol label="WaitOutputAck" position="1" signals="AckTx"/>
  </interface>
  <interface name="HandShake" direction="in" number="1">
    <control name="Rx" target="Tx"/>
    <control name="AckRx" target="AckTx"/>
    <data name="DataIn" target="DataOut">
      <sets register="Header" position="0" />
      <sets register="Payload" position="1" />
    </data>
    <protocol position="0" label="NetworkInput" signals="DataIn, Rx"/>
    <protocol position="1" label="WaitInputAck" signals="AckRx"/>
  </interface>
  
<!--  <interface name="SPI" direction="in" number="1">-->
<!--    <data name="di_spi" target="do_spi"/>-->
<!--  </interface>-->
<!--  <interface name="SPI" direction="out" number="1">-->
<!--    <data name="do_spi" target="di_spi"/>-->
<!--  </interface>-->
<!--  <interface name="Debug" direction="out" number="1">-->
<!--    <data name="leds" target="SPI_LEDs"/>-->
<!--  </interface>-->
  
</service>



