Skip to content

Commit 5d4a078

Browse files
committed
Moved local function definitions inside processes, so the internal variables and busses are available to them
1 parent 1cd475c commit 5d4a078

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/SME.VHDL/Templates/Entity.cs

+11-9
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,6 @@ public override string TransformText()
202202
Write("\n");
203203
}
204204

205-
if (Process.Methods != null && Process.Methods.Any(x => !(x.Ignore || x.IsStateMachine)))
206-
{
207-
Write(" -- Internal methods\n");
208-
foreach (var s in Process.Methods.Where(x => !(x.Ignore || x.IsStateMachine)))
209-
foreach(var line in RSP.Helper.RenderMethod(s))
210-
Write($" {ToStringHelper.ToStringWithCulture( line )}\n");
211-
Write("\n");
212-
}
213-
214205
if (Process.IsClocked && RSP.FiniteStateMethod != null)
215206
{
216207
Write(" -- Clock-edge capture signals\n");
@@ -276,8 +267,19 @@ public override string TransformText()
276267
}
277268
Write("\n");
278269
}
270+
279271
if (!RSP.Process.IsClocked)
280272
Write(" variable reentry_guard: std_logic;\n");
273+
274+
if (Process.Methods != null && Process.Methods.Any(x => !(x.Ignore || x.IsStateMachine)))
275+
{
276+
Write(" -- Internal methods\n");
277+
foreach (var s in Process.Methods.Where(x => !(x.Ignore || x.IsStateMachine)))
278+
foreach(var line in RSP.Helper.RenderMethod(s))
279+
Write($" {ToStringHelper.ToStringWithCulture( line )}\n");
280+
Write("\n");
281+
}
282+
281283
Write(@"
282284
-- #### USER-DATA-NONCLOCKEDVARIABLES-START
283285
-- #### USER-DATA-NONCLOCKEDVARIABLES-END

0 commit comments

Comments
 (0)