/*****************************************************************************
 *
 * 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 "InputXOR.h"
#include "XOREncrypt.h"

#define __TIMEOUT__ 1000

int sc_main(int sc_argc, char* sc_argv[]){
	
	// 1.Elaboration
  
	// instantiate clock 
	sc_clock clk("clk",10, SC_MS);

	// Modules
	InputXORModule input("input");
	XOREncryptionModule encryptor("encryptor");

	// connect clock
	input.clk(clk);

	/// HARDWARE PORTS (inputMap -> MAP)

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

	// key_in
	sc_fifo<sc_biguint<160> > key_in_fifo;
	input.key_in(key_in_fifo);
	encryptor.key_in(key_in_fifo);

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


	// 2. Execution

	sc_start(__TIMEOUT__, SC_MS);
	
	return 0;
}
