-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
HAST-155: Vitis communication library
- Loading branch information
Showing
135 changed files
with
3,029 additions
and
1,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 18 additions & 18 deletions
36
Hast.Abstractions/Hast.Synthesis.Abstractions/Hast.Synthesis.Abstractions.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\SharedAssemblyInfo.cs"> | ||
<Link>Properties\SharedAssemblyInfo.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Hast.Common\Hast.Common.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> | ||
</ItemGroup> | ||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\SharedAssemblyInfo.cs"> | ||
<Link>Properties\SharedAssemblyInfo.cs</Link> | ||
</Compile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Hast.Common\Hast.Common.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> | ||
</ItemGroup> | ||
</Project> |
3 changes: 3 additions & 0 deletions
3
Hast.Abstractions/Hast.Synthesis.Abstractions/IDeviceManifestProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
using Hast.Common.Interfaces; | ||
using Hast.Layer; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Hast.Synthesis.Abstractions | ||
{ | ||
public interface IDeviceManifestProvider : ISingletonDependency | ||
{ | ||
IDeviceManifest DeviceManifest { get; } | ||
|
||
void ConfigureMemory(MemoryConfiguration memory, IHardwareGenerationConfiguration hardwareGeneration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
Hast.Abstractions/Hast.Synthesis.Abstractions/IMemoryConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Hast.Synthesis.Abstractions | ||
{ | ||
public interface IMemoryConfiguration | ||
{ | ||
/// <summary> | ||
/// The alignment value. If set to greater than 0, the starting address of the content is aligned to be a | ||
/// multiple of that number. It must be an integer and power of 2. It can only be set before any instances | ||
/// are created. | ||
/// </summary> | ||
int Alignment { get; } | ||
|
||
|
||
/// <summary> | ||
/// The minimum cell count to be reserved in front of the payload. It's required for device-specific headers. | ||
/// </summary> | ||
int MinimumPrefix { get; } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
Hast.Abstractions/Hast.Synthesis.Abstractions/MemoryConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Hast.Layer; | ||
|
||
namespace Hast.Synthesis.Abstractions | ||
{ | ||
public class MemoryConfiguration : IMemoryConfiguration | ||
{ | ||
private int _alignment = 0; | ||
|
||
public int Alignment | ||
{ | ||
get => _alignment; | ||
set | ||
{ | ||
if (value < 0 || (value & (value - 1)) != 0) | ||
{ | ||
throw new InvalidOperationException("The alignment value must be a power of 2."); | ||
} | ||
|
||
_alignment = value; | ||
} | ||
} | ||
|
||
public int MinimumPrefix { get; set; } | ||
|
||
|
||
private MemoryConfiguration() { } | ||
|
||
|
||
public static IMemoryConfiguration Create( | ||
IHardwareGenerationConfiguration hardwareGenerationConfiguration, | ||
IEnumerable<IDeviceManifestProvider> deviceManifestProviders) | ||
{ | ||
var memoryConfiguration = new MemoryConfiguration(); | ||
var deviceManifestProvider = deviceManifestProviders.First(manifestProvider => | ||
manifestProvider.DeviceManifest.Name == hardwareGenerationConfiguration.DeviceName); | ||
deviceManifestProvider.ConfigureMemory(memoryConfiguration, hardwareGenerationConfiguration); | ||
return memoryConfiguration; | ||
} | ||
|
||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
Hast.Abstractions/Hast.Transformer.Abstractions/Extensions/SimpleMemoryExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
namespace System | ||
{ | ||
public static class SimpleMemoryExtensions | ||
{ | ||
public static void SetIntegers(this Span<byte> buffer, int startIndex, params int[] values) | ||
{ | ||
for (int i = 0, index = startIndex; i < values.Length; i++, index += sizeof(int)) | ||
{ | ||
var slide = buffer.Slice(index, sizeof(int)); | ||
MemoryMarshal.Write(slide, ref values[i]); | ||
} | ||
} | ||
} | ||
} |
32 changes: 17 additions & 15 deletions
32
Hast.Abstractions/Hast.Transformer.Abstractions/Hast.Transformer.Abstractions.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Hast.Common\Hast.Common.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> | ||
</ItemGroup> | ||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Hast.Common\Hast.Common.csproj" /> | ||
<ProjectReference Include="..\Hast.Synthesis.Abstractions\Hast.Synthesis.Abstractions.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.