
----------------------------------------------------------------------------------------------------
-- Actual File Name      = Wrapped_BOPM_computation_unit_dummy.vhd
-- Title & purpose       = Wrapper for adaptation to interfaces ['HandShake_IN', 'HandShake_OUT'] - Wrapper for adaptation to interfaces ['HandShake_IN', 'HandShake_OUT']
-- Author                = Automaticaly generated by YANGO netlist generator - made by Matthieu PAYET (ADACSYS) - matthieu.payet@adacsys.com
-- Creation Date         = 2016-06-08 09:58
-- Version               = 0.1
-- Simple Description    = Wrapper for adaptation to interfaces ['HandShake_IN', 'HandShake_OUT']
-- Specific issues       = 
-- Speed                 = 
-- Area estimates        = 
-- Tools (version)       = ISE 13.1
-- HDL standard followed = VHDL 2001 standard
-- Revisions & ECOs      = 
----------------------------------------------------------------------------------------------------
	
library IEEE;
use IEEE.std_logic_1164.all;
--------------------------------------------------------------------------------
entity Reduce is 
	generic(
		FlitWidth  : natural                       := 16;
		NbInputMax : natural                       := 63;
		ComHeader  : std_logic_vector);
	port(
		clock   : IN  std_logic;
		reset   : IN  std_logic;
		DataIn  : IN  std_logic_vector(FlitWidth-1 downto 0);
		Rx      : IN  std_logic;
		AckRx   : OUT std_logic;
		DataOut : OUT std_logic_vector(FlitWidth-1 downto 0);
		Tx      : OUT std_logic;
		AckTx   : IN  std_logic);
end entity Reduce;

--------------------------------------------------------------------------------
architecture RTL of Reduce is

	signal NetworkAdapter_HeaderTransmitted  : std_logic_vector(FlitWidth-1 downto 0);
	signal NetworkAdapter_HeaderValid        : std_logic;
	signal NetworkAdapter_InputData          : std_logic_vector(FlitWidth-1 downto 0);
	signal NetworkAdapter_InputDataValid     : std_logic;
	signal NetworkAdapter_OutputData         : std_logic_vector(FlitWidth-1 downto 0);
	signal NetworkAdapter_OutputFifoEmpty    : std_logic;
	signal NetworkAdapter_OutputRead         : std_logic;
	signal NetworkAdapter_PayloadTransmitted : std_logic_vector(FlitWidth-1 downto 0);
	signal NetworkAdapter_PayloadValid       : std_logic;
	signal NetworkAdapter_ReadHeaderFifo     : std_logic;
	signal NetworkAdapter_SendBack           : std_logic;
	signal NetworkAdapter_TerminalBusy       : std_logic;
	signal NetworkAdapter_Transmitted        : std_logic;

begin

	NetworkAdapter: entity work.NetworkAdapter(RTL)
		generic map(
			FlitWidth => FlitWidth
			)
		port map(
			Rst                => reset,
			Clk                => clock,
			OutputData         => NetworkAdapter_OutputData,
			OutputFifoEmpty    => NetworkAdapter_OutputFifoEmpty,
			HeaderTransmitted  => NetworkAdapter_HeaderTransmitted,
			PayloadTransmitted => NetworkAdapter_PayloadTransmitted,
			SendBack           => NetworkAdapter_SendBack,
			TerminalBusy       => NetworkAdapter_TerminalBusy,
			InputData          => NetworkAdapter_InputData,
			HeaderValid        => NetworkAdapter_HeaderValid,
			PayloadValid       => NetworkAdapter_PayloadValid,
			InputDataValid     => NetworkAdapter_InputDataValid,
			OutputRead         => NetworkAdapter_OutputRead,
			Transmitted        => NetworkAdapter_Transmitted,
			ReadHeaderFifo     => NetworkAdapter_ReadHeaderFifo,
			DataIn             => DataIn,
			AckRx              => AckRx,
			Rx                 => Rx,
			Tx                 => Tx,
			DataOut            => DataOut,
			AckTx              => AckTx);
			
	-----------------------------------------------------------------
	-- BOPM_computation_unit_dummy wrapped to be shared.
	ReduceCore: entity work.ReduceCore(RTL)
		generic map(
			ComHeader  => ComHeader,
			NbInputMax => NbInputMax,
			FlitWidth  => FlitWidth
			)
		port map(
			clock              => clock,
			reset              => reset,
			
			InputData          => NetworkAdapter_InputData,
			InputDataValid     => NetworkAdapter_InputDataValid,
			HeaderValid        => NetworkAdapter_HeaderValid,
			PayloadValid       => NetworkAdapter_PayloadValid,
			
			HeaderTransmitted  => NetworkAdapter_HeaderTransmitted,
			PayloadTransmitted => NetworkAdapter_PayloadTransmitted,
			
			Transmitted        => NetworkAdapter_Transmitted,
			
			SendBack           => NetworkAdapter_SendBack,
			TerminalBusy       => NetworkAdapter_TerminalBusy,
			
			OutputData         => NetworkAdapter_OutputData,
			OutputFifoEmpty    => NetworkAdapter_OutputFifoEmpty,
			ReadHeaderFifo     => NetworkAdapter_ReadHeaderFifo,
			OutputRead         => NetworkAdapter_OutputRead
			);
	-----------------------------------------------------------------

end architecture RTL;

