How to create a string from a pre-processor macro

前端 未结 3 1513
臣服心动
臣服心动 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-01 23:54

    I think this is what you're looking for.

    `define HPATH `"top.chip.block`"
    string hpath = `HPATH;
    

    As toolic pointed out, the escape sequence %m will give you the current hierarchy when used in a $display statement so that may be a better option.

提交回复
热议问题