profile-fr400.c
来自「这个是LINUX下的GDB调度工具的源码」· C语言 代码 · 共 2,127 行 · 第 1/4 页
C
2,127 行
}intfrvbf_model_fr400_u_swap (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_GRj, INT out_GRk){ /* Modelling for this unit is the same as for fr500. */ return frvbf_model_fr500_u_swap (cpu, idesc, unit_num, referenced, in_GRi, in_GRj, out_GRk);}intfrvbf_model_fr400_u_fr2gr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRk, INT out_GRj){ int cycles; if (model_insn == FRV_INSN_MODEL_PASS_1) { /* The entire VLIW insn must wait if there is a dependency on a register which is not ready yet. The latency of the registers may be less than previously recorded, depending on how they were used previously. See Table 13-8 in the LSI. */ if (in_FRk >= 0) { if (use_is_media_p4 (cpu, in_FRk) || use_is_media_p6 (cpu, in_FRk)) decrease_FR_busy (cpu, in_FRk, 1); else enforce_full_fr_latency (cpu, in_FRk); } vliw_wait_for_FR (cpu, in_FRk); vliw_wait_for_GR (cpu, out_GRj); handle_resource_wait (cpu); load_wait_for_FR (cpu, in_FRk); load_wait_for_GR (cpu, out_GRj); trace_vliw_wait_cycles (cpu); return 0; } /* The latency of GRj is 2 cycles. */ cycles = idesc->timing->units[unit_num].done; update_GR_latency (cpu, out_GRj, cycles + 2); set_use_is_gr_complex (cpu, out_GRj); return cycles;}intfrvbf_model_fr400_u_spr2gr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_spr, INT out_GRj){ /* Modelling for this unit is the same as for fr500. */ return frvbf_model_fr500_u_spr2gr (cpu, idesc, unit_num, referenced, in_spr, out_GRj);}intfrvbf_model_fr400_u_gr2fr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRj, INT out_FRk){ int cycles; if (model_insn == FRV_INSN_MODEL_PASS_1) { /* Pass 1 is the same as for fr500. */ frvbf_model_fr500_u_gr2fr (cpu, idesc, unit_num, referenced, in_GRj, out_FRk); } /* The latency of FRk is 1 cycles. */ cycles = idesc->timing->units[unit_num].done; update_FR_latency (cpu, out_FRk, cycles + 1); return cycles;}intfrvbf_model_fr400_u_gr2spr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRj, INT out_spr){ /* Modelling for this unit is the same as for fr500. */ return frvbf_model_fr500_u_gr2spr (cpu, idesc, unit_num, referenced, in_GRj, out_spr);}intfrvbf_model_fr400_u_media_1 (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRi, INT in_FRj, INT out_FRk){ int cycles; FRV_PROFILE_STATE *ps; const CGEN_INSN *insn; int busy_adjustment[] = {0, 0}; int *fr; if (model_insn == FRV_INSN_MODEL_PASS_1) return 0; /* The preprocessing can execute right away. */ cycles = idesc->timing->units[unit_num].done; ps = CPU_PROFILE_STATE (cpu); insn = idesc->idata; /* The latency of the registers may be less than previously recorded, depending on how they were used previously. See Table 13-8 in the LSI. */ if (in_FRi >= 0) { if (use_is_fp_load (cpu, in_FRi)) { busy_adjustment[0] = 1; decrease_FR_busy (cpu, in_FRi, busy_adjustment[0]); } else enforce_full_fr_latency (cpu, in_FRi); } if (in_FRj >= 0 && in_FRj != in_FRi) { if (use_is_fp_load (cpu, in_FRj)) { busy_adjustment[1] = 1; decrease_FR_busy (cpu, in_FRj, busy_adjustment[1]); } else enforce_full_fr_latency (cpu, in_FRj); } /* The post processing must wait if there is a dependency on a FR which is not ready yet. */ ps->post_wait = cycles; post_wait_for_FR (cpu, in_FRi); post_wait_for_FR (cpu, in_FRj); post_wait_for_FR (cpu, out_FRk); /* Restore the busy cycles of the registers we used. */ fr = ps->fr_busy; if (in_FRi >= 0) fr[in_FRi] += busy_adjustment[0]; if (in_FRj >= 0) fr[in_FRj] += busy_adjustment[1]; /* The latency of the output register will be at least the latency of the other inputs. Once initiated, post-processing has no latency. */ if (out_FRk >= 0) { update_FR_latency (cpu, out_FRk, ps->post_wait); update_FR_ptime (cpu, out_FRk, 0); } return cycles;}intfrvbf_model_fr400_u_media_1_quad (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRi, INT in_FRj, INT out_FRk){ int cycles; INT dual_FRi; INT dual_FRj; INT dual_FRk; FRV_PROFILE_STATE *ps; int busy_adjustment[] = {0, 0, 0, 0}; int *fr; if (model_insn == FRV_INSN_MODEL_PASS_1) return 0; /* The preprocessing can execute right away. */ cycles = idesc->timing->units[unit_num].done; ps = CPU_PROFILE_STATE (cpu); dual_FRi = DUAL_REG (in_FRi); dual_FRj = DUAL_REG (in_FRj); dual_FRk = DUAL_REG (out_FRk); /* The latency of the registers may be less than previously recorded, depending on how they were used previously. See Table 13-8 in the LSI. */ if (use_is_fp_load (cpu, in_FRi)) { busy_adjustment[0] = 1; decrease_FR_busy (cpu, in_FRi, busy_adjustment[0]); } else enforce_full_fr_latency (cpu, in_FRi); if (dual_FRi >= 0 && use_is_fp_load (cpu, dual_FRi)) { busy_adjustment[1] = 1; decrease_FR_busy (cpu, dual_FRi, busy_adjustment[1]); } else enforce_full_fr_latency (cpu, dual_FRi); if (in_FRj != in_FRi) { if (use_is_fp_load (cpu, in_FRj)) { busy_adjustment[2] = 1; decrease_FR_busy (cpu, in_FRj, busy_adjustment[2]); } else enforce_full_fr_latency (cpu, in_FRj); if (dual_FRj >= 0 && use_is_fp_load (cpu, dual_FRj)) { busy_adjustment[3] = 1; decrease_FR_busy (cpu, dual_FRj, busy_adjustment[3]); } else enforce_full_fr_latency (cpu, dual_FRj); } /* The post processing must wait if there is a dependency on a FR which is not ready yet. */ ps->post_wait = cycles; post_wait_for_FR (cpu, in_FRi); post_wait_for_FR (cpu, dual_FRi); post_wait_for_FR (cpu, in_FRj); post_wait_for_FR (cpu, dual_FRj); post_wait_for_FR (cpu, out_FRk); post_wait_for_FR (cpu, dual_FRk); /* Restore the busy cycles of the registers we used. */ fr = ps->fr_busy; fr[in_FRi] += busy_adjustment[0]; if (dual_FRi >= 0) fr[dual_FRi] += busy_adjustment[1]; fr[in_FRj] += busy_adjustment[2]; if (dual_FRj >= 0) fr[dual_FRj] += busy_adjustment[3]; /* The latency of the output register will be at least the latency of the other inputs. */ update_FR_latency (cpu, out_FRk, ps->post_wait); /* Once initiated, post-processing has no latency. */ update_FR_ptime (cpu, out_FRk, 0); if (dual_FRk >= 0) { update_FR_latency (cpu, dual_FRk, ps->post_wait); update_FR_ptime (cpu, dual_FRk, 0); } return cycles;}intfrvbf_model_fr400_u_media_hilo (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT out_FRkhi, INT out_FRklo){ int cycles; FRV_PROFILE_STATE *ps; if (model_insn == FRV_INSN_MODEL_PASS_1) return 0; /* The preprocessing can execute right away. */ cycles = idesc->timing->units[unit_num].done; ps = CPU_PROFILE_STATE (cpu); /* The post processing must wait if there is a dependency on a FR which is not ready yet. */ ps->post_wait = cycles; post_wait_for_FR (cpu, out_FRkhi); post_wait_for_FR (cpu, out_FRklo); /* The latency of the output register will be at least the latency of the other inputs. Once initiated, post-processing has no latency. */ if (out_FRkhi >= 0) { update_FR_latency (cpu, out_FRkhi, ps->post_wait); update_FR_ptime (cpu, out_FRkhi, 0); } if (out_FRklo >= 0) { update_FR_latency (cpu, out_FRklo, ps->post_wait); update_FR_ptime (cpu, out_FRklo, 0); } return cycles;}intfrvbf_model_fr400_u_media_2 (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRi, INT in_FRj, INT out_ACC40Sk, INT out_ACC40Uk){ int cycles; INT dual_ACC40Sk; INT dual_ACC40Uk; FRV_PROFILE_STATE *ps; int busy_adjustment[] = {0, 0, 0, 0, 0, 0}; int *fr; int *acc; if (model_insn == FRV_INSN_MODEL_PASS_1) return 0; /* The preprocessing can execute right away. */ cycles = idesc->timing->units[unit_num].done; ps = CPU_PROFILE_STATE (cpu); dual_ACC40Sk = DUAL_REG (out_ACC40Sk); dual_ACC40Uk = DUAL_REG (out_ACC40Uk); /* The latency of the registers may be less than previously recorded, depending on how they were used previously. See Table 13-8 in the LSI. */ if (in_FRi >= 0) { if (use_is_fp_load (cpu, in_FRi)) { busy_adjustment[0] = 1; decrease_FR_busy (cpu, in_FRi, busy_adjustment[0]); } else enforce_full_fr_latency (cpu, in_FRi); } if (in_FRj >= 0 && in_FRj != in_FRi) { if (use_is_fp_load (cpu, in_FRj)) { busy_adjustment[1] = 1; decrease_FR_busy (cpu, in_FRj, busy_adjustment[1]); } else enforce_full_fr_latency (cpu, in_FRj); } if (out_ACC40Sk >= 0) { if (acc_use_is_media_p2 (cpu, out_ACC40Sk)) { busy_adjustment[2] = 1; decrease_ACC_busy (cpu, out_ACC40Sk, busy_adjustment[2]); } } if (dual_ACC40Sk >= 0) { if (acc_use_is_media_p2 (cpu, dual_ACC40Sk)) { busy_adjustment[3] = 1; decrease_ACC_busy (cpu, dual_ACC40Sk, busy_adjustment[3]); } } if (out_ACC40Uk >= 0) { if (acc_use_is_media_p2 (cpu, out_ACC40Uk)) { busy_adjustment[4] = 1; decrease_ACC_busy (cpu, out_ACC40Uk, busy_adjustment[4]); } } if (dual_ACC40Uk >= 0) { if (acc_use_is_media_p2 (cpu, dual_ACC40Uk)) { busy_adjustment[5] = 1; decrease_ACC_busy (cpu, dual_ACC40Uk, busy_adjustment[5]); } } /* The post processing must wait if there is a dependency on a FR which is not ready yet. */ ps->post_wait = cycles; post_wait_for_FR (cpu, in_FRi); post_wait_for_FR (cpu, in_FRj); post_wait_for_ACC (cpu, out_ACC40Sk); post_wait_for_ACC (cpu, dual_ACC40Sk); post_wait_for_ACC (cpu, out_ACC40Uk); post_wait_for_ACC (cpu, dual_ACC40Uk); /* Restore the busy cycles of the registers we used. */ fr = ps->fr_busy; acc = ps->acc_busy; fr[in_FRi] += busy_adjustment[0]; fr[in_FRj] += busy_adjustment[1]; if (out_ACC40Sk >= 0) acc[out_ACC40Sk] += busy_adjustment[2]; if (dual_ACC40Sk >= 0) acc[dual_ACC40Sk] += busy_adjustment[3]; if (out_ACC40Uk >= 0) acc[out_ACC40Uk] += busy_adjustment[4]; if (dual_ACC40Uk >= 0) acc[dual_ACC40Uk] += busy_adjustment[5]; /* The latency of the output register will be at least the latency of the other inputs. Once initiated, post-processing will take 1 cycles. */ if (out_ACC40Sk >= 0) { update_ACC_latency (cpu, out_ACC40Sk, ps->post_wait + 1); set_acc_use_is_media_p2 (cpu, out_ACC40Sk); } if (dual_ACC40Sk >= 0) { update_ACC_latency (cpu, dual_ACC40Sk, ps->post_wait + 1); set_acc_use_is_media_p2 (cpu, dual_ACC40Sk); } if (out_ACC40Uk >= 0) { update_ACC_latency (cpu, out_ACC40Uk, ps->post_wait + 1); set_acc_use_is_media_p2 (cpu, out_ACC40Uk); } if (dual_ACC40Uk >= 0) { update_ACC_latency (cpu, dual_ACC40Uk, ps->post_wait + 1); set_acc_use_is_media_p2 (cpu, dual_ACC40Uk); } return cycles;}intfrvbf_model_fr400_u_media_2_quad (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRi, INT in_FRj, INT out_ACC40Sk, INT out_ACC40Uk){ int cycles; INT dual_FRi; INT dual_FRj; INT ACC40Sk_1; INT ACC40Sk_2; INT ACC40Sk_3; INT ACC40Uk_1; INT ACC40Uk_2; INT ACC40Uk_3; FRV_PROFILE_STATE *ps; int busy_adjustment[] = {0, 0, 0, 0, 0, 0, 0 ,0}; int *fr; int *acc; if (model_insn == FRV_INSN_MODEL_PASS_1) return 0; /* The preprocessing can execute right away. */ cycles = idesc->timing->units[unit_num].done; dual_FRi = DUAL_REG (in_FRi); dual_FRj = DUAL_REG (in_FRj); ACC40Sk_1 = DUAL_REG (out_ACC40Sk); ACC40Sk_2 = DUAL_REG (ACC40Sk_1); ACC40Sk_3 = DUAL_REG (ACC40Sk_2); ACC40Uk_1 = DUAL_REG (out_ACC40Uk); ACC40Uk_2 = DUAL_REG (ACC40Uk_1); ACC40Uk_3 = DUAL_REG (ACC40Uk_2); ps = CPU_PROFILE_STATE (cpu); /* The latency of the registers may be less than previously recorded, depending on how they were used previously. See Table 13-8 in the LSI. */ if (use_is_fp_load (cpu, in_FRi)) { busy_adjustment[0] = 1; decrease_FR_busy (cpu, in_FRi, busy_adjustment[0]); } else enforce_full_fr_latency (cpu, in_FRi); if (dual_FRi >= 0 && use_is_fp_load (cpu, dual_FRi)) { busy_adjustment[1] = 1; decrease_FR_busy (cpu, dual_FRi, busy_adjustment[1]); } else enforce_full_fr_latency (cpu, dual_FRi); if (in_FRj != in_FRi) { if (use_is_fp_load (cpu, in_FRj)) { busy_adjustment[2] = 1; decrease_FR_busy (cpu, in_FRj, busy_adjustment[2]); } else enforce_full_fr_latency (cpu, in_FRj); if (dual_FRj >= 0 && use_is_fp_load (cpu, dual_FRj)) { busy_adjustment[3] = 1; decrease_FR_busy (cpu, dual_FRj, busy_adjustment[3]); } else enforce_full_fr_latency (cpu, dual_FRj); } if (out_ACC40Sk >= 0) { if (acc_use_is_media_p2 (cpu, out_ACC40Sk)) { busy_adjustment[4] = 1; decrease_ACC_busy (cpu, out_ACC40Sk, busy_adjustment[4]); } if (ACC40Sk_1 >= 0) { if (acc_use_is_media_p2 (cpu, ACC40Sk_1)) { busy_adjustment[5] = 1; decrease_ACC_busy (cpu, ACC40Sk_1, busy_adjustment[5]); } } if (ACC40Sk_2 >= 0) { if (acc_use_is_media_p2 (cpu, ACC40Sk_2)) { busy_adjustment[6] = 1; decrease_ACC_busy (cpu, ACC40Sk_2, busy_adjustment[6]); } } if (ACC40Sk_3 >= 0) { if (acc_use_is_media_p2 (cpu, ACC40Sk_3)) { busy_adjustment[7] = 1; decrease_ACC_busy (cpu, ACC40Sk_3, busy_adjustment[7]); } } } else if (out_ACC40Uk >= 0) { if (acc_use_is_media_p2 (cpu, out_ACC40Uk)) { busy_adjustment[4] = 1; decrease_ACC_busy (cpu, out_ACC40Uk, busy_adjustment[4]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?