CIRCT
20.0.0git
Loading...
Searching...
No Matches
lib
Bindings
Python
dialects
msft.py
Go to the documentation of this file.
1
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
# See https://llvm.org/LICENSE.txt for license information.
3
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5
from
.
import
hw, msft
6
from
..
import
support
7
from
..
_mlir_libs._circt._msft
import
*
8
from
..dialects._ods_common
import
_cext
as
_ods_cext
9
from
..ir
import
ArrayAttr
10
from
._msft_ops_gen
import
*
11
from
._msft_ops_gen
import
_Dialect
12
from
typing
import
Dict, List, Type
13
14
15
@_ods_cext.register_operation(_Dialect, replace=True)
16
class
DeclPhysicalRegionOp
(
DeclPhysicalRegionOp
):
17
18
def
add_bounds
(self, bounds):
19
existing_bounds = [b
for
b
in
ArrayAttr(self.attributes[
"bounds"
])]
20
existing_bounds.append(bounds)
21
new_bounds = ArrayAttr.get(existing_bounds)
22
self.attributes[
"bounds"
] = new_bounds
23
24
25
@_ods_cext.register_operation(_Dialect, replace=True)
26
class
InstanceHierarchyOp
(
InstanceHierarchyOp
):
27
28
@staticmethod
29
def
create
(root_mod, instance_name=None):
30
hier =
msft.InstanceHierarchyOp
(root_mod, instName=instance_name)
31
hier.body.blocks.append()
32
return
hier
33
34
@property
35
def
top_module_ref
(self):
36
return
self.attributes[
"topModuleRef"
]
37
38
39
@_ods_cext.register_operation(_Dialect, replace=True)
40
class
DynamicInstanceOp
(
DynamicInstanceOp
):
41
42
@staticmethod
43
def
create
(name_ref):
44
inst =
msft.DynamicInstanceOp
(name_ref)
45
inst.body.blocks.append()
46
return
inst
47
48
@property
49
def
instance_path
(self):
50
path = []
51
next = self
52
while
isinstance(next, DynamicInstanceOp):
53
path.append(next.attributes[
"instanceRef"
])
54
next = next.operation.parent.opview
55
path.reverse()
56
return
ArrayAttr.get(path)
57
58
@property
59
def
instanceRef
(self):
60
return
self.attributes[
"instanceRef"
]
61
62
63
@_ods_cext.register_operation(_Dialect, replace=True)
64
class
PDPhysLocationOp
(
PDPhysLocationOp
):
65
66
@property
67
def
loc
(self):
68
return
msft.PhysLocationAttr(self.attributes[
"loc"
])
msft.DeclPhysicalRegionOp
Definition
msft.py:16
msft.DeclPhysicalRegionOp.add_bounds
add_bounds(self, bounds)
Definition
msft.py:18
msft.DynamicInstanceOp
Definition
msft.py:40
msft.DynamicInstanceOp.instanceRef
instanceRef(self)
Definition
msft.py:59
msft.DynamicInstanceOp.create
create(name_ref)
Definition
msft.py:43
msft.DynamicInstanceOp.instance_path
instance_path(self)
Definition
msft.py:49
msft.InstanceHierarchyOp
Definition
msft.py:26
msft.InstanceHierarchyOp.create
create(root_mod, instance_name=None)
Definition
msft.py:29
msft.InstanceHierarchyOp.top_module_ref
top_module_ref(self)
Definition
msft.py:35
msft.PDPhysLocationOp
Definition
msft.py:64
msft.PDPhysLocationOp.loc
loc(self)
Definition
msft.py:67
_msft
Generated on Wed Jan 22 2025 00:10:06 for CIRCT by
1.9.8