CIRCT 20.0.0git
Loading...
Searching...
No Matches
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
5from . import hw, msft
6from .. import support
7from .._mlir_libs._circt._msft import *
8from ..dialects._ods_common import _cext as _ods_cext
9from ..ir import ArrayAttr
10from ._msft_ops_gen import *
11from ._msft_ops_gen import _Dialect
12from typing import Dict, List, Type
13
14
15@_ods_cext.register_operation(_Dialect, replace=True)
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)
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)
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)
65
66 @property
67 def loc(self):
68 return msft.PhysLocationAttr(self.attributes["loc"])
add_bounds(self, bounds)
Definition msft.py:18
create(name_ref)
Definition msft.py:43
create(root_mod, instance_name=None)
Definition msft.py:29