📄 profile-fr500.c
字号:
{ /* 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_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != in_GRi && in_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } if (in_FRk >= 0) { if (use_is_media (cpu, in_FRk)) decrease_FR_busy (cpu, in_FRk, 1); else adjust_float_register_busy (cpu, -1, -1, in_FRk, 1); } if (in_FRdoublek >= 0) { if (use_is_media (cpu, in_FRdoublek)) decrease_FR_busy (cpu, in_FRdoublek, 1); else adjust_float_register_busy (cpu, -1, -1, in_FRdoublek, 1); if (use_is_media (cpu, in_FRdoublek + 1)) decrease_FR_busy (cpu, in_FRdoublek + 1, 1); else adjust_float_register_busy (cpu, -1, -1, in_FRdoublek + 1, 1); } vliw_wait_for_GR (cpu, in_GRi); vliw_wait_for_GR (cpu, in_GRj); vliw_wait_for_FR (cpu, in_FRk); vliw_wait_for_FRdouble (cpu, in_FRdoublek); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRi); load_wait_for_GR (cpu, in_GRj); load_wait_for_FR (cpu, in_FRk); load_wait_for_FRdouble (cpu, in_FRdoublek); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done; return cycles;}intfrvbf_model_fr500_u_fr_r_store (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_GRj, INT in_FRk, INT in_FRdoublek){ int cycles = frvbf_model_fr500_u_fr_store (cpu, idesc, unit_num, referenced, in_GRi, in_GRj, in_FRk, in_FRdoublek); if (model_insn == FRV_INSN_MODEL_PASS_2) { if (CPU_RSTR_INVALIDATE(cpu)) request_cache_invalidate (cpu, CPU_DATA_CACHE (cpu), cycles); } return cycles;}intfrvbf_model_fr500_u_swap (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_GRj, INT out_GRk){ 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_GRi != out_GRk && in_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != out_GRk && in_GRj != in_GRi && in_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } vliw_wait_for_GR (cpu, in_GRi); vliw_wait_for_GR (cpu, in_GRj); vliw_wait_for_GR (cpu, out_GRk); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRi); load_wait_for_GR (cpu, in_GRj); load_wait_for_GR (cpu, out_GRk); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done; /* The latency of GRk will depend on how long it takes to swap the the data from the cache or memory. */ update_GR_latency_for_swap (cpu, out_GRk, cycles); set_use_is_gr_complex (cpu, out_GRk); return cycles;}intfrvbf_model_fr500_u_fr2fr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_FRj, INT out_FRk){ 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. */ if (in_FRj >= 0) { if (use_is_media (cpu, in_FRj)) decrease_FR_busy (cpu, in_FRj, 1); else adjust_float_register_busy (cpu, -1, in_FRj, -1, 1); } if (out_FRk >= 0 && out_FRk != in_FRj) { if (use_is_media (cpu, out_FRk)) decrease_FR_busy (cpu, out_FRk, 1); else adjust_float_register_busy (cpu, -1, -1, out_FRk, 1); } vliw_wait_for_FR (cpu, in_FRj); vliw_wait_for_FR (cpu, out_FRk); handle_resource_wait (cpu); load_wait_for_FR (cpu, in_FRj); load_wait_for_FR (cpu, out_FRk); trace_vliw_wait_cycles (cpu); return 0; } /* The latency of FRj is 3 cycles. */ cycles = idesc->timing->units[unit_num].done; update_FR_latency (cpu, out_FRk, cycles + 3); return cycles;}intfrvbf_model_fr500_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. */ if (in_FRk >= 0) { if (use_is_media (cpu, in_FRk)) decrease_FR_busy (cpu, in_FRk, 1); else adjust_float_register_busy (cpu, -1, in_FRk, -1, 1); } 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_fr500_u_spr2gr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_spr, 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. */ vliw_wait_for_SPR (cpu, in_spr); vliw_wait_for_GR (cpu, out_GRj); handle_resource_wait (cpu); load_wait_for_GR (cpu, out_GRj); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done;#if 0 /* no latency? */ /* The latency of GRj is 2 cycles. */ update_GR_latency (cpu, out_GRj, cycles + 2);#endif return cycles;}intfrvbf_model_fr500_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) { /* 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_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } if (out_FRk >= 0) { if (use_is_media (cpu, out_FRk)) decrease_FR_busy (cpu, out_FRk, 1); else adjust_float_register_busy (cpu, -1, -1, out_FRk, 1); } vliw_wait_for_GR (cpu, in_GRj); vliw_wait_for_FR (cpu, out_FRk); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRj); load_wait_for_FR (cpu, out_FRk); trace_vliw_wait_cycles (cpu); return 0; } /* The latency of FRk is 2 cycles. */ cycles = idesc->timing->units[unit_num].done; update_FR_latency (cpu, out_FRk, cycles + 2); /* Mark this use of the register as NOT a floating point op. */ fr500_reset_fr_flags (cpu, out_FRk); return cycles;}intfrvbf_model_fr500_u_gr2spr (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRj, INT out_spr){ 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_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } vliw_wait_for_GR (cpu, in_GRj); vliw_wait_for_SPR (cpu, out_spr); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRj); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done;#if 0 /* The latency of spr is ? cycles. */ update_SPR_latency (cpu, out_spr, cycles + ?);#endif return cycles;}intfrvbf_model_fr500_u_ici (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_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_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != in_GRi && in_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } vliw_wait_for_GR (cpu, in_GRi); vliw_wait_for_GR (cpu, in_GRj); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRi); load_wait_for_GR (cpu, in_GRj); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done; request_cache_invalidate (cpu, CPU_INSN_CACHE (cpu), cycles); return cycles;}intfrvbf_model_fr500_u_dci (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_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_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != in_GRi && in_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } vliw_wait_for_GR (cpu, in_GRi); vliw_wait_for_GR (cpu, in_GRj); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRi); load_wait_for_GR (cpu, in_GRj); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done; request_cache_invalidate (cpu, CPU_DATA_CACHE (cpu), cycles); return cycles;}intfrvbf_model_fr500_u_dcf (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_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_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != in_GRi && in_GRj >= 0) { if (use_is_gr_complex (cpu, in_GRj)) decrease_GR_busy (cpu, in_GRj, 1); } vliw_wait_for_GR (cpu, in_GRi); vliw_wait_for_GR (cpu, in_GRj); handle_resource_wait (cpu); load_wait_for_GR (cpu, in_GRi); load_wait_for_GR (cpu, in_GRj); trace_vliw_wait_cycles (cpu); return 0; } cycles = idesc->timing->units[unit_num].done; request_cache_flush (cpu, CPU_DATA_CACHE (cpu), cycles); return cycles;}intfrvbf_model_fr500_u_icpl (SIM_CPU *cpu, const IDESC *idesc, int unit_num, int referenced, INT in_GRi, INT in_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_GRi >= 0) { if (use_is_gr_complex (cpu, in_GRi)) decrease_GR_busy (cpu, in_GRi, 1); } if (in_GRj != in_GRi && in_GRj >= 0) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -