Hi, this is Tejas Singh Bhati. I’m new to the project and may be missing some context, but while reviewing the external HPM event integration I noticed that the supported configuration widths appear to be implicit in the RTL rather than enforced. I’m opening this issue to confirm the intended behavior and, if appropriate, make the supported configurations explicit to prevent invalid or partially connected PMU event mappings.
Summary
top_drac supports external PMU/HPM events through the EXTERNAL_HPM_EVENT_NUM compile-time macro. The implementation assumes the
macro is set to one of 4, 6, or 10, but unsupported values are not rejected.
This can lead to invalid vector indexing, partially undriven HPM event bits, or silently incomplete performance-counter data.
Current behavior
When EXTERNAL_HPM_EVENT_NUM is defined:
- Events 41–44 always read
external_hpm_i[3:0].
- Events 45–46 are only connected for a width of
6.
- Events 45–50 are only connected for a width of
10.
- Any other value has no explicit error or fallback behavior.
For example, a value below 4 makes the [3:0] access invalid. A value such as 5, 7, or 8 creates an HPM event vector wider than the implemented mapping, leaving some event bits unassigned.
Relevant code: rtl/top_drac.sv, HPM event mapping block.
Expected behavior
Only these configurations should be accepted:
- macro undefined: no external HPM events
EXTERNAL_HPM_EVENT_NUM=4: L2/L1.5 access and miss events
EXTERNAL_HPM_EVENT_NUM=6: above events plus NOC-S flow/stall events
EXTERNAL_HPM_EVENT_NUM=10: above events plus per-NOC-channel flow/stall events
Any other value should fail elaboration with a clear diagnostic.
All valid configurations must assign every declared HPM event bit deterministically.
Proposed solution
- Add an elaboration-time guard for unsupported macro values.
- Structure the external-event mapping as explicit generate branches for 4, 6, and 10 event configurations.
- Give unsupported configurations a clear
$error/$fatal message.
- Ensure external-event vector widths and accesses are consistent for each supported configuration.
- Document the external event IDs and meanings in
events.md.
Acceptance criteria
Notes
This is an integration/configuration robustness issue. It does not change the behavior of the default configuration, where EXTERNAL_HPM_EVENT_NUM is not defined.
Hi, this is Tejas Singh Bhati. I’m new to the project and may be missing some context, but while reviewing the external HPM event integration I noticed that the supported configuration widths appear to be implicit in the RTL rather than enforced. I’m opening this issue to confirm the intended behavior and, if appropriate, make the supported configurations explicit to prevent invalid or partially connected PMU event mappings.
Summary
top_dracsupports external PMU/HPM events through theEXTERNAL_HPM_EVENT_NUMcompile-time macro. The implementation assumes themacro is set to one of
4,6, or10, but unsupported values are not rejected.This can lead to invalid vector indexing, partially undriven HPM event bits, or silently incomplete performance-counter data.
Current behavior
When
EXTERNAL_HPM_EVENT_NUMis defined:external_hpm_i[3:0].6.10.For example, a value below
4makes the[3:0]access invalid. A value such as5,7, or8creates an HPM event vector wider than the implemented mapping, leaving some event bits unassigned.Relevant code:
rtl/top_drac.sv, HPM event mapping block.Expected behavior
Only these configurations should be accepted:
EXTERNAL_HPM_EVENT_NUM=4: L2/L1.5 access and miss eventsEXTERNAL_HPM_EVENT_NUM=6: above events plus NOC-S flow/stall eventsEXTERNAL_HPM_EVENT_NUM=10: above events plus per-NOC-channel flow/stall eventsAny other value should fail elaboration with a clear diagnostic.
All valid configurations must assign every declared HPM event bit deterministically.
Proposed solution
$error/$fatalmessage.events.md.Acceptance criteria
events.mddocuments events 41–50 and which configurations expose them.invalid configuration.
Notes
This is an integration/configuration robustness issue. It does not change the behavior of the default configuration, where
EXTERNAL_HPM_EVENT_NUMis not defined.