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

open(LINEAR, "> ../traces/linear.stl");
open(RANDOM, "> ../traces/random.stl");

my $length = shift || die ("please give length of traces");
my $size = 0x40;

for(my $i=0; $i < $length; $i++)
{
    my $r = int(rand($length));
    #print $r." ".($size*$r)."\n";
    
    print LINEAR "$i: read ".sprintf("0x%x",($size*$i))."\n";
    print RANDOM "$i: read ".sprintf("0x%x",($size*$r))."\n";

    #my $rw = int(rand(2))%2;
    #if($rw == 0)
    #{
    #    print LINEAR "$i: read ".sprintf("0x%x",($size*$i))."\n";
    #    print RANDOM "$i: read ".sprintf("0x%x",($size*$r))."\n";
    #}
    #else
    #{
    #    print LINEAR "$i: write ".sprintf("0x%x",($size*$i))."\n";
    #    print RANDOM "$i: write ".sprintf("0x%x",($size*$r))."\n";
    #}
}


close(LINEAR);
close(RANDOM);
