CIRCT 23.0.0git
Loading...
Searching...
No Matches
SVLoweringUtils.h
Go to the documentation of this file.
1//===- SVLoweringUtils.h - Shared helpers for SV lowering -------*- 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 helpers shared across conversions that lower into the SV
10// dialect.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef CIRCT_CONVERSION_SVLOWERINGUTILS_H
15#define CIRCT_CONVERSION_SVLOWERINGUTILS_H
16
17#include "circt/Support/LLVM.h"
18#include "mlir/IR/Builders.h"
19#include "mlir/IR/BuiltinAttributes.h"
20#include "mlir/IR/ImplicitLocOpBuilder.h"
21
22namespace circt::sv {
23
24/// Return a reference to the shared file descriptor runtime fragment.
25FlatSymbolRefAttr getFileDescriptorFragmentRef(MLIRContext *context);
26
27/// Emit the shared file descriptor runtime declarations into a file-level
28/// symbol table operation. If the builder insertion point is not directly
29/// within `fileScopeOp`, it is temporarily adjusted. If these declarations
30/// already exist in `fileScopeOp`, this function is a no-op.
31void emitFileDescriptorRuntime(Operation *fileScopeOp,
32 ImplicitLocOpBuilder &builder);
33
34/// Create a call to the shared file descriptor getter from a procedural region.
35Value createProceduralFileDescriptorGetterCall(OpBuilder &builder, Location loc,
36 Value fileName);
37
38} // namespace circt::sv
39
40#endif // CIRCT_CONVERSION_SVLOWERINGUTILS_H
static std::unique_ptr< Context > context
FlatSymbolRefAttr getFileDescriptorFragmentRef(MLIRContext *context)
Return a reference to the shared file descriptor runtime fragment.
Value createProceduralFileDescriptorGetterCall(OpBuilder &builder, Location loc, Value fileName)
Create a call to the shared file descriptor getter from a procedural region.
void emitFileDescriptorRuntime(Operation *fileScopeOp, ImplicitLocOpBuilder &builder)
Emit the shared file descriptor runtime declarations into a file-level symbol table operation.