【问题标题】:How do you escape % in SystemVerilog?您如何在 SystemVerilog 中转义 %?
【发布时间】:2022-11-01 18:17:26
【问题描述】:

如何在 SystemVerilog $display 语句中转义 %

【问题讨论】:

    标签: verilog system-verilog


    【解决方案1】:

    来自 IEEE Std 1800-2017,第 21.2.1 节显示和写入任务

    特殊字符串 %% 表示百分比的显示 符号字符 %

    module tb;
        initial $display("hello %% world");
    endmodule
    

    以上显示:

    hello % world
    

    EDA playground 上运行它。

    有关更复杂的工作示例,请参阅How can I automatically scale a $display column width?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多