circt icon indicating copy to clipboard operation
circt copied to clipboard

[firtool] Firtool 1.138.0 failed to create directories on Windows

Open Siudya opened this issue 3 weeks ago • 2 comments

Platform: Windows 11, x64 Firtool: 1.138.0 test.txt Comman line:

New-Item -Path rtl -ItemType Directory
firtool --split-verilog --format fir test.txt -o rtl

Logs:

firtool-1.138.0 : test.txt:0:0: error: cannot create output directory "rtl\verificationsert": No mapping for the Unicode character exists in 
the target multi-byte code page.

...

Siudya avatar Dec 10 '25 10:12 Siudya

I think what's going on is that this was generated on Windows, so it is interpreting the \a and \c as escapes when they are directory separators. If I try to run this on macOS, it will actually reject it outright:

Assertion failed: (llvm::isHexDigit(c1) && llvm::isHexDigit(c2) && "invalid escape"), function getStringValue, file FIRLexer.cpp, line 107.

This does work if it is \\. I'm not entirely sure what to do here other than maybe we should be not be treating this string as a normal FIRRTL string and instead as something more special.

Does it work with \\ on Windows? If so, we could just teach Chisel to emit it that way.

seldridge avatar Dec 10 '25 20:12 seldridge

Yes, \\ does work on Windows. Teaching Chisel to use \\ should resolve this.

Siudya avatar Dec 11 '25 04:12 Siudya