irusanov / ZenStates-Core

ZenStates-Core
GNU General Public License v3.0
39 stars 6 forks source link

Question about GetPsmMarginSingleCore #8

Closed tutyamxx closed 2 years ago

tutyamxx commented 2 years ago

How do i specify the coreMask for core 5 for example to set a margin of -5?

I did try cpu.SetPsmMarginSingleCore(5) but it only applies for core 0. Sorry for creating this, due to lack of docs, i am confused.

irusanov commented 2 years ago

Hi, Yeah, I know about the documentation, hopefully I will have more time for these projects soon.

There's a utility function exposed. cpu.MakeCoreMask(core, ccd, ccx);

For Family 19h, you can omit ccx as it is always 0 and provide the ccd index and core index (in that ccd) So, the get margin for core 5 (6th core) in ccd 0 (first ccd), you do

uint mask = cpu.MakeCoreMask(5, 0);
// for CCD0 you can also do
uint mask = cpu.MakeCoreMask(5);
int? margin = cpu.GetPsmMarginSingleCore(mask);

To set -5 for core 5

uint mask = cpu.MakeCoreMask(5, 0);
cpu.SetPsmMarginSingleCore(mask, -5);

You can also see some examples in SMUDebugTool, although code is very bad https://github.com/irusanov/SMUDebugTool/blob/9cca0fa29ea786eb39c0680e285c26123d6a6c10/SettingsForm.cs#L214

tutyamxx commented 2 years ago

thank you kindly, i appreciate it a lot!