Skip to content

Commit ce689ed

Browse files
committed
wip
1 parent 9857041 commit ce689ed

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

edg/core/Blocks.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def __call__(cls, *args, **kwargs):
2626
block_context = builder.get_enclosing_block()
2727
obj = super().__call__(*args, **kwargs)
2828
if isinstance(obj, BaseBlock): # ignore block prototypes
29-
assert obj._elaboration_state == BlockElaborationState.init
30-
obj._elaboration_state = BlockElaborationState.post_init
3129
obj._block_context = block_context
3230
return obj
3331

@@ -198,7 +196,6 @@ def make_connection(self) -> Optional[Union[ConnectedLink, Export]]:
198196
class BlockElaborationState(Enum):
199197
pre_init = 1 # not sure if this is needed, doesn't actually get used
200198
init = 2
201-
post_init = 3
202199
contents = 4
203200
post_contents = 5
204201
generate = 6
@@ -304,7 +301,7 @@ def _elaborated_def_to_proto(self) -> BaseBlockEdgirType:
304301
prev_element = builder.push_element(self)
305302
assert prev_element is None
306303
try:
307-
assert self._elaboration_state == BlockElaborationState.post_init
304+
assert self._elaboration_state == BlockElaborationState.init
308305
self._elaboration_state = BlockElaborationState.contents
309306
self.contents()
310307
self._elaboration_state = BlockElaborationState.post_contents

edg/core/DesignTop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _elaborated_def_to_proto(self) -> edgir.HierarchyBlock:
5656
prev_element = builder.push_element(self)
5757
assert prev_element is None
5858
try:
59-
assert self._elaboration_state == BlockElaborationState.post_init
59+
assert self._elaboration_state == BlockElaborationState.init
6060
self._elaboration_state = BlockElaborationState.contents
6161
self.contents()
6262
self.multipack()

edg/core/Generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _generated_def_to_proto(self, generate_values: Iterable[Tuple[edgir.LocalPat
111111
assert prev_element is None
112112

113113
try:
114-
assert self._elaboration_state == BlockElaborationState.post_init # TODO dedup w/ elaborated_def_to_proto
114+
assert self._elaboration_state == BlockElaborationState.init
115115
self._elaboration_state = BlockElaborationState.contents
116116
self.contents()
117117
self._elaboration_state = BlockElaborationState.generate

0 commit comments

Comments
 (0)