From 92c3b2d6cf5835e0aa048a12dcc1e80b36990a4b Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 11 Aug 2021 00:40:45 +0200 Subject: Handle assignments (target and kind). --- pyGHDL/dom/Concurrent.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'pyGHDL/dom') diff --git a/pyGHDL/dom/Concurrent.py b/pyGHDL/dom/Concurrent.py index 4e4240dbf..990fc32c7 100644 --- a/pyGHDL/dom/Concurrent.py +++ b/pyGHDL/dom/Concurrent.py @@ -46,6 +46,7 @@ from pyVHDLModel.SyntaxModel import ( IfGenerateStatement as VHDLModel_IfGenerateStatement, CaseGenerateStatement as VHDLModel_CaseGenerateStatement, ForGenerateStatement as VHDLModel_ForGenerateStatement, + WaveformElement as VHDLModel_WaveformElement, ConcurrentSimpleSignalAssignment as VHDLModel_ConcurrentSimpleSignalAssignment, Name, ConcurrentStatement, @@ -379,6 +380,19 @@ class ForGenerateStatement(VHDLModel_ForGenerateStatement, DOMMixin): return cls(generateNode, label) +@export +class WaveformElement( + VHDLModel_WaveformElement, DOMMixin +): + def __init__( + self, + waveformNode: Iir, + expression: Expression, + after: Expression + ): + super().__init__(expression, after) + DOMMixin.__init__(self, waveformNode) + @export class ConcurrentSimpleSignalAssignment( VHDLModel_ConcurrentSimpleSignalAssignment, DOMMixin @@ -386,11 +400,11 @@ class ConcurrentSimpleSignalAssignment( def __init__( self, assignmentNode: Iir, + label: str, target: Name, - expression: Expression, - label: str = None, + waveform: Iterable[WaveformElement], ): - super().__init__(target, expression, label) + super().__init__(label, target, waveform) DOMMixin.__init__(self, assignmentNode) @classmethod @@ -405,6 +419,6 @@ class ConcurrentSimpleSignalAssignment( waveform = nodes.Get_Waveform_Chain(assignmentNode) # TODO: translate waveforms to series of "expressions". - expression = None + expression = [None] - return cls(assignmentNode, targetName, expression, label) + return cls(assignmentNode, label, targetName, expression) -- cgit v1.2.3