using System.Collections.Generic;
namespace Hast.Layer;
public class HardwareGenerationConfiguration : IHardwareGenerationConfiguration
{
///
/// Gets a dictionary that can contain settings for non-default configuration options (like ones required by
/// specific transformer implementations).
///
public IDictionary CustomConfiguration { get; }
///
/// Gets or sets a name associated with the hardware generation operation that's meaningful to the consumer. It may
/// be logged or saved during hardware generation but otherwise it may not used in any activities.
///
public string Label { get; set; }
///
/// Gets the collection of the full name of those public members that will be accessible as hardware implementation.
/// By default all members implemented from interfaces and all public virtual members will be included. You can use
/// this to restrict what gets transformed into hardware; if nothing is specified all suitable members will be
/// transformed.
///
///
///
/// Specify members with their full name, including the full namespace of the parent type(s) as well as their return
/// type and the types of their (type) arguments.
///
///
/// "System.Boolean Contoso.ImageProcessing.FaceRecognition.FaceDetectors::IsFacePresent(System.Byte[])
///
///
public IList HardwareEntryPointMemberFullNames { get; }
///
/// Gets the collection of the name prefixes of those public members that will be accessible as hardware
/// implementation. By default all members implemented from interfaces and all public virtual members will be
/// included. You can use this to restrict what gets transformed into hardware; if nothing is specified all suitable
/// members will be transformed.
///
///
/// Specify members with the leading part of their name as you would access them in C#, e.g.:
/// "Contoso.ImageProcessing" will include all members under this namespace.
/// "Contoso.ImageProcessing.FaceRecognition.FaceDetectors" will include all members in this class.
///
public IList HardwareEntryPointMemberNamePrefixes { get; }
///
/// Gets or sets a value indicating whether the caching of the generated hardware is allowed. If set to no caching will happen. Defaults to .
///
public bool EnableCaching { get; set; }
///
public string DeviceName { get; }
///
public string HardwareGenerationPath { get; set; }
///
public string HardwareFrameworkPath { get; }
///
/// Gets or sets a value indicating whether hardware transformation takes place. If it doesn't then will be implied to be too. Defaults to
/// .
///
public bool EnableHardwareTransformation { get; set; } = true;
///
/// Gets or sets a value indicating whether a hardware implementation composer should be used to synthesize hardware
/// from the transformed hardware description. Defaults to .
///
public bool EnableHardwareImplementationComposition { get; set; } = true;
///
/// Gets or sets the path to a the only binary this application should support. If not and
/// the binary exists, then all hardware generation is skipped.
///
public string SingleBinaryPath { get; set; }
///
/// Initializes a new instance of the class.
///
///
/// The name of the FPGA device (board) to transform for. Device-specific configurations are determined by device
/// drivers. You can fetch the list of supported devices via IHastlayer.GetSupportedDevices().
///
///
/// The file system path here where the hardware framework is located. The file describing the hardware to be
/// generated will be saved there as well as anything else necessary, and that framework will be used to implement
/// the hardware and configure the device.
///
public HardwareGenerationConfiguration(
string deviceName,
string hardwareFrameworkPath = null,
IDictionary customConfiguration = null,
IList hardwareEntryPointMemberFullNames = null,
IList hardwareEntryPointMemberNamePrefixes = null)
{
DeviceName = deviceName;
HardwareFrameworkPath = string.IsNullOrWhiteSpace(hardwareFrameworkPath)
? "HardwareFramework"
: hardwareFrameworkPath;
CustomConfiguration = customConfiguration ?? new Dictionary();
HardwareEntryPointMemberFullNames = hardwareEntryPointMemberFullNames ?? new List();
HardwareEntryPointMemberNamePrefixes = hardwareEntryPointMemberNamePrefixes ?? new List();
}
}