AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
241 stars 142 forks source link

Access to FE310-specific performance counters #365

Closed rod-chapman closed 3 years ago

rod-chapman commented 4 years ago

Following PR #362, we can now implement support for the micro-architectural performance counters implemented by the FE310 in the HiFive1. Only 2 such counters are implemented (mhpmcounter3 and 4), controlled by mhpmevent3 and 4 control registers, with specific meaning defined bu the FE310 Reference Manual.

rod-chapman commented 4 years ago

Actually, the counters are specific to the E31 RISC-V core, which is in the FE310-G000, FE310-G002 and FE310-G003 variants, so is common to all, so these can apply to both the HiFive1 and the HiFive1_RevB boards.

So... suggest that the counters are defined in a new public child package of FE310 - perhaps FE310.Perf ???

Fabien-Chouteau commented 4 years ago

Hi Rod,

I prefer FE310.Performance_Monitor based on the documentation chapter name.

rod-chapman commented 4 years ago

FE310.Performance_Monitor is good for me! Do you feel you can adapt the package spec that I sent you, or would you prefer to start from scratch?

Fabien-Chouteau commented 4 years ago

Do you feel you can adapt the package spec that I sent you, or would you prefer to start from scratch?

I thought you were going to do it :)

rod-chapman commented 4 years ago

OK... I will have a go today. Is there a documented coding standard and dev process that I'm supposed to follow?

rod-chapman commented 4 years ago

OK.. I found the Contributing HOWTO... I will go from there...

rod-chapman commented 4 years ago

Hmmm...

RodPro2:drivers rchapman$ git push --set-upstream origin fe310_performance
remote: Permission to AdaCore/Ada_Drivers_Library.git denied to rod-chapman.
fatal: unable to access 'https://github.com/AdaCore/Ada_Drivers_Library.git/': The requested URL returned error: 403

Fabien - do you need to grant me permission to push?

rod-chapman commented 4 years ago

I also sent the CLA (a PDF scan) to contributions@adacore.com

Fabien-Chouteau commented 4 years ago

Fabien - do you need to grant me permission to push?

You have to fork the repo, push a branch on your fork and then open the pull-request.

rod-chapman commented 4 years ago

OK.. PR 370 is open. A first draft is there. I am trying to test it now...