Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public GenerateRegisterMetadataCommand()
Argument<FileInfo> registerWorksheetPathArgument = ArgumentValidation.AcceptExistingOnly(
new Argument<FileInfo>("registers.xls")
{
Description = "The path to the file describing the device registers.",
Description = "The path to the file that describes the device registers.",
Arity = ArgumentArity.ExactlyOne
});

Expand Down
8 changes: 0 additions & 8 deletions src/Harp.Toolkit/Generate/GeneratorHelper.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
using System.CodeDom.Compiler;
using System.Text;
using Harp.Generators;

namespace Harp.Toolkit.Generate;

public static class GeneratorHelper
{
public static IEnumerable<KeyValuePair<string, T>> GetPortPinsOfType<T>(IDictionary<string, PortPinInfo> portPins) where T : PortPinInfo
{
return from item in portPins
where item.Value is T
select new KeyValuePair<string, T>(item.Key, (T)item.Value);
}

public static bool AssertNoGeneratorErrors(CompilerErrorCollection errors)
{
if (errors.Count > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/Harp.Toolkit/Generate/IOMetadataPathOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public IOMetadataPathOption()
: base("--ios")
{
OptionValidation.AcceptExistingOnly(this);
Description = "The path to the file describing the device IO pins.";
Description = "The path to the file that describes the device IO pins.";
DefaultValueFactory = result => result.AcceptExistingOnly(new FileInfo("ios.yml"));
}
}
2 changes: 1 addition & 1 deletion src/Harp.Toolkit/Generate/MetadataPathArgument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public MetadataPathArgument()
: base("metadata")
{
ArgumentValidation.AcceptExistingOnly(this);
Description = "The path to the file describing the device registers.";
Description = "The path to the file that describes the device registers.";
DefaultValueFactory = result => result.AcceptExistingOnly(new FileInfo("device.yml"));
Arity = ArgumentArity.ZeroOrOne;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Harp.Toolkit/Verify/VerifyCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public VerifyCommand()

Option<int?> ppsEventOption = new("--pps-event")
{
Description = "Address of the register on the tested device (--port) that reports the incoming PPS pulse from the reference clock device. Enables the PPS alignment test, which also requires --clock-port.",
Description = "Address of the register on the tested device, given by --port, that reports the incoming PPS pulse from the reference clock device. Enables the PPS alignment test, which also requires --clock-port.",
Required = false,
};

Expand All @@ -51,7 +51,7 @@ public VerifyCommand()

Option<FileInfo> metadataOption = new("--metadata")
{
Description = "The path to the file describing the device registers. Enables validation of the generated interface against a live read of every declared register, and cross-checks the WhoAmI, firmware and hardware versions.",
Description = "The path to the file that describes the device registers. Enables validation of the generated interface against a live read of every declared register, and cross-checks the WhoAmI, firmware and hardware versions.",
Required = false,
};
OptionValidation.AcceptExistingOnly(metadataOption);
Expand Down Expand Up @@ -92,8 +92,8 @@ static async Task<int> RunVerification(string portName, FileInfo? reportFile, bo
if (metadataPath is not null)
{
AnsiConsole.Markup($"Loading device metadata from [bold]{metadataPath.FullName}[/]...");
deviceMetadata = DeviceMetadata.Load(metadataPath.FullName);
deviceRawYaml = await File.ReadAllTextAsync(metadataPath.FullName, cancellationToken);
deviceMetadata = DeviceMetadata.Parse(deviceRawYaml);
AnsiConsole.MarkupLine($" [green]Done![/] ({deviceMetadata.Registers.Count} registers)");
}

Expand Down
Loading