bluespec / Toooba

RISC-V Core; superscalar, out-of-order, multi-core capable; based on RISCY-OOO from MIT
Other
161 stars 36 forks source link

Add a RISC-V standard performance monitoring interface to Toooba, and hookup lot of events to it. #21

Closed jonwoodruff closed 3 years ago

jonwoodruff commented 3 years ago

This has been tested under FreeBSD. Our fork of BBL maps a static 29 events and enables the counters for userspace access. Executables then access them using the unprivileged instructions directly. As far as we know, all standard RISC-V operations and protections for these registers are supported.

quark17 commented 3 years ago

Am I missing something or does this not build? This PR adds imports of PerformanceMonitor and SpecialRegs (when PERFORMANCE_MONITORING is defined, which it is in the Makefile) but the PR does not add those files, so I get errors:

Error: "../../src_Core/CPU/Core.bsv", line 48, column 8: (S0000)
  Cannot find package `PerformanceMonitor'
Error: "../../src_Core/CPU/Core.bsv", line 49, column 8: (S0000)
  Cannot find package `SpecialRegs'
...

Also, were @jrtc27 's comments addressed? Was this perhaps not ready to be merged?

jonwoodruff commented 3 years ago

Hey Julie! There is now a subrepo here, so "git submodule update --init --recursive" is now required. Apologies for sneaking this in! Is there some way to make submodules more "invisible" to the user?

The issues pointed out by @jrtc27 were resolved in the next pull request, as this one was merged post-haste.

quark17 commented 3 years ago

Ah, I see. Sorry!

I believe that BSC did report a warning that a search directory that didn't exist. I should have paid more attention. Perhaps this warning number could be raised to an error (via command-line flags in the build Makefiles), but maybe better would be a target in the Makefiles that looks for the directories and report an error (if missing) that includes the git submodule commands to initialize the submodules. It could also be mentioned in the README.

jonwoodruff commented 3 years ago

Ok, I've made a new pull request with the Makefile trick as well as a small update to the readme.