-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbff9ff
commit 8fc5a33
Showing
7 changed files
with
94 additions
and
8 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
16 changes: 16 additions & 0 deletions
16
src/OneWare.Vhdp/Assets/Templates/VhdpBlink/%PROJECTNAME%.vhdp
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 @@ | ||
Main | ||
( | ||
led: OUT STD_LOGIC := '0'; | ||
) | ||
{ | ||
Process() | ||
{ | ||
Thread | ||
{ | ||
led <= '0'; | ||
Wait(250ms); | ||
led <= '1'; | ||
Wait(250ms); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Text.Json.Nodes; | ||
using OneWare.Essentials.Services; | ||
using OneWare.UniversalFpgaProjectSystem.Helpers; | ||
using OneWare.UniversalFpgaProjectSystem.Models; | ||
using OneWare.UniversalFpgaProjectSystem.Services; | ||
|
||
namespace OneWare.Vhdp.Templates; | ||
|
||
public class VhdpBlinkTemplate(ILogger logger, IDockService dockService) : IFpgaProjectTemplate | ||
{ | ||
public string Name => "VHDP Blink"; | ||
|
||
public void FillTemplate(UniversalFpgaProjectRoot root) | ||
{ | ||
var codeBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new NullReferenceException(Assembly.GetExecutingAssembly().Location); | ||
|
||
var path = Path.Combine(codeBase, "Assets", "Templates", "VhdpBlink"); | ||
|
||
try | ||
{ | ||
var name = root.Header.Replace(" ", ""); | ||
TemplateHelper.CopyDirectoryAndReplaceString(path, root.FullPath, ("%PROJECTNAME%", name)); | ||
var file = root.AddFile(name + ".vhdp"); | ||
root.TopEntity = file; | ||
|
||
root.IncludePath("*.vhdp"); | ||
|
||
_ = dockService.OpenFileAsync(file); | ||
} | ||
catch (Exception e) | ||
{ | ||
logger.Error(e.Message, e); | ||
} | ||
} | ||
} |
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