diff --git a/src/mlir/writer.rs b/src/mlir/writer.rs index 56845573d..7c1b985a1 100644 --- a/src/mlir/writer.rs +++ b/src/mlir/writer.rs @@ -137,8 +137,8 @@ impl std::fmt::Display for MLIROpcode { Opcode::Halt => "llhd.halt", Opcode::Ret => "return", Opcode::RetValue => "return", - Opcode::Br => "br", - Opcode::BrCond => "cond_br", + Opcode::Br => "cf.br", + Opcode::BrCond => "cf.cond_br", Opcode::Wait => "llhd.wait", Opcode::WaitTime => "llhd.wait", _ => panic!("No single corresponding op in CIRCT!"), @@ -273,7 +273,7 @@ impl Writer { if data.kind() != UnitKind::Entity { if let Some(block) = data.first_block() { write!(uw.writer.sink, " ")?; - write!(uw.writer.sink, "br ")?; + write!(uw.writer.sink, "cf.br ")?; uw.write_block_name(block, block_args.get(&block).unwrap_or(&Vec::new()))?; write!(uw.writer.sink, "\n")?; } diff --git a/tests/mlir/from_moore.llhd b/tests/mlir/from_moore.llhd new file mode 100644 index 000000000..46a583c34 --- /dev/null +++ b/tests/mlir/from_moore.llhd @@ -0,0 +1,13 @@ +; RUN: llhd-conv -i %s --output-format mlir + +proc %foo.initial.15.0 () -> (i32$ %x) { +0: + %1 = const i32 42 + %2 = const time 0s 1e + drv i32$ %x, %1, %2 + halt +} + +entity @foo () -> (i32$ %x) { + inst %foo.initial.15.0 () -> (i32$ %x) +}