Skip to content

Commit

Permalink
update + add output_files
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Jul 14, 2024
1 parent a0b4272 commit adc2c92
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 13 deletions.
13 changes: 13 additions & 0 deletions oneware-extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@
"url": "https://github.com/one-ware/OneWare.Quartus/releases/download/0.7/OneWare.QuartusExtension_0.7_linux-x64.zip"
}
]
},
{
"version": "0.7.1",
"targets": [
{
"target": "win-x64",
"url": "https://github.com/one-ware/OneWare.Quartus/releases/download/0.7.1/OneWare.QuartusExtension_0.7.1_win-x64.zip"
},
{
"target": "linux-x64",
"url": "https://github.com/one-ware/OneWare.Quartus/releases/download/0.7.1/OneWare.QuartusExtension_0.7.1_linux-x64.zip"
}
]
}
]
}
32 changes: 32 additions & 0 deletions src/OneWare.Quartus/Helper/QsfFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ public partial class QsfFile(string[] lines)

public List<string> Lines { get; private set; } = lines.ToList();

public string? GetQsfProperty(string propertyName)
{
var regex = new Regex(propertyName + @"\s(.+)");
foreach (var line in Lines)
{
var match = regex.Match(line);
if (match is { Success: true, Groups.Count: > 1 })
{
var value = match.Groups[1].Value;
if(value.Length > 0 && value[0] == '"' && value[^1] == '"') return value[1..^1];
return value;
}
}
return null;
}

public void SetQsfProperty(string propertyName, string value)
{
var regex = new Regex(propertyName + @"\s(.+)");
var line= Lines.FindIndex(x => regex.IsMatch(x));
var newAssignment = $"{propertyName} {value}";

if(line != -1)
{
Lines[line] = newAssignment;
}
else
{
Lines.Add(newAssignment);
}
}

public string? GetGlobalAssignment(string propertyName)
{
var regex = new Regex(@"set_global_assignment\s*-name\s" + propertyName + @"\s(.+)");
Expand Down
6 changes: 3 additions & 3 deletions src/OneWare.Quartus/OneWare.Quartus.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.7</Version>
<Version>0.7.1</Version>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -16,8 +16,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="OneWare.Essentials" Version="0.5.0" Private="false" ExcludeAssets="runtime;Native"/>
<PackageReference Include="OneWare.UniversalFpgaProjectSystem" Version="0.20.0.0" Private="false" ExcludeAssets="runtime;Native"/>
<PackageReference Include="OneWare.Essentials" Version="0.5.1" Private="false" ExcludeAssets="runtime;Native"/>
<PackageReference Include="OneWare.UniversalFpgaProjectSystem" Version="0.20.1.0" Private="false" ExcludeAssets="runtime;Native"/>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/OneWare.Quartus/QuartusLoader.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AvaloniaEdit.Utils;
using DynamicData;
using Microsoft.Extensions.Logging;
using OneWare.Essentials.Behaviors;
using OneWare.Essentials.Enums;
using OneWare.Essentials.Services;
using OneWare.UniversalFpgaProjectSystem.Models;
Expand Down
3 changes: 3 additions & 0 deletions src/OneWare.Quartus/QuartusToolchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ public Task<bool> CompileAsync(UniversalFpgaProjectRoot project, FpgaModel fpga)
var family = properties.GetValueOrDefault("QuartusToolchain_Family") ?? throw new Exception("No Family set!");
var device = properties.GetValueOrDefault("QuartusToolchain_Device") ?? throw new Exception("No Device set!");

//Add output path
qsf.SetGlobalAssignment("PROJECT_OUTPUT_DIRECTORY", "output_files");

//Add Family
qsf.SetGlobalAssignment("FAMILY", family);

Expand Down
6 changes: 3 additions & 3 deletions src/OneWare.Quartus/Views/QuartusCompileSettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:OneWare.Essentials.Controls;assembly=OneWare.Essentials"
xmlns:behaviours="clr-namespace:OneWare.Essentials.Behaviours;assembly=OneWare.Essentials"
xmlns:viewModels="clr-namespace:OneWare.Quartus.ViewModels"
xmlns:behaviors="clr-namespace:OneWare.Essentials.Behaviors;assembly=OneWare.Essentials"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" PrefHeight="350" PrefWidth="400"
CustomIcon="avares://OneWare.Quartus/Assets/Quartus_prime.png"
Icon="avares://OneWare.Quartus/Assets/Quartus_prime.png"
x:Class="OneWare.Quartus.Views.QuartusCompileSettingsView" Name="QuartusCompileSettingsViewView"
WindowStartupLocation="CenterOwner" Title="Quartus Compile Settings" x:DataType="viewModels:QuartusCompileSettingsViewModel">
<Interaction.Behaviors>
<behaviours:CommandOnEnterBehaviour Command="{Binding Save}"
CommandParameter="{Binding #QuartusCompileSettingsViewView}" />
<behaviors:CommandOnEnterBehavior Command="{Binding Save}"
CommandParameter="{Binding #QuartusCompileSettingsViewView}" />
</Interaction.Behaviors>
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" Margin="8" Classes="WindowButtons" HorizontalAlignment="Right"
Expand Down
6 changes: 3 additions & 3 deletions src/OneWare.Quartus/Views/QuartusLoaderSettingsView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:OneWare.Essentials.Controls;assembly=OneWare.Essentials"
xmlns:behaviours="clr-namespace:OneWare.Essentials.Behaviours;assembly=OneWare.Essentials"
xmlns:behaviours="clr-namespace:OneWare.Essentials.Behaviors;assembly=OneWare.Essentials"
xmlns:viewModels="clr-namespace:OneWare.Quartus.ViewModels"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" PrefHeight="370" PrefWidth="400"
CustomIcon="{DynamicResource Material.SettingsOutline}"
Icon="avares://OneWare.Core/Assets/Images/Icons/Settings_White.png"
x:Class="OneWare.Quartus.Views.QuartusLoaderSettingsView" Name="QuartusLoaderSettingsViewView"
WindowStartupLocation="CenterOwner" Title="Quartus Loader Settings" x:DataType="viewModels:QuartusLoaderSettingsViewModel">
<Interaction.Behaviors>
<behaviours:CommandOnEnterBehaviour Command="{Binding Save}"
CommandParameter="{Binding #QuartusLoaderSettingsViewView}" />
<behaviours:CommandOnEnterBehavior Command="{Binding Save}"
CommandParameter="{Binding #QuartusLoaderSettingsViewView}" />
</Interaction.Behaviors>
<DockPanel>
<StackPanel DockPanel.Dock="Bottom" Margin="8" Classes="WindowButtons" HorizontalAlignment="Right"
Expand Down
8 changes: 4 additions & 4 deletions src/OneWare.Quartus/oneware.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"Dependencies": [
{
"Name": "OneWare.Essentials",
"MinVersion": "0.5.0.0",
"MaxVersion": "0.5.0.0"
"MinVersion": "0.5.1.0",
"MaxVersion": "0.5.1.0"
},
{
"Name": "OneWare.UniversalFpgaProjectSystem",
"MinVersion": "0.20.0.0",
"MaxVersion": "0.20.0.0"
"MinVersion": "0.20.1.0",
"MaxVersion": "0.20.1.0"
}
]
}

0 comments on commit adc2c92

Please sign in to comment.