Home > Community > Forums > Functional Verification > Using variables within range repetition expression in e

## Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

 Send yourself a copy

## Subscribe

• RSS
Cadence RSS Feeds

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

## Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Send Yourself A Copy

# Using variables within range repetition expression in e

Last post Thu, Dec 26 2013 5:37 AM by myonlyscreen. 2 replies.
 Started by myonlyscreen 17 Dec 2013 04:14 AM. Topic has 2 replies and 4748 views
• #### Tue, Dec 17 2013 4:14 AM

Using variables within range repetition expression in e
 Hi.I am facing some problems with using var in  range repetition expression.I have the next code :a : unit;b : uint;keep b == a + 1234; event e1;event e2;expect {@e1;[a]*@clk} => @e2 ; //  <== this works ! expect {@e1;[a..b]*@clk} => @e2 ; //  <== this doesn't work !I am geting the next error :  *** Error: first match variable repeat can only be used inside a sequence Why ? does cadence supports such usage of the range repetition expresion ?How do you recomend to workaround this problem ? (well beside the obivuos solution to replace it with TCM).Regards,E.M.
• Post Points: 20
• #### Thu, Dec 19 2013 3:51 AM

• hannes
• Joined on Fri, Nov 14 2008
• Bracknell, Berkshire
• Posts 50
• Points 895
Re: Using variables within range repetition expression in e
 Hi,if you have a first match variable repeat ([a..b]*TE) it needs to be followed by something else (some successor event), e.g:expect {@e1; [a..b]*@clk; } => @e2;Btw. [a..b]*@clk succeeds (first match) at [a]*@clk, so the first expect and the second expect you wrote are the same.Maybe you wanted to express something else? There is also a true match repeat (~[..]*TE).Regards,-hannes
• Post Points: 20
• #### Thu, Dec 26 2013 5:37 AM

Re: Using variables within range repetition expression in e
 Hi,Thanks, for clarifying this issue.It does make a lot of sense to add another TE after the range repetition, in-order to avoid getting match on [a]*clk .Thanks again,E.M.
• Post Points: 5
###### Sort Posts: Oldest to newest Newest to oldest
 Started by myonlyscreen at 17 Dec 2013 04:14 AM. Topic has 2 replies.
 About Cadence| Investor Relations| Careers| Terms of Use| Privacy Policy| US Trademarks © Cadence Design Systems, Inc. All Rights Reserved.