CIRCT  19.0.0git
DebugInfo.h
Go to the documentation of this file.
1 //===- DebugInfo.h - Debug info emission ------------------------*- 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 entry points to emit debug information.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef CIRCT_TARGET_DEBUGINFO_H
14 #define CIRCT_TARGET_DEBUGINFO_H
15 
16 #include "circt/Support/LLVM.h"
17 #include "llvm/Support/raw_ostream.h"
18 
19 namespace circt {
20 namespace debug {
21 
22 /// Register all debug information emission flavors as from-MLIR translations.
24 
25 /// Dump the debug information in the given `module` in a human-readable format.
26 LogicalResult dumpDebugInfo(Operation *module, llvm::raw_ostream &os);
27 
28 /// Options for HGLDD emission.
30  /// A prefix prepended to all source file locations. This is useful if the
31  /// tool ingesting the HGLDD file is run from a different directory and
32  /// requires help finding the source files.
33  StringRef sourceFilePrefix = "";
34  /// A prefix prepended to all output file locations. This is useful if the
35  /// tool ingesting the HGLDD file expects generated output files to be
36  /// reported relative to a different directory.
37  StringRef outputFilePrefix = "";
38  /// The directory in which to place HGLDD output files.
39  StringRef outputDirectory = "";
40  /// Only consider location information for files that actually exist on disk.
41  /// This can help strip out placeholder names such as `<stdin>` or
42  /// `<unknown>`, and force the HGLDD file to only refer to files that actually
43  /// exist.
44  bool onlyExistingFileLocs = false;
45 };
46 
47 /// Serialize the debug information in the given `module` into the HGLDD format
48 /// and writes it to `output`.
49 LogicalResult emitHGLDD(Operation *module, llvm::raw_ostream &os,
50  const EmitHGLDDOptions &options = {});
51 
52 /// Serialize the debug information in the given `module` into the HGLDD format
53 /// and emit one companion HGLDD file per emitted HDL file. This requires that
54 /// a prior emission pass such as `ExportVerilog` has annotated emission
55 /// locations on the operations in `module`.
56 LogicalResult emitSplitHGLDD(Operation *module,
57  const EmitHGLDDOptions &options = {});
58 
59 } // namespace debug
60 } // namespace circt
61 
62 #endif // CIRCT_TARGET_DEBUGINFO_H
LogicalResult emitHGLDD(Operation *module, llvm::raw_ostream &os, const EmitHGLDDOptions &options={})
Serialize the debug information in the given module into the HGLDD format and writes it to output.
Definition: EmitHGLDD.cpp:1032
void registerTranslations()
Register all debug information emission flavors as from-MLIR translations.
LogicalResult emitSplitHGLDD(Operation *module, const EmitHGLDDOptions &options={})
Serialize the debug information in the given module into the HGLDD format and emit one companion HGLD...
Definition: EmitHGLDD.cpp:1043
LogicalResult dumpDebugInfo(Operation *module, llvm::raw_ostream &os)
Dump the debug information in the given module in a human-readable format.
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21
Definition: debug.py:1
Options for HGLDD emission.
Definition: DebugInfo.h:29
bool onlyExistingFileLocs
Only consider location information for files that actually exist on disk.
Definition: DebugInfo.h:44
StringRef outputDirectory
The directory in which to place HGLDD output files.
Definition: DebugInfo.h:39
StringRef sourceFilePrefix
A prefix prepended to all source file locations.
Definition: DebugInfo.h:33
StringRef outputFilePrefix
A prefix prepended to all output file locations.
Definition: DebugInfo.h:37