static void Show_ConditionCode() { Text txt = GameObject.Find("Canvas/PipeLine_Panel/IOF/Value").GetComponent <Text>(); txt.text = Excute.Show_OF().ToString(); txt = GameObject.Find("Canvas/PipeLine_Panel/ISF/Value").GetComponent <Text>(); txt.text = Excute.Show_SF().ToString(); txt = GameObject.Find("Canvas/PipeLine_Panel/IZF/Value").GetComponent <Text>(); txt.text = Excute.Show_ZF().ToString(); }
static public void Shown_Log() { if (nlog == 10000) { return; } nlog++; System.IO.StreamWriter sw = new StreamWriter(@"./log.out", true); sw.WriteLine("Clock = " + Updata.Clock.ToString("X")); sw.WriteLine("Fetch:"); sw.WriteLine("Pred_PC = " + Fetch.Show_F_predPC().ToString("X")); sw.WriteLine("Decode:"); sw.Write("state = " + Decode.Show_D_state().ToString() + " ; "); sw.Write("Instr = " + Get_Ins(Decode.Show_D_icode(), Decode.Show_D_ifun()) + " ; "); sw.Write("rA = " + Get_Reg(Decode.Show_D_rA()) + " ; "); sw.Write("rB = " + Get_Reg(Decode.Show_D_rB()) + " ; "); sw.WriteLine(""); sw.Write("valC = " + Decode.Show_D_valC().ToString("X") + " ; "); sw.Write("valP = " + Decode.Show_D_valP().ToString("X") + " ; "); sw.WriteLine(""); sw.WriteLine("Excute:"); sw.Write("state = " + Excute.Show_E_state().ToString() + " ; "); sw.Write("Instr = " + Get_Ins(Excute.Show_E_icode(), Excute.Show_E_ifun()) + " ; "); sw.Write("dstE = " + Get_Reg(Excute.Show_E_dstE()) + " ; "); sw.Write("dstM = " + Get_Reg(Excute.Show_E_dstM()) + " ; "); sw.Write("srcA = " + Get_Reg(Excute.Show_E_srcA()) + " ; "); sw.Write("srcB = " + Get_Reg(Excute.Show_E_srcB()) + " ; "); sw.WriteLine(""); sw.Write("valA = " + Excute.Show_E_valA().ToString("X") + " ; "); sw.Write("valB = " + Excute.Show_E_valB().ToString("X") + " ; "); sw.Write("valC = " + Excute.Show_E_valC().ToString("X") + " ; "); sw.WriteLine(""); sw.Write("OF = " + Excute.Show_OF().ToString() + " ; " + "ZF = " + Excute.Show_ZF().ToString() + " ; "); sw.WriteLine("SF = " + Excute.Show_SF().ToString() + " ; "); sw.WriteLine("Memory:"); sw.Write("state = " + Memory.Show_M_state().ToString() + " ; "); sw.Write("Instr = " + Get_Ins(Memory.Show_M_icode(), Memory.Show_M_ifun()) + " ; "); sw.Write("dstE = " + Get_Reg(Memory.Show_M_dstE()) + " ; "); sw.Write("dstM = " + Get_Reg(Memory.Show_M_dstM()) + " ; "); sw.WriteLine(""); sw.Write("valA = " + Memory.Show_M_valA().ToString("X") + " ; "); sw.Write("valE = " + Memory.Show_M_valE().ToString("X") + " ; "); sw.Write("Cnd = " + Memory.Show_M_Cnd().ToString() + " ; "); sw.WriteLine(""); sw.WriteLine("Write_Back:"); sw.Write("state = " + Write_back.Show_W_state().ToString() + " ; "); sw.Write("Instr = " + Get_Ins(Write_back.Show_W_icode(), Write_back.Show_W_ifun()) + " ; "); sw.Write("dstE = " + Get_Reg(Write_back.Show_W_dstE()) + " ; "); sw.Write("dstM = " + Get_Reg(Write_back.Show_W_dstM()) + " ; "); sw.WriteLine(""); sw.Write("valE = " + Write_back.Show_W_valE().ToString("X") + " ; "); sw.Write("valM = " + Write_back.Show_W_valM().ToString("X") + " ; "); sw.WriteLine(""); for (int i = 0; i < 15; i++) { sw.Write(((Control.Registers)i).ToString() + " = " + Decode.Read_reg(i).ToString("X") + " ; "); if ((i + 1) % 3 == 0) { sw.WriteLine(""); } } sw.WriteLine(""); sw.Close(); }