/*****************************************************************************
 *
 * Copyright (c) 2018-19, Eduard Gerlits, Paula Herber, Josef Treus
 * Westfälische Wilhelms-Universität Münster, AG Embedded Systems 
 * All rights reserved.
 *
 * This file is part of SysCSec
 *
 * SysCSec is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * SysCSec is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with SysCSec.  If not, see <http://www.gnu.org/licenses/>.
 *
 *
 *  Please report any problems or bugs to: sysc.sec@uni-muenster.de
 *
 ****************************************************************************/

#include <systemc.h>
#include "InputIO.h"
#include "IO.h"

#define __TIMEOUT__ 10000

int sc_main(int sc_argc, char* sc_argv[]){
	
	// 1.Elaboration

	// instantiate clock 
	sc_clock clk("clk",10, SC_MS);

	// Modules
	InputIOModule input("input");
	IOModule io("io");

	// connect clock
	input.clk(clk);

	/// HARDWARE PORTS (inputMap -> MAP)

	// io_control_in
	sc_fifo<sc_uint<3> > io_control_in_fifo;
	input.io_control_in(io_control_in_fifo);
	io.io_control_in(io_control_in_fifo);

	// data_in
	sc_fifo<sc_biguint<160> > data_in_fifo;
	input.data_in(data_in_fifo);
	io.data_in(data_in_fifo);

	// p_data_in
	sc_fifo<sc_biguint<960> > p_data_in_fifo;
	input.p_data_in(p_data_in_fifo);
	io.p_data_in(p_data_in_fifo);

	// io_status
	sc_fifo<sc_uint<3> > io_status_fifo;
	input.io_status(io_status_fifo);
	io.io_status(io_status_fifo);

	// data_in
	sc_fifo<sc_biguint<160> > data_out_fifo;
	input.data_out(data_out_fifo);
	io.data_out(data_out_fifo);

	// data_out
	sc_fifo<sc_biguint<960> > p_data_out_fifo;
	input.p_data_out(p_data_out_fifo);
	io.p_data_out(p_data_out_fifo);






	// 2. Execution

	sc_start(__TIMEOUT__, SC_MS);
	
	return 0;
}
