	.section .text.m0, "ax"
	.file	"channelEstAsm.m0.asm"
	// DO NOT MODIFY THE CONTENT ABOVE

	.global channelEstAsm
	channelEstAsm:

	R1:M[0]->BIU1.T0;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	BIU1:Load(T0)(A++) -> M[0](Mode0);
	BIU1:Load(T0)(A++) -> M[1](Mode0);//InputA
	BIU1:Load(T0)(A++) -> M[2](Mode0);//InputB
	BIU1:Load(T0)(A++) -> M[3](Mode0);//Output
	BIU1:Load(T0)(A++) -> M[63](Mode0);//ki
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	R0:M[0] -> IMA0.T0(Mode0);
	R0:M[0] -> IMA1.T0(Mode0);
	R3:M[1] -> BIU3.T1(Mode0);
	R3:M[2] -> BIU3.T2(Mode0) || R2:M[0] -> IMA2.T0(Mode0);
	R2:M[3] -> BIU2.T0(Mode0);//output1
	R1:M[4] -> BIU1.T0(Mode0);//output2
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	IMA0:SetShiftMode(T0) -> SHIFTMODE0(Mode0);
	IMA1:SetShiftMode(T0) -> SHIFTMODE0(Mode0);
	IMA2:SetShiftMode(T0) -> SHIFTMODE0(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	R5:PreConfig(M[63])(Mode0);
	R5:WriteConf(Mfetch)->KI[0-3](Mode0);
	R5:WriteConf(Mfetch)->KI[4-7](Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;

MFetch:LPTO %Double @(KI1 - 0);
	IMA0:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA0.MR(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
MFetch:LPTO %ComplexMult_Loop @(KI0 - 0);
	BIU3:Load(T1)(A++)-> IMA0.T1(Mode0);  // 向量A元素
	BIU3:Load(T2)(A++)-> IMA0.T2(Mode0);  // 向量B元素
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	// 进行复数乘法
	IMA0: MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA0.MR(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	//IMA1: T2 + T3(S)(T) -> IMA1.T3(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
ComplexMult_Loop:
	IMA0: MR + 0*0(ShiftMode0)(C)(S)(SSS)(T) -> BIU2.T1(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	BIU2:Store(T1,T0)(Mode0)(A++);
	NOP;
Double:

	MFetch:Repeat @(10);
	MFetch:MPU.STOP;


