#!/usr/bin/perl
use warnings;
use strict;

my $phaseLength = 100;
my $phaseStatus = 0;
my $max = 100000;
my $base = 0;
my $maxAddressExp = 26;
my $maxAddress = 2**$maxAddressExp;

for(my $i = 0; $i < $max; $i++)
{
    if($phaseStatus == 0) # Linear
    {
        my $addr = (($base << 6) + (($i % $phaseLength) << 6)) % $maxAddress;
        print "$i: read 0x".sprintf("%x", $addr)."\n";
    }
    else # Random
    {
        my $addr = (rand(2**($maxAddressExp-6))) << 6;
        print "$i: read 0x".sprintf("%x", $addr)."\n";
    }

    if($i % 100 == 0 && $i != 0)
    {
        $phaseStatus = ($phaseStatus == 0) ? 1 : 0;
        $base = rand(2**($maxAddressExp-6));
    }
}

