#ifndef _INVMATRIX_H
#define _INVMATRIX_H

#define _CRT_SECURE_NO_WARNINGS
#include <HLS/math.h>
#include <stdio.h>
#include <HLS/ac_fixed.h>
#include <HLS/hls.h>

#define NL 16
#define NA 128

typedef  ac_fixed<16, 3, true,AC_RND, AC_WRAP> fixed16; //Default: AC_WRAP, AC_TRN

typedef struct complex_fixed {
	fixed16 real;
	fixed16 imag;
} cfixed_t;

cfixed_t vectormul(
	cfixed_t W_row[NA],
	cfixed_t y_col[NA]);



typedef ihc::mm_host<cfixed_t, ihc::dwidth<1024>, ihc::awidth<10>, ihc::latency<0>,
ihc::waitrequest<true>, ihc::aspace<1>> mm_host_t1;

typedef ihc::mm_host<cfixed_t, ihc::dwidth<1024>, ihc::awidth<2>, ihc::latency<0>, 
ihc::waitrequest<true>, ihc::aspace<2>> mm_host_t2;

typedef ihc::mm_host<cfixed_t, ihc::dwidth<512>, ihc::awidth<4>, ihc::latency<0>, 
ihc::waitrequest<true>, ihc::aspace<3>> mm_host_t3;



component void c_compSTR(ihc::stream_in<cfixed_t> &WStream, 
	ihc::stream_in<cfixed_t> &yStream, 
	ihc::stream_out<cfixed_t> &resStream);
	
component void c_compMM_m(mm_host_t1 &WStream, 
	mm_host_t2 &yStream, 
	mm_host_t3 &resStream);


#endif