# LRM 1800-2017

**URL:** <https://verificationacademy.com/forums/t/lrm-1800-2017/36234>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, LRM, static, LRM-1800-2017-Section-621\
**Created:** [June 30, 2019, 5:09am UTC](https://verificationacademy.com/forums/t/lrm-1800-2017/36234 "2019-06-30T05:09:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NaveenReddy](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/ea5d25/32.png) [@NaveenReddy](https://verificationacademy.com/forums/u/NaveenReddy)\
**Post date:** [June 30, 2019, 5:09am UTC](https://verificationacademy.com/forums/t/lrm-1800-2017/36234/1 "2019-06-30T05:09:31Z")

</div>

Hi,  
In the below code from the LRM material(section 6.21 scope and lifetime) the “int loop3 = 0;” is stated as illegal statement but when running this code in EDA playground it works perfectly fine. I understood the behavior of the loop3 valiable as static but what i didn’t get is why LRM mentioned it as illegal statement.  
Also few lines above in the same section I see this information  
However, an explicit static keyword shall be required when an initialization value is specified as part of a  
static variable’s declaration to indicate the user’s intent of executing that initialization only once at the  
beginning of the simulation.

If that is the case, are the tools smart enough to understand and rewrite internally?

```verilog
module top_illegal; // should not compile
initial begin
int svar2 = 2; // static/automatic needed to show intent
for (int i=0; i<3; i++) begin
int loop3 = 0; // illegal statement
for (int i=0; i<3; i++) begin
loop3++;
$display(loop3);
end
end
end
endmodule : top_illegal

```

---

<div class="post-metadata">

**Author:** ![sbellock](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/f4b2a3/32.png) [@sbellock](https://verificationacademy.com/forums/u/sbellock)\
**Post date:** [July 1, 2019, 2:21pm UTC](https://verificationacademy.com/forums/t/lrm-1800-2017/36234/2 "2019-07-01T14:21:14Z")

</div>

_In reply to [ven@pdx.edu](https://verificationacademy.com/forums/t/lrm-1800-2017/36234):_

This appears to be a popular section of the LRM. Someone asked the same question recently. [See here.](https://verificationacademy.com/forums/systemverilog/compile-fail-example-ieee-systemverilog)
