mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 13:18:56 +00:00
fmt,cxxrtl: add UNICHAR
format type.
This format type is used to print an Unicode character (code point) as its UTF-8 serialization. To this end, two UTF-8 decoders (one for fmt, one for cxxrtl) are added for rendering. When converted to a Verilog format specifier, `UNICHAR` degrades to `%c` with the low 7 bits of the code point, which has equivalent behavior for inputs not exceeding ASCII. (SystemVerilog leaves source and display encodings completely undefined.)
This commit is contained in:
parent
1780e2eb1e
commit
bf5a960668
3 changed files with 70 additions and 6 deletions
|
@ -56,13 +56,14 @@ struct FmtPart {
|
|||
LITERAL = 0,
|
||||
INTEGER = 1,
|
||||
STRING = 2,
|
||||
VLOG_TIME = 3,
|
||||
UNICHAR = 3,
|
||||
VLOG_TIME = 4,
|
||||
} type;
|
||||
|
||||
// LITERAL type
|
||||
std::string str;
|
||||
|
||||
// INTEGER/STRING types
|
||||
// INTEGER/STRING/UNICHAR types
|
||||
RTLIL::SigSpec sig;
|
||||
|
||||
// INTEGER/STRING/VLOG_TIME types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue