RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: replace randomize()
Prev Next
You are not authorized to post a reply.

Author Messages
MihaelaUser is Offline

Posts:3

02/03/2010 5:15 AM  

I need your help on the following matter:

The code below has been created for Questa and I want to make some modifications to port it to ModelSim DE (ModelSim DE does not support randomize() method and randcase).

I need to change the pattern generator such that it works without the randomize method.

I was thinking about changing it in a way that the system task $random or $urandom, $urandom_range(), is used for data generation.

 

.........

typedef enum {reset, load, count } commands;

commands cmds;

load_cmds ld_cmds;

count_cmds cnt_cmds;

 

     while (cnt < NUM_CMDS+1)

       begin : loop

       if (!cnt)

         begin

           size[cnt] = 3'b001; // start with reset

           cmd_que.push_back({8'h00,3'b001});

         end

       else

         if (size[cnt-1] == 3'b001) // if last command reset then issue unreset command

           begin

             size[cnt] = 3'b010;

             cmd_que.push_back({8'h00,3'b010});

           end

         else

           begin

             if (cnt > NUM_CMDS/2)

               // randomly do resets

               assert (randomize (cmds) with {cmds dist {reset :=2, load :=1, count :=7};}) else

               $error("Randomize of commands failed");

             else if (cnt > NUM_CMDS/4)

               // mainly do counts

               assert (randomize (cmds) with {cmds dist {reset :=0, load :=1, count :=9};}) else

               $error("Randomize of commands failed");

             else

               // mainly do loads

               assert (randomize (cmds) with {cmds dist {reset :=0, load :=9, count :=1};}) else

               $error("Randomize of commands failed");

 

Could you please let me know how it would be possible to change that.


Thanks

You are not authorized to post a reply.



ActiveForums 3.7
  

 Copyright 2008 by SystemVerilog User Group Contact Us    Privacy Statement