CIRCT 23.0.0git
Loading...
Searching...
No Matches
SynthAttributes.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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
10#include "mlir/IR/Builders.h"
11#include "mlir/IR/DialectImplementation.h"
12#include "llvm/ADT/TypeSwitch.h"
13
14using namespace circt;
15using namespace circt::synth;
16using namespace mlir;
17
18//===----------------------------------------------------------------------===//
19// MappingCostAttr
20//===----------------------------------------------------------------------===//
21
22LogicalResult
23MappingCostAttr::verify(llvm::function_ref<InFlightDiagnostic()> emitError,
24 FloatAttr area, ArrayAttr arcs,
25 DictionaryAttr inputCaps) {
26 if (arcs.empty())
27 return emitError() << "expected arcs to be non-empty";
28
29 for (auto attr : arcs)
30 if (!isa<LinearTimingArcAttr>(attr))
31 return emitError() << "expected arcs to contain synth.linear_timing_arc";
32
33 if (inputCaps)
34 for (auto entry : inputCaps)
35 if (!isa<FloatAttr>(entry.getValue()))
36 return emitError()
37 << "expected input_caps values to be floating-point attributes";
38
39 return success();
40}
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.