# CIRCT

Circuit IR Compilers and Tools

# 'msft' Dialect

Microsoft internal support dialect Umbrella dialect for everything needed to support Microsoft development but not thoroughly discussed. Most (if not everything) in this dialect is a candidate for generalization and re-homing.

## Attribute definition ¶

### PhysLocationAttr ¶

Descibes a physical location on a device

Annotate a particular entity within an op with the location of the device on an FPGA to which it should mapped. The coordinates in this attribute are absolute locations on the device, so if there are two instances of a module with this annotation incorrect results will be generated. How to solve this is a more general, open problem.

#### Parameters: ¶

ParameterC++ typeDescription
primitiveTypePrimitiveTypeAttr
xuint64_t
yuint64_t
numuint64_t

### PhysicalBoundsAttr ¶

Describes a rectangle bounding a physical region on a device

Describes a rectangular bound within a device. The lower and upper bounds must be specified for both the X and Y axis. The bounds are inclusive.

#### Parameters: ¶

ParameterC++ typeDescription
xMinuint64_t
xMaxuint64_t
yMinuint64_t
yMaxuint64_t

### PhysicalRegionRefAttr ¶

Describes a reference to a physical region on a device

Annotate a particular entity within an op with the region of the devices on an FPGA to which it should mapped. The physicalRegion must refer to a PhysicalRegion operation.

#### Parameters: ¶

ParameterC++ typeDescription
physicalRegionFlatSymbolRefAttr

### RootedInstancePathAttr ¶

A path through the instance hierarchy with the root module

#### Parameters: ¶

ParameterC++ typeDescription
rootModuleFlatSymbolRefAttr
path::llvm::ArrayRef<StringAttr>

### SwitchInstanceAttr ¶

Select an attribute to be use based on the instance

#### Parameters: ¶

ParameterC++ typeDescription
cases::llvm::ArrayRef<SwitchInstanceCaseAttr>

### SwitchInstanceCaseAttr ¶

A switch case in the SwitchInstance attribute

#### Parameters: ¶

ParameterC++ typeDescription
instRootedInstancePathAttr
attrmlir::Attribute

## Operation definition ¶

### msft.instance (::circt::msft::InstanceOp) ¶

Instantiate a module

Syntax:

operation ::= msft.instance $sym_name$moduleName ( $inputs ) custom<ParameterList>($parameters) attr-dict
: functional-type($inputs, results)  Traits: HasParent<::circt::hw::HWModuleOp, MSFTModuleOp> Interfaces: OpAsmOpInterface, Symbol, SymbolUserOpInterface #### Attributes: ¶ AttributeMLIR TypeDescription sym_name::mlir::StringAttrstring attribute moduleName::mlir::FlatSymbolRefAttrflat symbol reference attribute parameters::mlir::ArrayAttrparameter array #### Operands: ¶ OperandDescription inputsany type #### Results: ¶ ResultDescription «unnamed»any type ### msft.module.extern (::circt::msft::MSFTModuleExternOp) ¶ MSFT external Module Identical to hw.module.extern, and trivially lowers to that. This op exists so that we can use msft.instance to refer to both msft.module and msft.module.extern, rather than mixing hw.instance with msft.instance. Traits: HasParentmlir::ModuleOp Interfaces: Symbol #### Attributes: ¶ AttributeMLIR TypeDescription argNames::mlir::ArrayAttrstring array attribute resultNames::mlir::ArrayAttrstring array attribute parameters::mlir::ArrayAttrparameter array verilogName::mlir::StringAttrstring attribute ### msft.module (::circt::msft::MSFTModuleOp) ¶ MSFT HW Module A lot like hw.module, but with a few differences: • Can exist without a body. The body is filled in by a generator post op creation. • MSFT-specific methods and arguments will be added later on. Traits: FunctionLike, HasParentmlir::ModuleOp, IsolatedFromAbove Interfaces: RegionKindInterface, Symbol #### Attributes: ¶ AttributeMLIR TypeDescription argNames::mlir::ArrayAttrstring array attribute resultNames::mlir::ArrayAttrstring array attribute parameters::mlir::DictionaryAttrdictionary of named attribute values fileName::mlir::StringAttrstring attribute ### msft.output (::circt::msft::OutputOp) ¶ termination operation Syntax: operation ::= msft.output attr-dict ($operands^ : type($operands))?  Traits: HasParent, ReturnLike, Terminator Interfaces: NoSideEffect (MemoryEffectOpInterface) Effects: MemoryEffects::Effect{} #### Operands: ¶ OperandDescription operandsany type ### msft.physical_region (::circt::msft::PhysicalRegionOp) ¶ Syntax: operation ::= msft.physical_region$sym_name , \$bounds attr-dict


Traits: HasParentmlir::ModuleOp

Interfaces: Symbol

#### Attributes: ¶

AttributeMLIR TypeDescription
sym_name::mlir::StringAttrstring attribute
bounds::mlir::ArrayAttrarray of PhysicalBounds