Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question on constraint randomizing an array in system verilog

Status
Not open for further replies.

sujithad

Newbie level 2
Newbie level 2
Joined
Jun 24, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
14
Hi

I have an array of 512 entries each entry being 1024 bits size.

rand bit [1023:0] entry_rand [512];

I want to constraint randomize such that each entry is non-zero but only few bits in the entry are set.

Eg: Out of 1024 bit, I need only 5 bits be set to 1 & others be 0.

Can anyone help me how to write constraint for this?

constraint entry_rand_c {
foreach (entry_rand) {
}
}

Thanks
=sd
 


Re: Question on constraint randomizing an array in systemverilog

Thanks. But when run on IUS, I get this error
*E: A 'system task/function call' cannot be used within a constraint expression.

Is there a workaround for this?

Read **broken link removed** that is down for SQL maintenance at the moment. One can only hope they are upgrading to MariaDB. ;)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top