OpenCores
URL https://opencores.org/ocsvn/ahb_master/ahb_master/trunk

Subversion Repositories ahb_master

[/] [ahb_master/] [trunk/] [src/] [gen/] [prgen_rand.v] - Diff between revs 5 and 10

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 5 Rev 10
Line 64... Line 64...
 
 
function integer align;
function integer align;
      input [31:0]  num;
      input [31:0]  num;
      input [31:0]  align_size;
      input [31:0]  align_size;
 
 
      integer       align;
 
      begin
      begin
         align = num - (num % align_size);
         align = num - (num % align_size);
      end
      end
endfunction
endfunction
 
 
 
 
function integer rand_align;
function integer rand_align;
      input [31:0] min;
      input [31:0] min;
      input [31:0] max;
      input [31:0] max;
      input [31:0] align;
      input [31:0] align_val;
 
 
      integer      rand_align;
 
      begin
      begin
         rand_align = rand(min, max);
         rand_align = rand(min, max);
 
 
         if (rand_align > align)
         if (rand_align > align_val)
           rand_align = align(rand_align, align);
           rand_align = align(rand_align, align_val);
      end
      end
endfunction
endfunction
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.