kaist-cp / cs492-uarch

31 stars 1 forks source link

About M4(fsm_map) module (fetch stage) of Lab2(Branch Predictor) #23

Closed JongyCysec closed 1 month ago

JongyCysec commented 1 month ago

In the explanation of new M4 module in branch predictor of fetch stage, its functionality is as below.

- Instantiate the branch predictor as a state
- Make a branch prediction based on IMEM response
- Update branch predictor based on branch resolve result

It seems that the distinguishable output from M4 is "branch prediction" which is attached to the resolver in the M5. And such prediction will be passed to M1 and M1 will use such data to calculate next pc.

So, I think map_resolver combinator will be proper instead of fsm_map since module M4 makes and attaches branch prediction on resolver.

Is there something that I miss or misunderstand?

minseongg commented 1 month ago

It seems that there were some confusing lines in the assignment description. Sorry for the confusion.

The intended purpose of "attaching the branch prediction result to the resolver" was not to attach the branch prediction result directly in the M4, but send the branch prediction result as a payload from M4 to M5 and then attach it to the resolver in the M5. It might be easier to understand with the following figure. The red arrows in the figure indicate the path of the branch prediction result.

We have changed the description of M4 as follows:


Make a branch prediction based on the IMEM response, and then attach it to the egress payload.


JongyCysec commented 1 month ago

I 've got what M4 module intended to do. Thank you for sincere explanation.

minseongg commented 1 month ago

Closing, feel free to reopen if you have further questions!