Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Vivado 2016.2 模拟器,我需要将 int 转换为 System Verilog 中的字符串,但不支持 $cast 和 $sformatf。为了成功地将 int 类型转换为字符串,我还可以使用哪些其他函数或方法?
还有以下其他方式
string s; int i; s.itoa(i); // converts int to decimal string $swrite(s,"%d",i); $sformat(s,"%d",i);
如果这些都不适合你,那么你需要自己编写一个二进制到十进制的转换例程。