openpower-cores / a2i

Other
243 stars 40 forks source link

The RAW/WAW dependency check in iuq_fxu_dep.vhdl #29

Open Grubby-CPU opened 3 years ago

Grubby-CPU commented 3 years ago

Hi, I am reading the code related to the RAW/WAW dependency detection in the iuq_fxu_dep.vhdl file.

I am curious why do we only need to check the dependency between the current instruction and the instruction in the IS2, RF0, RF1, EX1, EX2 pipeline stage. The code is listed below.

raw_s1_cmp: entity work.iuq_fxu_dep_cmp(iuq_fxu_dep_cmp) 
port map (
     is1_v      => fdec_fdep_is1_s1_vld,

     is2_v      => sp_L2(IS2).ta_vld,
     rf0_v      => sp_L2(RF0).ta_vld,
     rf1_v      => sp_L2(RF1).ta_vld,
     ex1_v      => sp_L2(EX1).ta_vld,
     ex2_v      => sp_L2(EX2).ta_vld,
     lm0_v      => sp_L2_LM(0).ta_vld,
     lm1_v      => sp_L2_LM(1).ta_vld,
     lm2_v      => sp_L2_LM(2).ta_vld,
     lm3_v      => sp_L2_LM(3).ta_vld,
     lm4_v      => sp_L2_LM(4).ta_vld,
     lm5_v      => sp_L2_LM(5).ta_vld,
     lm6_v      => sp_L2_LM(6).ta_vld,
     lm7_v      => sp_L2_LM(7).ta_vld,

     is1_ad     => fdec_fdep_is1_s1,

     is2_ad     => sp_L2(IS2).ta,
     rf0_ad     => sp_L2(RF0).ta,
     rf1_ad     => sp_L2(RF1).ta,
     ex1_ad     => sp_L2(EX1).ta,
     ex2_ad     => sp_L2(EX2).ta,
     lm0_ad     => sp_L2_LM(0).ta,
     lm1_ad     => sp_L2_LM(1).ta,
     lm2_ad     => sp_L2_LM(2).ta,
     lm3_ad     => sp_L2_LM(3).ta,
     lm4_ad     => sp_L2_LM(4).ta,
     lm5_ad     => sp_L2_LM(5).ta,
     lm6_ad     => sp_L2_LM(6).ta,
     lm7_ad     => sp_L2_LM(7).ta,

     ad_hit_b   => RAW_s1_hit_b
);

In other words, why do not need to pay attention to the instruction in EX3, EX4, and the later pipeline stages? I guess bypassing the data might be the answer but I am not sure.

BTW, I think IS1 represents the IU stages before instruction decode and IS2 represents the IU stages after the instruction decode, right?

Many thanks `

Grubby-CPU commented 3 years ago

Dear @openpowerwtf, can you give me some help? Many thanks!