openhwgroup / cv32e40p

CV32E40P is an in-order 4-stage RISC-V RV32IMFCXpulp CPU based on RI5CY from PULP-Platform
https://docs.openhwgroup.org/projects/cv32e40p-user-manual/en/latest
Other
902 stars 399 forks source link

Branch predictor in cv32e40p core will take more time. #951

Open Attaullah786 opened 4 months ago

Attaullah786 commented 4 months ago

Screenshot from 2024-02-22 12-48-30 Screenshot from 2024-02-22 12-48-30

I integrated code of branch predictor in cv32e40p core and try to simulate hello world test in it but it will not give the tests also did not give the error.

pascalgouedo commented 4 months ago

Hi, You have to move cv32e40p directory somewhere else and use following option when launching make command: CV_CORE_PATH=\<your path>/cv32e40p

MikeOpenHWGroup commented 2 months ago

Hi @Attaullah786, did @pascalgouedo answer your question? If so, please close this Issue. If you do not comment within one week, this Issue will be closed.

Attaullah786 commented 2 months ago

Thanks for your answer. When i run the hello world test there is no information about CPI for the test cases. Kindly give me insight about the test cases that gave clock cycles. Thanks

MikeOpenHWGroup commented 2 months ago

Hi @Attaullah786'

there is no information about CPI for the test cases

What do you mean by "CPI"?

Kindly give me insight about the test cases that gave clock cycles.

We have no testcases that track clock cycles and there is no function in the testbench that does this. We do not have any verification requirements to measure clock cycles, so this was not added. Why do you need it?

pascalgouedo commented 2 months ago

Even if clock cycles are not useful for verification purpose, we do measure them in the benchmarks.

You can find a simple example of that in matmul_32b_int one.

Attaullah786 commented 2 months ago

I implemented a dynamic w but branch predictor in cv32e40p core. Now I have to analyze whether the branch predictor reduced the execution time for some branch instructions or not. So I need that execution time. Is there any process in the core already to find it?

MikeOpenHWGroup commented 2 months ago

The CV32E40P implements the mcycle and minstret CSRs. Your test-program could query these.

pascalgouedo commented 2 months ago

I implemented a dynamic w but branch predictor in cv32e40p core. Now I have to analyze whether the branch predictor reduced the execution time for some branch instructions or not. So I need that execution time. Is there any process in the core already to find it?

Already answered above with matmul_32b_int example. To characterize your branch predictor, I advise you to use Embench Iot 0.5 that you can launch on uvm test-bench.