Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert FAILURE RandomPkg #30

Closed
slaweksiluk opened this issue Dec 6, 2018 · 1 comment
Closed

Alert FAILURE RandomPkg #30

slaweksiluk opened this issue Dec 6, 2018 · 1 comment
Assignees

Comments

@slaweksiluk
Copy link

During tests with usage of RandomPType sometimes I receive following error:

%% Alert FAILURE RandomPkg.(RandIntV | RandRealV | RandTimeV): Unique > number of values available at 35 ns

%% Alert Stop Count on FAILURE reached at 35 ns 
%% DONE  FAILED  AlertLogTop  Total Error(s) = 1  Failures: 1  Errors: 0  Warnings: 0  at 35 ns

what does it mean?

@JimLewis
Copy link
Member

JimLewis commented Dec 7, 2018

It would be easier to comment if you would share what you are trying to do and your code.

RandIntV | RandRealV | RandTimeV are overloaded. The simplest form is:

-- Generate 10 integer values in the range 0 to 255 
IntV(1 to 10) := RV.RandIntV(0, 255, 10) ;

However there are times when you want to not repeat either the last value or some number of the previous values. This is handled by:

-- Generate 10 integer values in the range 0 to 255, do repeat the last value 
IntV(1 to 10) := RV.RandIntV(0, 255, 1, 10) ;

What happened in your case is that you asked it go create more unique values than are in the set of numbers you are selecting between - and hence, it is not possible to satisfy your request. The following would also generate the same error:

IntV(1 to 10) := RV.RandIntV(0, 4, 10, 10) ;

This is discussed in the user guide section 7 Randomizing Sets of Values.

@JimLewis JimLewis closed this as completed Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants