CIRCT  20.0.0git
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)
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"])
def add_bounds(self, bounds)
Definition: msft.py:18
def instanceRef(self)
Definition: msft.py:59
def create(name_ref)
Definition: msft.py:43
def instance_path(self)
Definition: msft.py:49
def top_module_ref(self)
Definition: msft.py:35
def create(root_mod, instance_name=None)
Definition: msft.py:29
def loc(self)
Definition: msft.py:67