Skip to content
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

Add support for errors in harp core #63

Open
1 of 4 tasks
bruno-f-cruz opened this issue Dec 19, 2024 · 0 comments
Open
1 of 4 tasks

Add support for errors in harp core #63

bruno-f-cruz opened this issue Dec 19, 2024 · 0 comments
Labels
proposal Request for a new feature

Comments

@bruno-f-cruz
Copy link
Member

bruno-f-cruz commented Dec 19, 2024

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

Summary

This proposal would be centered around 3 changes:

  1. Adding a status beat to the currently open proposal Add hearbeat register #45 that codes a generic error state
  2. Add a R_ERROR register (U8) to the harp core
  3. Add application notes on how to use this register

Motivation

We want a way to be able to encode error states but also to be able to provide users with more information on how to potentially handle these errors.
Because errors are likely device-specific, I want to decouple the Error pointer from the error information.

Detailed Design

From past discussions, I believe this is the most up-to-date proposal:
1- Add Error register (U8) (value to be a pointer to the address of failing register or address of register with more info). Another way to see this is that zero is pointing to the WHO_AM_I register which by definition is never in error, otherwise the register can point to a register that either provides more information (e.g. enumerator with error code) or to a register directly.
2 - The Error register should emit an event each time an error is raised. Once cleared, it should go back to 0.
3 - Keep ERROR(bit2) bit in R_HEARTBEAT register. This bit is set automatically by the core code whenever the Error register is not zero. While this bit may initially appear redundant, its usefulness comes from the period nature of the heartbeat register. The heartbeat will keep sending the error bit until the error is handled and will thus provide users with a way to correctly handle the error state.

Drawbacks

Alternatives

###Error flag in every harp message (usually used for erroneous write command)
A bit hard to use since this bit has historically been reserved for interface-related errors (e.g. write to read-only reg)

Error bit in heartbeat (sent periodically with heartbeat but with no information on how the error occurred)

Subset of the full proposal

Error register with device-specific code (event register and would store the last error until cleared, to be included in read dump)

This makes it really hard to track the error codes. The proposed solution has an interesting advantage where people could code their error states in the device.yml and use the R_ERROR to point to that register.

Unresolved Questions

How to clear the error state?
One idea could be to simply write 0 to R_ERROR? The error is assumed to be cleared. If the error is remains a new event can be emitted.

Design Meetings

#45 (comment)

@bruno-f-cruz bruno-f-cruz added the proposal Request for a new feature label Dec 19, 2024
@bruno-f-cruz bruno-f-cruz changed the title Add support for Errors in harp core Add support for errors in harp core Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant