Skip to content

Commit 328cf80

Browse files
committed
Fix nits from review
1 parent 712394b commit 328cf80

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

lib/Conversion/SimToSV/SimToSV.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "mlir/Pass/Pass.h"
2828
#include "mlir/Transforms/DialectConversion.h"
2929
#include "mlir/Transforms/RegionUtils.h"
30+
#include "llvm/ADT/Twine.h"
3031

3132
#define DEBUG_TYPE "lower-sim-to-sv"
3233

@@ -500,7 +501,7 @@ static LogicalResult appendIntegerSpecifier(SmallString<128> &formatString,
500501
return failure();
501502

502503
if (width.has_value())
503-
formatString += std::to_string(width.value());
504+
llvm::Twine(width.value()).toVector(formatString);
504505

505506
formatString.push_back(spec);
506507
return success();
@@ -514,9 +515,9 @@ static void appendFloatSpecifier(SmallString<128> &formatString,
514515
if (isLeftAligned)
515516
formatString.push_back('-');
516517
if (fieldWidth.has_value())
517-
formatString += std::to_string(fieldWidth.value());
518+
llvm::Twine(fieldWidth.value()).toVector(formatString);
518519
formatString.push_back('.');
519-
formatString += std::to_string(fracDigits);
520+
llvm::Twine(fracDigits).toVector(formatString);
520521
formatString.push_back(spec);
521522
}
522523

@@ -702,9 +703,8 @@ struct SimToSVPass : public circt::impl::LowerSimToSVBase<SimToSVPass> {
702703

703704
std::atomic<bool> usedSynthesisMacro = false;
704705
auto lowerModule = [&](hw::HWModuleOp module) {
705-
if (failed(lowerPrintFormattedProcToSV(module))) {
706+
if (failed(lowerPrintFormattedProcToSV(module)))
706707
return failure();
707-
}
708708

709709
if (moveOpsIntoIfdefGuardsAndProcesses(module))
710710
usedSynthesisMacro = true;

test/Conversion/SimToSV/lower-print-formatted-proc-to-sv-errors.mlir

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,3 @@ hw.module @unsupported_stream_block_argument(
3232
sim.proc.print %fmt to %stream_in
3333
}
3434
}
35-
36-
// -----
37-
38-
hw.module @unsupported_stream_from_get_file() {
39-
%literal = sim.fmt.literal "stream.log"
40-
// expected-error @below {{'sim.proc.print' op must not be in a non-procedural region}}
41-
sim.proc.print %literal
42-
}

0 commit comments

Comments
 (0)