Skip to content

Commit

Permalink
Implement full mtval (kuznia-rdzeni/coreblocks#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotro888 authored Oct 15, 2024
1 parent 40e20a9 commit c057b7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transactron/utils/transactron_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"mock_def_helper",
"get_src_loc",
"from_method_layout",
"make_layout",
"extend_layout",
]

T = TypeVar("T")
Expand Down Expand Up @@ -147,6 +149,10 @@ def make_layout(*fields: LayoutListField) -> StructLayout:
return from_method_layout(fields)


def extend_layout(layout: StructLayout, *fields: LayoutListField) -> StructLayout:
return StructLayout(layout.members | from_method_layout(fields).members)


def from_method_layout(layout: MethodLayout) -> StructLayout:
if isinstance(layout, StructLayout):
return layout
Expand Down

0 comments on commit c057b7d

Please sign in to comment.