/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(Bank bankID, int cycle) { var label = "Out:"; var busWritten = BusWritten(cycle); if (busWritten == null) { return(NullLabeledValue <long?>(label)); } if (bankID == Bank.Bank_A && busWritten.Equals("A") || bankID == Bank.Bank_B && busWritten.Equals("B")) { // Value var shift = DFBState.GetCySimulatorPrivateField <long>(cycle, "shift"); var r = new LabeledValue <long?>("Out:"); r.Value = shift; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, (int)r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Bus that was written: "A" | "B" | null /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> private static string BusWritten(int cycle) { // Was bus written? int cword; bool busWasWritten; bool busAWritten; bool busBWritten; cword = DFBState.GetCySimulatorPrivateField <int>(cycle, "cword"); busWasWritten = (cword >> 13 & 1) == 1 ? true : false; if (!busWasWritten) { return(null); } // Bus A or B? var busAddr = DFBState.GetCySimulatorPrivateField <int>(cycle, "acuaddr"); // 1 = A, 2 = B busAWritten = busAddr.Equals(1); busBWritten = busAddr.Equals(0); if (busAWritten) { return("A"); } else if (busBWritten) { return("B"); } else { return(null); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(Bank bankID, int cycle) { var label = "Out:"; // ram var field = bankID == Bank.Bank_A ? "DAram" : "DBram"; var ram = DFBState.GetCySimulatorPrivateField <long[]>(cycle, field); // address field = bankID == Bank.Bank_A ? "Aaddrnext" : "Baddrnext"; var address = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // ramVal / output if (address != null && address.HasValue && ram != null) { var r = new LabeledValue <long?>(label); r.Value = (int?)ram[address.Value]; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(Bank bankID, int cycle) { var label = "Out:"; int?val = null; bool busRead_A; bool busRead_B; BusRead(cycle, out busRead_A, out busRead_B); if (bankID == Bank.Bank_A && !busRead_A) { return(NullLabeledValue <long?>(label)); } else if (bankID == Bank.Bank_B && !busRead_B) { return(NullLabeledValue <long?>(label)); } val = DFBState.GetCySimulatorPrivateField <int?>(cycle, "p3bus"); if (val == null || !val.HasValue) { return(NullLabeledValue <long?>(label)); } var r = new LabeledValue <long?>("Out:"); r.Value = Convert.ToInt32(val.Value); r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, (int)r.Value) : ""; return(r); }
/// <summary> /// Bus that was read /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <param name="busA"></param> /// <param name="busB"></param> public static void BusRead(int cycle, out bool busA, out bool busB) { busA = false; busB = false; bool busRead = false; var val = DFBState.GetCySimulatorPrivateField <int?>(cycle, "p3busflag"); if (val != null) { busRead = Convert.ToBoolean(val.Value); } if (!busRead) { return; } int acuaddr1 = 0; val = DFBState.GetCySimulatorPrivateField <int?>(cycle, "acuaddr1"); if (val == null || !val.HasValue) { return; } acuaddr1 = Convert.ToInt32(val.Value); if ((acuaddr1 & 1) != 0) { busA = true; } else { busB = true; } }
/// <summary> /// Create a new instance of this device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <param name="code">Data area section string from the assembly code file</param> public DataRamModel(Bank bankID, int cycle, string code) : base(bankID, cycle, VALUE_WIDTH, ADDR_WIDTH, PIPELINE_DELAY) { // name name = bankID == Bank.Bank_A ? DevicePort.DataRam_A.ToString() : DevicePort.DataRam_B.ToString(); // instructions var instr = ActiveInstr(bankID, cycle); instructions.Add(instr); // connectionInputs connectionInputs = Connections(bankID, cycle); // output output = OutputCalc(bankID, cycle); // ram var field = bankID == Bank.Bank_A ? "DAram" : "DBram"; ram = DFBState.GetCySimulatorPrivateField <long[]>(cycle, field); // address / addressPrev field = bankID == Bank.Bank_A ? "Aaddrnext" : "Baddrnext"; address = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); addressPrev = DFBState.GetCySimulatorPrivateField <int?>(cycle - 1, field); // valuePrev valuePrev = OutputCalc(bankID, cycle - 1).Value; // valueWritten var writeInstr = instructions[0].Equals("write(db)") || instructions[0].Equals("write(da)"); if (writeInstr) { var mux1_Output = Mux1Model.OutputCalc(bankID, cycle); if (mux1_Output.Value.HasValue) { valueWritten = mux1_Output.Value; } } ramItems = BuildRamItems(bankID, this.ram, code); var sb = new StringBuilder(); foreach (var ramItem in RamItems) { sb.AppendFormat("{0,6} {1,8} {2,10} {3,11} {4}\n", "[" + ramItem.Address + "]", ramItem.ValHex, ramItem.ValDfb, ramItem.ValInt, ramItem.Comment); } ramString = sb.ToString().TrimEnd('\n'); }
/// <summary> /// Create a new instance of this device for the given cycle /// </summary> /// <param name="cycle">Zero-based program cycle number</param> public GlobalModel(int cycle) : base(Bank.NotApplicable, cycle, VALUE_WIDTH, ADDR_WIDTH, PIPELINE_DELAY) { // name name = DevicePort.Global.ToString(); // instructions instructions.Add(ActiveInstr(cycle - ALUModel.PIPELINE_DELAY)); // connectionInputs connectionInputs = Connections(cycle); // output output = OutputCalc(cycle); // global_en var global_en = DFBState.GetCySimulatorPrivateField <int[]>(cycle, "global_en"); if (global_en != null) { global_en0 = global_en[0]; global_en1 = global_en[1]; global_en2 = global_en[2]; } satEn = DFBState.GetCySimulatorPrivateField <int?>(cycle, "satEn"); sqcnt = DFBState.GetCySimulatorPrivateField <int?>(cycle, "sqcnt"); sqcval = DFBState.GetCySimulatorPrivateField <int?>(cycle, "sqcval"); satflag = DFBState.GetCySimulatorPrivateField <int?>(cycle, "satflag"); rflag = DFBState.GetCySimulatorPrivateField <int?>(cycle, "rflag"); tflag = DFBState.GetCySimulatorPrivateField <int?>(cycle, "tflag"); tsign = DFBState.GetCySimulatorPrivateField <int?>(cycle, "tsign"); dpsign = DFBState.GetCySimulatorPrivateField <int?>(cycle, "dpsign"); dpeq = DFBState.GetCySimulatorPrivateField <int?>(cycle, "eqflag"); // sem_en0/1/2 var sem_en = DFBState.GetCySimulatorPrivateField <int[]>(cycle, "sem_en"); if (sem_en != null) { sem_en0 = sem_en[0]; sem_en1 = sem_en[1]; sem_en2 = sem_en[2]; } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(int cycle) { var label = "Out:"; var aluout = DFBState.GetCySimulatorPrivateField <long?>(cycle, "aluout"); if (aluout != null) { var r = new LabeledValue <long?>(label); r.Value = aluout; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, (int)r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(int cycle) { var label = "Out:"; var macacc = DFBState.GetCySimulatorPrivateField <long?>(cycle, "MACacc"); if (macacc != null) { int maclower = Convert.ToInt32(macacc >> 23); var r = new LabeledValue <long?>("Out:"); r.Value = maclower; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(Bank bankID, int cycle) { var label = "Out:"; // reg var field = bankID == Bank.Bank_A ? "Aacc" : "Bacc"; var reg_reg = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); if (reg_reg != null) { var r = new LabeledValue <long?>(label); r.Value = reg_reg.Value; r.FormattedValue = r.Value.HasValue ? FormatHex(VALUE_WIDTH, r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(Bank bankID, int cycle) { var label = "Out:"; var field = bankID == DFBStateModel.Bank.Bank_A ? "a1mux" : "b1mux"; var val = DFBState.GetCySimulatorPrivateField <long?>(cycle, field); if (val != null && val.HasValue) { var r = new LabeledValue <long?>(label); r.Value = val.Value; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Output value of the device for the given cycle /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <returns></returns> public static LabeledValue <long?> OutputCalc(int cycle) { var label = "Out:"; if (cycle - PIPELINE_DELAY < 0) { return(NullLabeledValue <long?>(label)); } var val = DFBState.GetCySimulatorPrivateField <long?>(cycle, "shift"); if (val != null && val.HasValue) { var r = new LabeledValue <long?>(label); r.Value = val.Value; r.FormattedValue = r.Value.HasValue ? FormatValue(VALUE_WIDTH, r.Value) : ""; return(r); } else { return(NullLabeledValue <long?>(label)); } }
/// <summary> /// Create a new instance of this device for the given cycle /// </summary> /// <param name="cycle">Zero-based program cycle number</param> public MACModel(int cycle) : base(Bank.NotApplicable, cycle, VALUE_WIDTH, 0, PIPELINE_DELAY) { // name name = DevicePort.MAC.ToString(); // instructions instructions.Add(ActiveInstr(cycle)); // [t-2] instructions.Add(ActiveInstr(cycle - 1)); // [t-1] instructions.Add(ActiveInstr(cycle - 2)); // [now] // connectionInputs connectionInputs = Connections(cycle); // output output = OutputCalc(cycle); // pipelineItems pipelineItems = new List <PipelineItem>(); for (int i = 0; i < instructions.Count; i++) { var instr = instructions[i]; long? aluValue = null; long? a = null; long? b = null; string outputFormula = null; int? accum = null; switch (instr) { case "loadalu": if (i > 0) { // Adds the previous ALU output (from the shifter) to the product and starts a new accumulation. aluValue = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "aluout"); a = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "a2mux"); b = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "b2mux"); if (i == PIPELINE_DELAY) { outputFormula = "a * b + [Prev ALU]"; } } break; case "clra": if (i > 0) { // Clears the accumulator and stores the current product a = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "a2mux"); b = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "b2mux"); if (i == PIPELINE_DELAY) { accum = 0; outputFormula = "a * b"; } } break; case "hold": if (i > 0) { // Holds the value in the accumulator from the previous cycle. No multiply if (i == PIPELINE_DELAY) { accum = Convert.ToInt32(OutputCalc(cycle - i + 1).Value); outputFormula = "Accum"; } } break; case "macc": if (i > 0) { // Multiplies the values on mux2 of side A and side B. // Adds the product to the current value of the accumulator. a = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "a2mux"); b = DFBState.GetCySimulatorPrivateField <long?>(cycle - i + 1, "b2mux"); if (i == PIPELINE_DELAY) { accum = Convert.ToInt32(OutputCalc(cycle - i + 1).Value); outputFormula = "a * b + Accum"; } } break; } var pipelineItem = new PipelineItem(); var lvAluValue = new LabeledValue <long?>("Prev ALU:"); lvAluValue.Value = aluValue.HasValue ? aluValue.Value : (long?)null; lvAluValue.FormattedValue = FormatValue(VALUE_WIDTH, lvAluValue.Value); pipelineItem.AluValue = lvAluValue; var lvA = new LabeledValue <long?>("a:"); lvA.Value = a.HasValue ? a.Value : (long?)null; lvA.FormattedValue = FormatValue(VALUE_WIDTH, lvA.Value); pipelineItem.A = lvA; var lvB = new LabeledValue <long?>("b:"); lvB.Value = b.HasValue ? b.Value : (long?)null; lvB.FormattedValue = FormatValue(VALUE_WIDTH, lvB.Value); pipelineItem.B = lvB; var lvOutputFormula = new LabeledValue <string>("Formula:"); lvOutputFormula.Value = outputFormula; lvOutputFormula.FormattedValue = outputFormula; pipelineItem.OutputFormula = lvOutputFormula; var lvAccum = new LabeledValue <int?>("Accum:"); lvAccum.Value = accum.HasValue ? accum.Value : (int?)null; lvAccum.FormattedValue = FormatValue(VALUE_WIDTH, lvAccum.Value); pipelineItem.Accumulator = lvAccum; pipelineItems.Add(pipelineItem); } }
/// <summary> /// Create a new instance of this device for the given cycle /// </summary> /// <param name="bankID">BankID of the device</param> /// <param name="cycle">Zero-based program cycle number</param> /// <param name="code">Data area section string from the assembly code file</param> public ACUModel(Bank bankID, int cycle, string code) : base(bankID, cycle, VALUE_WIDTH, ADDR_WIDTH, PIPELINE_DELAY) { // ACU values update during simulator makestep(), so properties must be read from previous cycle //cycle -= 1; if (cycle < 0) { return; } // name name = bankID == Bank.Bank_A ? DevicePort.ACU_A.ToString() : DevicePort.ACU_B.ToString(); // instructions var instr = bankID == Bank.Bank_A ? CodeStoreModel.Instruction(cycle).AcuA : CodeStoreModel.Instruction(cycle).AcuB; instructions.Add(instr); // ACU has no connectionInputs // connectionInputs // output output = OutputCalc(bankID, cycle); // reg var field = bankID == Bank.Bank_A ? "Aacc" : "Bacc"; reg_reg = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // freg field = bankID == Bank.Bank_A ? "Afreg" : "Bfreg"; reg_freg = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // mreg field = bankID == Bank.Bank_A ? "Amreg" : "Bmreg"; reg_mreg = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // lreg field = bankID == Bank.Bank_A ? "Alreg" : "Blreg"; reg_lreg = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // flag_mod field = bankID == Bank.Bank_A ? "Amodflag" : "Bmodflag"; reg_flag_mod = DFBState.GetCySimulatorPrivateField <int?>(cycle, field); // ram field = bankID == Bank.Bank_A ? "aacuram" : "bacuram"; ram = DFBState.GetCySimulatorPrivateField <int[]>(cycle, field); // address field = "acuaddr"; address = DFBState.GetCySimulatorPrivateField <int?>(cycle - 0, field); // addressPrev field = "acuaddr"; addressPrev = DFBState.GetCySimulatorPrivateField <int?>(cycle - 1, field); ramItems = BuildRamItems(bankID, this.ram, code); var sb = new StringBuilder(); foreach (var ramItem in RamItems) { sb.AppendFormat("{0,4} {1,4} {2,3} {3}\n", "[" + ramItem.Address + "]", ramItem.ValHex, ramItem.ValInt, ramItem.Comment); } ramString = sb.ToString().TrimEnd('\n'); }
/// <summary> /// Build a list of jump conditions /// </summary> /// <param name="cycle">Zero-based program cycle number</param> /// <param name="instructions"></param> /// <returns></returns> private List <JumpConditionItem> BuildJumpConditionItems(int cycle, List <string> instructions) { var jumpConditionItems = new List <JumpConditionItem>(); var item = new JumpConditionItem(); item.Name = "eob"; item.PipelineDelay = 0; item.T_2Value = true; item.T_1Value = true; item.T_0Value = true; jumpConditionItems.Add(item); Eob = true; item = new JumpConditionItem(); item.Name = "dpsign"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 2, "dpsign")); item.T_1Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 1, "dpsign")); item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "dpsign")); jumpConditionItems.Add(item); DpSign = item.T_0Value; item = new JumpConditionItem(); item.Name = "dpthresh"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 2, "tflag")); item.T_1Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 1, "tflag")); item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "tflag")); jumpConditionItems.Add(item); DpThresh = item.T_0Value; item = new JumpConditionItem(); item.Name = "dpeq"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 2, "eqflag")); item.T_1Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 1, "eqflag")); item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "eqflag")); jumpConditionItems.Add(item); DpEQ = item.T_0Value; item = new JumpConditionItem(); item.Name = "acuaeq"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 1, "aacueq")); item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "aacueq")); jumpConditionItems.Add(item); AcuAEQ = item.T_0Value; item = new JumpConditionItem(); item.Name = "acubeq"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 1, "bacueq")); item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "bacueq")); jumpConditionItems.Add(item); AcuBEQ = item.T_0Value; bool busRead_A_1; bool busRead_B_1; bool busRead_A_0; bool busRead_B_0; BusInModel.BusRead(cycle, out busRead_A_1, out busRead_B_1); BusInModel.BusRead(cycle - 1, out busRead_A_0, out busRead_B_0); item = new JumpConditionItem(); item.Name = "in1"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = busRead_A_1; item.T_0Value = busRead_A_0; jumpConditionItems.Add(item); In1 = item.T_0Value; item = new JumpConditionItem(); item.Name = "in2"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = busRead_B_1; item.T_0Value = busRead_B_0; jumpConditionItems.Add(item); In2 = item.T_0Value; var semT_0 = DFBState.GetCySimulatorPrivateField <int[]>(cycle, "sem"); var sem_enT_2 = DFBState.GetCySimulatorPrivateField <int[]>(cycle + 2, "sem_en"); var sem_enT_1 = DFBState.GetCySimulatorPrivateField <int[]>(cycle + 1, "sem_en"); var sem_enT_0 = DFBState.GetCySimulatorPrivateField <int[]>(cycle + 0, "sem_en"); item = new JumpConditionItem(); item.Name = "sem_0"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(semT_0 == null ? 0 : semT_0[0]); jumpConditionItems.Add(item); Sem0 = item.T_0Value; item = new JumpConditionItem(); item.Name = "sem_en0"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(sem_enT_2 == null ? 0 : sem_enT_2[0]); item.T_1Value = Convert.ToBoolean(sem_enT_1 == null ? 0 : sem_enT_1[0]); item.T_0Value = Convert.ToBoolean(sem_enT_0 == null ? 0 : sem_enT_0[0]); jumpConditionItems.Add(item); item = new JumpConditionItem(); item.Name = "sem_1"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(semT_0 == null ? 0 : semT_0[1]); jumpConditionItems.Add(item); Sem1 = item.T_0Value; item = new JumpConditionItem(); item.Name = "sem_en1"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(sem_enT_2 == null ? 0 : sem_enT_2[1]); item.T_1Value = Convert.ToBoolean(sem_enT_1 == null ? 0 : sem_enT_1[1]); item.T_0Value = Convert.ToBoolean(sem_enT_0 == null ? 0 : sem_enT_0[1]); jumpConditionItems.Add(item); item = new JumpConditionItem(); item.Name = "sem_2"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(semT_0 == null ? 0 : semT_0[2]); jumpConditionItems.Add(item); Sem2 = item.T_0Value; item = new JumpConditionItem(); item.Name = "sem_en2"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(sem_enT_2 == null ? 0 : sem_enT_2[2]); item.T_1Value = Convert.ToBoolean(sem_enT_1 == null ? 0 : sem_enT_1[2]); item.T_0Value = Convert.ToBoolean(sem_enT_0 == null ? 0 : sem_enT_0[2]); jumpConditionItems.Add(item); var global_enT_2 = DFBState.GetCySimulatorPrivateField <int[]>(cycle + 2, "global_en"); var global_enT_1 = DFBState.GetCySimulatorPrivateField <int[]>(cycle + 1, "global_en"); var global_enT_0 = DFBState.GetCySimulatorPrivateField <int[]>(cycle, "global_en"); item = new JumpConditionItem(); item.Name = "glob_in1"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "g1")); jumpConditionItems.Add(item); Glob_Int1 = item.T_0Value; item = new JumpConditionItem(); item.Name = "glob_en1"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(global_enT_2 == null ? 0 : global_enT_2[0]); item.T_1Value = Convert.ToBoolean(global_enT_1 == null ? 0 : global_enT_1[0]); item.T_0Value = Convert.ToBoolean(global_enT_0 == null ? 0 : global_enT_0[0]); jumpConditionItems.Add(item); item = new JumpConditionItem(); item.Name = "glob_in2"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "g2")); jumpConditionItems.Add(item); Glob_Int2 = item.T_0Value; item = new JumpConditionItem(); item.Name = "glob_en2"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(global_enT_2 == null ? 0 : global_enT_2[1]); item.T_1Value = Convert.ToBoolean(global_enT_1 == null ? 0 : global_enT_1[1]); item.T_0Value = Convert.ToBoolean(global_enT_0 == null ? 0 : global_enT_0[1]); jumpConditionItems.Add(item); item = new JumpConditionItem(); item.Name = "sat"; item.PipelineDelay = 1; item.T_2Value = null; item.T_1Value = null; item.T_0Value = Convert.ToBoolean(DFBState.GetCySimulatorPrivateField <int?>(cycle + 0, "satflag")); jumpConditionItems.Add(item); Sat = item.T_0Value; item = new JumpConditionItem(); item.Name = "sat_en"; item.PipelineDelay = 2; item.T_2Value = Convert.ToBoolean(global_enT_2 == null ? 0 : global_enT_2[2]); item.T_1Value = Convert.ToBoolean(global_enT_1 == null ? 0 : global_enT_1[2]); item.T_0Value = Convert.ToBoolean(global_enT_0 == null ? 0 : global_enT_0[2]); jumpConditionItems.Add(item); return(jumpConditionItems); }