'chirrtl' Dialect
Types and operations for the chirrtl dialect
This dialect defines the chirrtl
dialect, which contains high-level
memory defintions which can be lowered to FIRRTL.
Operations ¶
chirrtl.combmem
(::circt::chirrtl::CombMemOp) ¶
Define a new combinational memory
Syntax:
operation ::= `chirrtl.combmem` (`sym` $inner_sym^)? `` custom<NameKind>($nameKind)
`` custom<CombMemOp>(attr-dict) `:` qualified(type($result))
Define a new behavioral combinational memory. Combinational memories have a write latency of 1 and a read latency of 0.
Interfaces: FNamableOp
, HasCustomSSAName
, InnerSymbolOpInterface
Attributes: ¶
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
nameKind | ::circt::firrtl::NameKindEnumAttr | name kind |
annotations | ::mlir::ArrayAttr | Annotation array attribute |
inner_sym | ::circt::hw::InnerSymAttr | Inner symbol definition |
init | ::circt::firrtl::MemoryInitAttr | Information about the initial state of a memory |
prefix | ::mlir::StringAttr | string attribute |
Results: ¶
Result | Description |
---|---|
result | a behavioral memory |
chirrtl.debugport
(::circt::chirrtl::MemoryDebugPortOp) ¶
Defines a debug memory port on CHIRRTL memory
Syntax:
operation ::= `chirrtl.debugport` $memory custom<MemoryDebugPortOp>(attr-dict) `:`
functional-type(operands, results)
This operation defines a new debug memory port on a combmem
CHISEL.
data
is the data returned from the memory port.
Interfaces: HasCustomSSAName
, InferTypeOpInterface
Attributes: ¶
Attribute | MLIR Type | Description |
---|---|---|
name | ::mlir::StringAttr | string attribute |
annotations | ::mlir::ArrayAttr | Annotation array attribute |
Operands: ¶
Operand | Description |
---|---|
memory | a behavioral memory |
Results: ¶
Result | Description |
---|---|
data | reference type |
chirrtl.memoryport
(::circt::chirrtl::MemoryPortOp) ¶
Defines a memory port on CHIRRTL memory
Syntax:
operation ::= `chirrtl.memoryport` $direction $memory `` custom<MemoryPortOp>(attr-dict) `:`
functional-type(operands, results)
This operation defines a new memory port on a seqmem
or combmem
CHISEL.
data
is the data returned from the memory port.
The memory port requires an access point, which sets the enable condition
of the port, the clock, and the address. This is done by passing the the
port
argument to a chirrtl.memoryport.access operation
.
Interfaces: HasCustomSSAName
, InferTypeOpInterface
Attributes: ¶
Attribute | MLIR Type | Description |
---|---|---|
direction | ::circt::firrtl::MemDirAttrAttr | Memory Direction Enum |
name | ::mlir::StringAttr | string attribute |
annotations | ::mlir::ArrayAttr | Annotation array attribute |
Operands: ¶
Operand | Description |
---|---|
memory | a behavioral memory |
Results: ¶
Result | Description |
---|---|
data | a base type |
port | a behavioral memory port |
chirrtl.memoryport.access
(::circt::chirrtl::MemoryPortAccessOp) ¶
Enables a memory port
Syntax:
operation ::= `chirrtl.memoryport.access` $port `[` $index `]` `,` $clock attr-dict `:` qualified(type(operands))
This operation is used to conditionally enable a memory port, and associate
it with a clock
and index
. The memory port will be actuve on the
positive edge of the clock. The index is the address of the memory
accessed. See the FIRRTL rational for more information about why this
operation exists.
Operands: ¶
Operand | Description |
---|---|
port | a behavioral memory port |
index | sint or uint type |
clock | clock |
chirrtl.seqmem
(::circt::chirrtl::SeqMemOp) ¶
Define a new sequential memory
Syntax:
operation ::= `chirrtl.seqmem` (`sym` $inner_sym^)? `` custom<NameKind>($nameKind) $ruw
custom<SeqMemOp>(attr-dict) `:` qualified(type($result))
Define a new behavioral sequential memory. Sequential memories have a write latency and a read latency of 1.
Interfaces: FNamableOp
, HasCustomSSAName
, InnerSymbolOpInterface
Attributes: ¶
Attribute | MLIR Type | Description |
---|---|---|
ruw | ::circt::firrtl::RUWAttrAttr | Read Under Write Enum |
name | ::mlir::StringAttr | string attribute |
nameKind | ::circt::firrtl::NameKindEnumAttr | name kind |
annotations | ::mlir::ArrayAttr | Annotation array attribute |
inner_sym | ::circt::hw::InnerSymAttr | Inner symbol definition |
init | ::circt::firrtl::MemoryInitAttr | Information about the initial state of a memory |
prefix | ::mlir::StringAttr | string attribute |
Results: ¶
Result | Description |
---|---|
result | a behavioral memory |
Types ¶
CMemoryPortType ¶
a behavioral memory port
Syntax: !chirrtl.cmemoryport
Syntax:
cmemoryport-type ::= `cmemoryport`
The value of a cmemoryport
type represents a port which has been
declared on a cmemory
. This value is used to set the memory port access
conditions.
CMemoryType ¶
a behavioral memory
Syntax:
cmemory-type ::= `cmemory` `<` element-type, element-count `>`
The value of a cmemory
type represents a behavioral memory with unknown
ports. This is produced by combmem
and seqmem
declarations and used by
memoryport
declarations to define memories and their ports. A CMemory is
similar to a vector of passive element types.
Examples:
!chirrtl.cmemory<uint<32>, 16>
!chirrtl.cmemory<bundle<a : uint<1>>, 16>
Parameters: ¶
Parameter | C++ type | Description |
---|---|---|
elementType | firrtl::FIRRTLBaseType | |
numElements | uint64_t |
Enums ¶
Convention ¶
lowering convention
Cases: ¶
Symbol | Value | String |
---|---|---|
Internal | 0 | internal |
Scalarized | 1 | scalarized |
EventControl ¶
edge control trigger
Cases: ¶
Symbol | Value | String |
---|---|---|
AtPosEdge | 0 | posedge |
AtNegEdge | 1 | negedge |
AtEdge | 2 | edge |
LayerConvention ¶
layer convention
Cases: ¶
Symbol | Value | String |
---|---|---|
Bind | 0 | bind |
Inline | 1 | inline |
LayerSpecialization ¶
layer specialization
Cases: ¶
Symbol | Value | String |
---|---|---|
Enable | 0 | enable |
Disable | 1 | disable |
MemDirAttr ¶
Memory Direction Enum
Cases: ¶
Symbol | Value | String |
---|---|---|
Infer | 0 | Infer |
Read | 1 | Read |
Write | 2 | Write |
ReadWrite | 3 | ReadWrite |
NameKindEnum ¶
name kind
Cases: ¶
Symbol | Value | String |
---|---|---|
DroppableName | 0 | droppable_name |
InterestingName | 1 | interesting_name |
RUWAttr ¶
Read Under Write Enum
Cases: ¶
Symbol | Value | String |
---|---|---|
Undefined | 0 | Undefined |
Old | 1 | Old |
New | 2 | New |
TargetKind ¶
object model target kind
Cases: ¶
Symbol | Value | String |
---|---|---|
DontTouch | 0 | dont_touch |
Instance | 1 | instance |
MemberInstance | 2 | member_instance |
MemberReference | 3 | member_reference |
Reference | 4 | reference |