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

Formulate write algorithms & API #4

Open
fearful-symmetry opened this issue Nov 22, 2018 · 2 comments
Open

Formulate write algorithms & API #4

fearful-symmetry opened this issue Nov 22, 2018 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@fearful-symmetry
Copy link
Owner

So, embarrassingly, I don't have nearly as much experience writing to MSRs as I do reading them. This has lead me to wonder how we want to update single values in a write. Presumably modifying the MSR itself isn't hard, and applying a binary AND to the existing value and writing it back will be enough.

The API is a little more interesting: I'm thinking an Option Type that allows us to specify an arbitrary number of values to update might be best:

raplHandler.UpdatePowerLimit(gorapl.OptionLock(true), gorapl.OptionEnableLimit1(true))

Another option would be a struct with &int pointers, as this would allow us to distinguish between uninitialized values. Having pointers everywhere seems awkward, but it's certainly an option.

@fearful-symmetry fearful-symmetry added this to the v0.1.0 Beta milestone Nov 22, 2018
@fearful-symmetry
Copy link
Owner Author

Another consideration is the units in the write API. For example, the SDM specifies the value for the Time Limit in the MSR_[DOMAIN]_POWER_LIMIT as:
Time limit = 2^Y * (1.0 + Z/4.0) * Time_Unit

Should we expect the user to do that math? Do they give a value in whatever unit and we convert it?

@fearful-symmetry
Copy link
Owner Author

#5 Is going to make this a bit of a pain, as we'll have to 'reverse' the multiplier function to turn the data back into something we write to a register.

@fearful-symmetry fearful-symmetry added the enhancement New feature or request label Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant