CIRCT 21.0.0git
Loading...
Searching...
No Matches
SeqOps.h
Go to the documentation of this file.
1//===- SeqOps.h - Declare Seq dialect operations ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file declares the operation classes for the Seq dialect.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_SEQ_SEQOPS_H
14#define CIRCT_DIALECT_SEQ_SEQOPS_H
15
16#include "mlir/Bytecode/BytecodeOpInterface.h"
17#include "mlir/IR/OpImplementation.h"
18#include "mlir/IR/SymbolTable.h"
19#include "mlir/Interfaces/InferTypeOpInterface.h"
20#include "mlir/Interfaces/SideEffectInterfaces.h"
21
31
32#define GET_OP_CLASSES
33#include "circt/Dialect/Seq/Seq.h.inc"
34
35namespace circt {
36namespace seq {
37
38// Returns true if the given sequence of addresses match the shape of the given
39// HLMemType'd handle.
40bool isValidIndexValues(Value hlmemHandle, ValueRange addresses);
41
42/// Helper structure carrying information about FIR memory generated ops.
43struct FirMemory {
47 size_t dataWidth;
48 size_t depth;
49 size_t maskGran;
54 SmallVector<int32_t> writeClockIDs;
55 StringRef initFilename;
58
59 FirMemory(hw::HWModuleGeneratedOp op);
60};
61
62// Helper functions to create constant initial values.
63mlir::TypedValue<seq::ImmutableType>
64createConstantInitialValue(OpBuilder builder, Location loc,
65 mlir::IntegerAttr attr);
66mlir::TypedValue<seq::ImmutableType>
67createConstantInitialValue(OpBuilder builder, Operation *constantLike);
68
69// Helper function to unwrap an immutable type value and get yield value in
70// initial op.
71Value unwrapImmutableValue(mlir::TypedValue<seq::ImmutableType> immutableVal);
72
73// Helper function to merge initial ops within the block into a single initial
74// op. Return failure if we cannot topologically sort the initial ops.
75// Return null if there is no initial op in the block. Return the initial op
76// otherwise.
77FailureOr<seq::InitialOp> mergeInitialOps(Block *block);
78
79} // namespace seq
80} // namespace circt
81
82#endif // CIRCT_DIALECT_SEQ_SEQOPS_H
FailureOr< seq::InitialOp > mergeInitialOps(Block *block)
Definition SeqOps.cpp:1093
bool isValidIndexValues(Value hlmemHandle, ValueRange addresses)
Definition SeqOps.cpp:31
mlir::TypedValue< seq::ImmutableType > createConstantInitialValue(OpBuilder builder, Location loc, mlir::IntegerAttr attr)
Definition SeqOps.cpp:1065
Value unwrapImmutableValue(mlir::TypedValue< seq::ImmutableType > immutableVal)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition seq.py:1
Helper structure carrying information about FIR memory generated ops.
Definition SeqOps.h:43
seq::WUW writeUnderWrite
Definition SeqOps.h:53
seq::RUW readUnderWrite
Definition SeqOps.h:52
SmallVector< int32_t > writeClockIDs
Definition SeqOps.h:54
size_t numReadWritePorts
Definition SeqOps.h:46
StringRef initFilename
Definition SeqOps.h:55