How to create a string from a pre-processor macro

前端 未结 3 1506
臣服心动
臣服心动 2021-02-01 23:46

I have a preprocessor macro that represents a hierarchical path into my design.

Example:

`define HPATH top.chip.block

I need to constru

3条回答
  •  臣服心动
    2021-02-02 00:17

    I know this is an old thread, but I thought I'd share our solution. The use of the $sformatf allows additional information to be added if needed.

    `define STRINGIFY(DEFINE) $sformatf("%0s", `"DEFINE`")
    

提交回复
热议问题