Release 0.0.1

This commit is contained in:
rawhide kobayashi 2025-03-16 03:09:31 -05:00
parent 07212c5986
commit d36decf6db
Signed by: rawhide_k
GPG Key ID: E71F77DDBC513FD7
2 changed files with 35 additions and 7 deletions

View File

@ -11,21 +11,28 @@ class Program
var rootCommand = new RootCommand("A CLI for the Ryzen SMU.");
var pboOffset = new Option<string>("--offset", "Specify a core, or list of cores, and their PBO offset(s).");
var pboOffset = new Option<string>("--offset", "Specify a core, or list of cores, and their PBO offset(s), in a fashion similar to taskset. e.g. 0:-10,1:5,2:-20,14:-25");
rootCommand.AddOption(pboOffset);
// How to format this command and process it is to be decided.
rootCommand.SetHandler((core_values) =>
rootCommand.SetHandler((offsetArgs) =>
{
Console.WriteLine(core_values);
RunPBOOffset(offsetArgs);
}, pboOffset);
// works
ApplySingleCorePBOOffset(0, -15);
return rootCommand.Invoke(args);
}
private static void RunPBOOffset(string offsetArgs)
{
string[] arg = offsetArgs.Split(',');
for (int i = 0; i < arg.Length; i++)
{
ApplySingleCorePBOOffset(Convert.ToInt32(arg[i].Split(':')[0]), Convert.ToInt32(arg[i].Split(':')[1]));
}
}
private static void ApplySingleCorePBOOffset(int coreNumber, int value)
{
// Magic numbers from SMUDebugTool
@ -35,6 +42,7 @@ class Program
if ((~ryzen.info.topology.coreDisableMap[mapIndex] >> coreNumber % 8 & 1) == 1)
{
ryzen.SetPsmMarginSingleCore((uint)(((mapIndex << 8) | coreNumber % 8 & 0xF) << 20), value);
Console.WriteLine($"Set core {coreNumber} to offset {value}!");
}
}
}

View File

@ -9,6 +9,26 @@
<Version>0.0.1</Version>
</PropertyGroup>
<PropertyGroup>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<PropertyGroup>
<!-- Set build configuration to Release by default -->
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<!-- Enable single-file publishing -->
<PublishSingleFile>true</PublishSingleFile>
<!-- Target runtime -->
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<!-- Disable self-contained deployment -->
<SelfContained>false</SelfContained>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<!-- Included for the ZenStates-Core submodule...-->