Skip to content

Commit

Permalink
add osscadsuite package
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Jul 27, 2024
1 parent b1159f9 commit deea383
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish-studio-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ jobs:
tag: ${{ steps.get-props-version.outputs.info }}
artifacts: "./out/*.tar.gz"
allowUpdates: true
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- name: Create VersionInfo x64
run: echo "${{ steps.get-oneware-version.outputs.info }}|https://cdn.one-ware.com/onewarestudio/${{ steps.get-oneware-version.outputs.info }}/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-x64.tar.gz" > ./out/linux-x64.txt
- uses: joutvhu/ftp-transfer@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-studio-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ jobs:
tag: ${{ steps.get-props-version.outputs.info }}
artifacts: "./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/*.dmg"
allowUpdates: true
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- name: Create Button HTML x64
shell: pwsh
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.MacOSInstaller/MacOSDownloadTemplate-x64.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/MacOSDownload-x64.htm -Encoding UTF8
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/publish-studio-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ jobs:
tag: ${{ steps.get-props-version.outputs.info }}
artifacts: "./out/en-us/*.msi"
allowUpdates: true
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- uses: joutvhu/ftp-transfer@v1
name: Upload
with:
Expand Down
112 changes: 108 additions & 4 deletions src/OneWare.OssCadSuiteIntegration/OssCadSuiteIntegrationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Dock.Model.Core;
using OneWare.Essentials.Helpers;
using OneWare.Essentials.Models;
using OneWare.Essentials.PackageManager;
using OneWare.Essentials.Services;
using OneWare.Essentials.ViewModels;
using OneWare.OssCadSuiteIntegration.Loaders;
Expand All @@ -22,6 +23,107 @@ namespace OneWare.OssCadSuiteIntegration;

public class OssCadSuiteIntegrationModule : IModule
{
public const string OssPathSetting = "OssCadSuite_Path";

public static readonly Package OssCadPackage = new()
{
Category = "Binaries",
Id = "osscadsuite",
Type = "NativeTool",
Name = "OSS CAD Suite",
Description = "Open Source FPGA Tools",
License = "ISC",
IconUrl =
"https://avatars.githubusercontent.com/u/35169771?s=48&v=4",
Links =
[
new PackageLink
{
Name = "GitHub",
Url = "https://github.com/YosysHQ/oss-cad-suite-build"
}
],
Tabs =
[
new PackageTab()
{
Title = "Readme",
ContentUrl = "https://raw.githubusercontent.com/HendrikMennen/oss-cad-suite-build/main/README.md"
},
new PackageTab
{
Title = "License",
ContentUrl = "https://raw.githubusercontent.com/YosysHQ/oss-cad-suite-build/main/COPYING"
}
],
Versions =
[
new PackageVersion
{
Version = "2024.07.27",
Targets =
[
new PackageTarget
{
Target = "win-x64",
Url =
"https://github.com/HendrikMennen/oss-cad-suite-build/releases/download/2024-07-27/oss-cad-suite-windows-x64-20240727.tgz",
AutoSetting =
[
new PackageAutoSetting
{
RelativePath = "oss-cad-suite",
SettingKey = OssPathSetting
}
]
},
new PackageTarget
{
Target = "linux-x64",
Url =
"https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2024-07-27/oss-cad-suite-linux-x64-20240727.tgz",
AutoSetting =
[
new PackageAutoSetting
{
RelativePath = "oss-cad-suite",
SettingKey = OssPathSetting
}
]
},
new PackageTarget
{
Target = "osx-x64",
Url =
"https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2024-07-27/oss-cad-suite-darwin-x64-20240727.tgz",
AutoSetting =
[
new PackageAutoSetting
{
RelativePath = "oss-cad-suite",
SettingKey = OssPathSetting
}
]
},
new PackageTarget
{
Target = "osx-arm64",
Url =
"https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2024-07-27/oss-cad-suite-darwin-arm64-20240727.tgz",
AutoSetting =
[
new PackageAutoSetting
{
RelativePath = "oss-cad-suite",
SettingKey = OssPathSetting
}
]
}
]
},
]
};

public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterSingleton<YosysService>();
Expand All @@ -33,7 +135,9 @@ public void OnInitialized(IContainerProvider containerProvider)
var settingsService = containerProvider.Resolve<ISettingsService>();
var yosysService = containerProvider.Resolve<YosysService>();
var environmentService = containerProvider.Resolve<IEnvironmentService>();


containerProvider.Resolve<IPackageService>().RegisterPackage(OssCadPackage);

containerProvider.Resolve<IWindowService>().RegisterUiExtension("CompileWindow_TopRightExtension",
new UiExtension(x =>
{
Expand All @@ -60,10 +164,10 @@ public void OnInitialized(IContainerProvider containerProvider)
containerProvider.Resolve<FpgaService>().RegisterLoader<OpenFpgaLoader>();
containerProvider.Resolve<FpgaService>().RegisterSimulator<IcarusVerilogSimulator>();

settingsService.RegisterTitledFolderPath("Tools", "OSS Cad Suite", "OssCadSuite_Path", "OSS CAD Suite Path",
settingsService.RegisterTitledFolderPath("Tools", "OSS Cad Suite", OssPathSetting, "OSS CAD Suite Path",
"Sets the path for the Yosys OSS CAD Suite", "", null, null, IsOssPathValid);

settingsService.GetSettingObservable<string>("OssCadSuite_Path").Subscribe(x =>
settingsService.GetSettingObservable<string>(OssPathSetting).Subscribe(x =>
{
if (string.IsNullOrEmpty(x)) return;

Expand Down Expand Up @@ -95,7 +199,7 @@ public void OnInitialized(IContainerProvider containerProvider)
Command = new AsyncRelayCommand(() => yosysService.CreateNetListJsonAsync(verilog))
});
if (x is [IProjectFile { Extension: ".vcd" or ".ghw" or "fst" } wave] &&
IsOssPathValid(settingsService.GetSettingValue<string>("OssCadSuite_Path")))
IsOssPathValid(settingsService.GetSettingValue<string>(OssPathSetting)))
l.Add(new MenuItemViewModel("GtkWaveOpen")
{
Header = "Open with GTKWave",
Expand Down

0 comments on commit deea383

Please sign in to comment.