Skip to content

Commit

Permalink
seperate compile qsf from pin planner qsf
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Mar 17, 2024
1 parent 45fc930 commit e2b43e5
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions src/OneWare.Quartus/QuartusToolchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ public void LoadConnections(UniversalFpgaProjectRoot project, FpgaModel fpga)
}

public void SaveConnections(UniversalFpgaProjectRoot project, FpgaModel fpga)
{
try
{
var qsfPath = QsfHelper.GetQsfPath(project);
var qsf = QsfHelper.ReadQsf(qsfPath);

//Add Connections
qsf.RemoveLocationAssignments();
foreach (var (_, pinModel) in fpga.PinModels.Where(x => x.Value.Connection != null))
{
qsf.AddLocationAssignment(pinModel.Pin.Name, pinModel.Connection!.Node.Name);
}

QsfHelper.WriteQsf(qsfPath, qsf);
}
catch (Exception e)
{
logger.Error(e.Message, e);
}
}

public Task CompileAsync(UniversalFpgaProjectRoot project, FpgaModel fpga)
{
try
{
Expand All @@ -63,24 +85,15 @@ public void SaveConnections(UniversalFpgaProjectRoot project, FpgaModel fpga)
{
qsf.AddFile(file);
}

//Add Connections
qsf.RemoveLocationAssignments();
foreach (var (_, pinModel) in fpga.PinModels.Where(x => x.Value.Connection != null))
{
qsf.AddLocationAssignment(pinModel.Pin.Name, pinModel.Connection!.Node.Name);
}


QsfHelper.WriteQsf(qsfPath, qsf);

return quartusService.CompileAsync(project, fpga);
}
catch (Exception e)
{
logger.Error(e.Message, e);
return Task.CompletedTask;
}
}

public Task CompileAsync(UniversalFpgaProjectRoot project, FpgaModel fpga)
{
return quartusService.CompileAsync(project, fpga);
}
}

0 comments on commit e2b43e5

Please sign in to comment.