<?xml version="1.0"?>
<service name="Reduce" type="simple" version="1.0" category="Communication.Control.Reduce">
  
  
  <parameter default="64" name="FlitWidth" type="numeric"/>
  <parameter default="15" name="NbInputMax" type="numeric"/>
  <parameter default="0" name="ComHeader" type="logic" size="FlitWidth"/>
  
  <input default="1" name="DataIn" size="FlitWidth" type="logic"/>
  <input default="0" name="Rx" size="1" type="logic"/>
  <input default="1" name="AckTx" size="1" type="logic"/>
  
  <output default="1" name="DataOut" size="FlitWidth" type="logic"/>
  <output default="1" name="AckRx" size="1" type="logic"/>
  <output default="1" name="Tx" size="1" type="logic"/>
  
  <interface name="HandShake" direction="IN" number="1">
    <control name="Rx" target="Tx"/>
    <control name="AckRx" target="AckTx"/>
    <data name="DataIn" target="DataOut">
      <sets register="HeaderReceived"  position="0">
      	<tag name="DataID" slice="FlitWidth-1:FlitWidth/2"/>
      	<tag name="X" slice="FlitWidth/2-1:FlitWidth/4"/>
      	<tag name="Y" slice="FlitWidth/4-1:0"/>
      </sets>
      <sets register="PayloadReceived" position="1" />
    </data>
    <protocol position="0" label="Reception request from network" signals="DataIn, Rx"/>
    <protocol position="1" label="Wait for reception acknowledge" signals="AckRx"/>
  </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="HeaderTransmitted" position="0">
      	<tag name="DataID" slice="FlitWidth-1:FlitWidth/2"/>
      	<tag name="X" slice="FlitWidth/2-1:FlitWidth/4"/>
      	<tag name="Y" slice="FlitWidth/4-1:0"/>
      </sets>
      <sets register="PayloadTransmitted" position="1" />
    </data>
    <protocol label="Network send request" position="0" signals="DataOut, Tx"/>
    <protocol label="Wait for send acknowledge" position="1" signals="AckTx"/>
  </interface>
<!-- ============================================================= -->
<!--  <interface name="PacketTransmition" direction="IN" number="1">-->
<!--    <control name="Transmitted"  target="Transmitted"/>-->
<!--    <protocol label="Packet transmitted" position="1" signals="Transmitted"/>-->
<!--  </interface>-->
<!-- ============================================================= -->
<!--  <interface name="HeaderSelection" direction="OUT" number="1">-->
<!--    <data name="HeaderTransmitted"  target="HeaderTransmitted"/>-->
<!--    <protocol label="Select target header" position="1" signals="HeaderTransmitted"/>-->
<!--  </interface>-->
<!-- ============================================================= -->
<!--  <interface name="PayloadSelection" direction="OUT" number="1">-->
<!--    <data name="PayloadTransmitted"  target="PayloadTransmitted"/>-->
<!--    <protocol label="Select target payload" position="1" signals="PayloadTransmitted"/>-->
<!--  </interface>-->
<!-- ============================================================= -->
  
<!-- ============================================================= -->
<!--  <interface name="FIFO_Light" direction="IN" number="1">-->
<!--    <control name="InputDataValid" target="InputDataValid" />-->
<!--    <data name="InputData" target="OutputData" />-->
<!--    <protocol label="Setup Input" position="1" signals="InputData, InputDataValid"/>-->
<!--  </interface>-->
<!-- ============================================================= -->

<!-- ============================================================= -->
<!--  <interface name="BasicBlockLoad" direction="OUT" number="1">-->
<!--    <data name="BBInputs"/>-->
<!--    <protocol label="Setup Basic Block input" position="1" signals="BBInputs"/>-->
<!--  </interface>-->
<!-- ============================================================= -->

<!-- ============================================================= -->
<!--  <interface name="PipelineFilling" direction="OUT" number="1">-->
<!--    <control name="BBInputValid" target="BBInputValid" />-->
<!--    <protocol label="Fill pipeline" position="1" signals="BBInputValid"/>-->
<!--  </interface>-->
<!-- ============================================================= -->

</service>






