[firtool] Firtool 1.138.0 failed to create directories on Windows
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\verificationsert": No mapping for the Unicode character exists in
the target multi-byte code page.
...
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.
Yes, \\ does work on Windows. Teaching Chisel to use \\ should resolve this.