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 regarding system verilog

Status
Not open for further replies.

srish

Newbie level 6
Joined
Dec 13, 2011
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,375
i need to write a task which generates random binary data and write it in to a file? can anyone help me because i can not use randomize() method and rand longint because they can not be used without class declaration and my task is not under any class?

---------- Post added at 18:14 ---------- Previous post was at 18:12 ----------

i see $random function but it returns only 32 bit unsigned integer
 

You can use std::randomize(variable) on any variable regardless of whether it is declared in a class.

You can also use std::randomize(variable) with {constraints_on_variable} using the same constraints you could have declared in a class.
 
  • Like
Reactions: srish

    srish

    Points: 2
    Helpful Answer Positive Rating
yes , try to use std::randomize or std::randomize with method to generate random data!
 
  • Like
Reactions: srish

    srish

    Points: 2
    Helpful Answer Positive Rating
Thanku vrymuch ........it really worked out for me ..................but there z one question that if we can give seed to std::randomize(variable) ? and if yes then how can we pass seed value for randomization into this ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top