Hi Forum ,
I was going through LRM-2017 , Section 22.5.1 ::
// CODE I
`define HI Hello
`define LO `"`HI, world`"
`define H(x) `"Hello, `x `"
initial begin
$display(`"`HI, world`");
$display(`LO);
$display(`H(world));
$display(`H(HI));
end
[Q1] Am I correct to expect the Output as follow ::
**Hello, world
Hello, world
Hello, `world
Hello, Hello**
[Q2] For the 3rd line , should it be an error ( Since world isn't actually a Macro** ) OR Should it Simply display it as a string i.e **
world
I then have CODE II which is copy from LRM
// CODE II
`ifdef LRM
`define msg(x,y) `"x: `\`"y`\`" `"
`else
`define msg(x,y) `"x: \\\"y\\\" `"
`endif
initial begin
$display(`"ABD"); // [1] Why Error , If I start with `" Can't I end it with " ??
$display(`"\"`");
$display(`msg(left side,right side));
end
[Q3] I see a Compilation error with 1st $display(). If I begin using " , is it Compulsory to end it with
" , can’t I end it with " ?
[Q4] Is there a difference between ::
(a) $display(`"\"`");
(b) $display(`"`\`"`");
Won't both Give Same Output ( i.e Quotation Mark ) :: **"**
[Q5] Similarly is there a difference between ::
(a) `define msg(x,y) `"x: `\`"y`\`" `"
(b) `define msg(x,y) `"x: \\\"y\\\" `"
Thanks .