# Syntax error in assertion

**URL:** <https://verificationacademy.com/forums/t/syntax-error-in-assertion/31009>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, assertion, syntax\
**Created:** [September 9, 2015, 2:45am UTC](https://verificationacademy.com/forums/t/syntax-error-in-assertion/31009 "2015-09-09T02:45:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktong](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@ktong](https://verificationacademy.com/forums/u/ktong)\
**Post date:** [September 9, 2015, 2:45am UTC](https://verificationacademy.com/forums/t/syntax-error-in-assertion/31009/1 "2015-09-09T02:45:10Z")

</div>

I have an assertion that look something like this

```verilog

module tb;
.
.
.
generate
property clk_req_up;
 @(clk) disable iff (~out_of_reset) req |-> ##[1:5] ack;
endproperty
clk_req_up_assert: assert property (clk_req_up) else $error("clk_req_up: assertion failed");
endgenerate
.
.
.

```

I am getting compilation error like this:  
System verilog keyword ‘assert’ is not expected to be used in this context.

Anything goes wrong here?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [September 9, 2015, 3:54am UTC](https://verificationacademy.com/forums/t/syntax-error-in-assertion/31009/2 "2015-09-09T03:54:58Z")

</div>

This code compiles fine for me in Questa (declaring all variables as   
bit or   
wire and adding   
endmodule).

Usually when perfectly legal looking code does not compile, it is a problem with the code that comes before it.

Or it could be a problem with the version of the tool that you are using. If that is the case, you will need to contact your vendor.
