-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VTA] add support to event counters #3347
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question regarding the event counters in this example: does cycle count get reset every time we invoke the simulator on a new "workload"?
I suggest that @tqchen also takes a look at how profile information is retrieved |
vta/python/vta/testing/simulator.py
Outdated
Returns | ||
------- | ||
stats : dict | ||
Current profiler statistics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that we are not returning a dictionary here; perhaps we should to accommodate for more profile information (and use the "cycles" as a key for the cycle count)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not because I am just returning a cycle element at the moment. I was thinking that once we think on a second counter, we can added then.
The event counter can be set to zero from software and hardware. In this particular case, the counter is counting only when this condition is met
This basically means when VTA launches but is not finished. I also added this to tsim-driver just to show how to set the counter from zero but in this case really does not matter. Also, the idea of this PR is to provide a mechanism (hardware) that can automatically generate event-counter-register and map addresses accordingly in hardware, see how the VCR looks now The "final" take on the number of counters and what we would want to count should come next after this. |
* can count the total number of clock cycles spent in a VTA run by checking | ||
* launch and finish signals. | ||
* | ||
* The event counter value is passed to the VCR module via the ecnt port, so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we talk a little bit about how we add a new counter, maybe pointers to the places that need to be changed? it looks like the event count vector has a length set somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can add more. The ecnt vector params are taken from here
see Line 38 from link above
val vp = p(ShellKey).vcrParams
The design patter around params is that every time you see something like myModuleParams" somewhere, then you should go to
myModule` to see what parameters are defined there.
The idea here is that if the number of event counters or nECnt
is changed in VCR then the interface will automatically change as well, without needing to do it manually. The EventCounters.scala
file will just implement "what you want to count" logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I just added a little bit of more info on how to add counters.
* add support to event counters in VTA * fix comment * fix event-counter interface parameter * no longer needed * add sim back * add docs to event counters * fix docs * add more details about event counting * make dpi-module docs more accurate
* add support to event counters in VTA * fix comment * fix event-counter interface parameter * no longer needed * add sim back * add docs to event counters * fix docs * add more details about event counting * make dpi-module docs more accurate
* add support to event counters in VTA * fix comment * fix event-counter interface parameter * no longer needed * add sim back * add docs to event counters * fix docs * add more details about event counting * make dpi-module docs more accurate
This PR adds infrastructure (software and hardware) to support event counters in the VTA Chisel implementation. Only counting cycles at the moment.
This is how cycles are now displayed on vta unittest (
test_vta_insn.py
)