***** Repeated from Software discussion: ***************
Hello all,
I figured this out with a few tips from Altera. The declaration of the array and the decalred pointer create a buffer in the .bss portion
of the code. So I just enabled a object dump file to correlate where my main buffer is located. I then wrote a small perl script to generate some bogus vectors that I would concatenate with the program .dat files. It seems to work okay.
Just thought this post might save someone some time if they go with the Nios sim route:
Here is the script:
*****************************************
# Open Outfile# Create video memory for simualtion# Then paste to Prog .DAT file# <main_frame_buffer> = Hex 40e200/ 4 = 3880 ( Because we have 4 byte lanes) = Dec 14464# So Make $mem_depth = Hex 3880 + Hex 75300 = Hex 78B80 = Dec 494464# Dec 480_000 = Hex 75300
my $out_3_FH;
open($out_3_FH, ">sram_prog_buff_1_lane3.dat") || die "Cannot open data:";
my $out_2_FH;
open($out_2_FH, ">sram_prog_buff_1_lane2.dat") || die "Cannot open data:";
my $out_1_FH;
open($out_1_FH, ">sram_prog_buff_1_lane1.dat") || die "Cannot open data:";
my $out_0_FH;
open($out_0_FH, ">sram_prog_buff_1_lane0.dat") || die "Cannot open data:";
my $mem_depth = 494464;
for($mem_addr = 14464; $mem_addr < $mem_depth; $mem_addr++)
{
my $out_pixel_at = "@";
my $pixel_data = " AA\n";
my $hex_mem_addr = sprintf("%08X",$mem_addr);
my $mem_pixel = $out_pixel_at . $hex_mem_addr . $pixel_data;
print{ $out_3_FH } $mem_pixel;
}
for($mem_addr = 14464; $mem_addr < $mem_depth; $mem_addr++)
{
my $out_pixel_at = "@";
my $pixel_data = " BB\n";
my $hex_mem_addr = sprintf("%08X",$mem_addr);
my $mem_pixel = $out_pixel_at . $hex_mem_addr . $pixel_data;
print{ $out_2_FH } $mem_pixel;
}
for($mem_addr = 14464; $mem_addr < $mem_depth; $mem_addr++)
{
my $out_pixel_at = "@";
my $pixel_data = " CC\n";
my $hex_mem_addr = sprintf("%08X",$mem_addr);
my $mem_pixel = $out_pixel_at . $hex_mem_addr . $pixel_data;
print{ $out_1_FH } $mem_pixel;
}
for($mem_addr = 14464; $mem_addr < $mem_depth; $mem_addr++)
{
my $out_pixel_at = "@";
my $pixel_data = " DD\n";
my $hex_mem_addr = sprintf("%08X",$mem_addr);
my $mem_pixel = $out_pixel_at . $hex_mem_addr . $pixel_data;
print{ $out_0_FH } $mem_pixel;
}
exit 0
****************************************
-Ray