Skip to content

Commit 5a094a1

Browse files
committed
[Sim] Tweak formatting in SimOps.td; NFC
1 parent a04a76e commit 5a094a1

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

include/circt/Dialect/Sim/SimOps.td

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
//===- SimOps.td - `sim` dialect ops -----------------------*- tablegen -*-===//
1+
//===----------------------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
//
9-
// This describes the MLIR ops for `sim`.
10-
//
11-
//===----------------------------------------------------------------------===//
128

139
#ifndef CIRCT_DIALECT_SIM_SIMOPS_TD
1410
#define CIRCT_DIALECT_SIM_SIMOPS_TD
@@ -169,6 +165,10 @@ def DPICallOp : SimOp<"func.dpi.call",
169165

170166
}
171167

168+
//===----------------------------------------------------------------------===//
169+
// String Formatting
170+
//===----------------------------------------------------------------------===//
171+
172172
def FormatLitOp : SimOp<"fmt.lit", [Pure, ConstantLike]> {
173173
let summary = "Literal string fragment";
174174
let description = [{
@@ -255,7 +255,9 @@ def FormatDecOp : SimOp<"fmt.dec", [Pure]> {
255255

256256
let hasFolder = true;
257257

258-
let assemblyFormat = "(`signed` $isSigned^)? $value attr-dict `:` qualified(type($value))";
258+
let assemblyFormat = [{
259+
(`signed` $isSigned^)? $value attr-dict `:` qualified(type($value))
260+
}];
259261

260262
let extraClassDeclaration = [{
261263
static inline unsigned getDecimalWidth(unsigned bits, bool isSigned) {
@@ -268,7 +270,8 @@ def FormatDecOp : SimOp<"fmt.dec", [Pure]> {
268270
bits--;
269271

270272
// Should be precise up until bits = 13301
271-
const double baseConversionFactor = 0.30103; // log(2) / log(10) + epsilon
273+
// log(2) / log(10) + epsilon
274+
const double baseConversionFactor = 0.30103;
272275
unsigned digits = std::ceil(bits * baseConversionFactor);
273276

274277
return isSigned ? digits + 1 : digits;
@@ -337,13 +340,13 @@ def FormatStringConcatOp : SimOp<"fmt.concat", [Pure]> {
337340
/// On encountering a cycle, the result of the concat operation
338341
/// forming the cycle is pushed into the list of flattened values
339342
/// and flattening continues without recursing into the cycle.
340-
LogicalResult getFlattenedInputs(llvm::SmallVectorImpl<Value> &flatOperands);
343+
LogicalResult getFlattenedInputs(
344+
llvm::SmallVectorImpl<Value> &flatOperands);
341345
}];
342346
}
343347

344348
def PrintFormattedOp : SimOp<"print"> {
345349
let summary = "Print a formatted string on a given clock and condition";
346-
347350
let description = [{
348351
Evaluate a format string and print it to the simulation console on the
349352
rising edge of the given clock, if, and only if, the condition argument
@@ -354,28 +357,25 @@ def PrintFormattedOp : SimOp<"print"> {
354357
of printing for operations in different modules, instances or on different
355358
clocks is undefined.
356359
}];
357-
358-
359-
let arguments = (ins FormatStringType:$input, ClockType:$clock, I1:$condition);
360-
360+
let arguments = (ins
361+
FormatStringType:$input,
362+
ClockType:$clock,
363+
I1:$condition
364+
);
361365
let hasCanonicalizeMethod = true;
362366
let assemblyFormat = "$input `on` $clock `if` $condition attr-dict";
363367
}
364368

365369
def PrintFormattedProcOp : SimOp<"proc.print"> {
366370
let summary = "Print a formatted string within a procedural region";
367-
368371
let description = [{
369372
Evaluate a format string and print it to the simulation console.
370373

371374
This operation must be within a procedural region.
372375
}];
373-
374376
let arguments = (ins FormatStringType:$input);
375-
376377
let hasVerifier = true;
377378
let hasCanonicalizeMethod = true;
378-
379379
let assemblyFormat = "$input attr-dict";
380380
}
381381

0 commit comments

Comments
 (0)