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

Subversion Repositories theia_gpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /theia_gpu/branches
    from Rev 194 to Rev 195
    Reverse comparison

Rev 194 → Rev 195

/icarus_version/testbench/TestBench_verilog.v
40,7 → 40,7
`define RESOLUTION_HEIGHT (rSceneParameters[14] >> `SCALE)
`define DELTA_ROW (32'h1 << `SCALE)
`define DELTA_COL (32'h1 << `SCALE)
`define TEXTURE_BUFFER_SIZE (256*256*3)
 
`define MAX_WIDTH 200
`define MAX_SCREENBUFFER (`MAX_WIDTH*`MAX_WIDTH*3)
module TestBench_Theia;
67,10 → 67,10
reg TMWE_O;
reg [31:0] rControlRegister[2:0];
integer file, log;
reg [31:0] rSceneParameters[512:0];
reg [31:0] rVertexBuffer[7000:0];
reg [31:0] rSceneParameters[`PARAMS_ARRAY_SIZE-1:0];
reg [31:0] rVertexBuffer[`VERTEX_ARRAY_SIZE-1:0];
reg [31:0] rInstructionBuffer[512:0];
reg [31:0] rTextures[`TEXTURE_BUFFER_SIZE:0]; //Lets asume we use 256*256 textures
reg [31:0] rTextures[`TEXTURE_BUFFER_SIZE-1:0]; //Lets asume we use 256*256 textures
reg [7:0] rScreen[`MAX_SCREENBUFFER-1:0];
wire wDone;
85,11 → 85,11
wire STDONE_O;
wire wGPUCommitedResults;
wire wHostDataAvailable;
 
 
wire[`WB_WIDTH-1:0] wHostReadAddress;
 
 
wire[`WB_WIDTH-1:0] wHostReadAddress;
wire[`WB_WIDTH-1:0] wMemorySize;
wire[1:0] wMemSelect;
wire[1:0] wMemSelect;
 
MUXFULLPARALELL_2SEL_GENERIC # ( `WB_WIDTH ) MUX2
(
99,9 → 99,9
.I3( rVertexBuffer[0] ),
.I4(0),
.O1(wMemorySize)
);
);
//---------------------------------------------
top Top
(
109,7 → 109,7
.Reset( Reset ),
.iHostEnable( rHostEnable ),
.oHostReadAddress( wHostReadAddress),
.iMemorySize( wMemorySize ),
.iMemorySize( wMemorySize ),
.oMemSelect( wMemSelect ),
.iInstruction( rInstructionBuffer[wHostReadAddress] ),
.iParameter( rSceneParameters[wHostReadAddress] ),
119,10 → 119,10
.iTMEMAdr( TMADR_O ),
.iTMEMData( TMDAT_O ),
.iTMEM_WE( TMWE_O ),
.iTMEM_Sel( TMSEL_O ),
.iOMEMBankSelect( wOMEMBankSelect ),
.iTMEM_Sel( TMSEL_O ),
.iOMEMBankSelect( wOMEMBankSelect ),
.iOMEMReadAddress( wOMEMReadAddr ),
.oOMEMData( wOMEMData ),
.oOMEMData( wOMEMData ),
 
.iWidth(`RESOLUTION_WIDTH),
.iHeight(`RESOLUTION_HEIGHT),
153,6 → 153,7
 
if (wDone == 1'b1)
begin
$fwrite(log, "Simulation end time : %dns\n",$time);
 
$display("Partition Size = %d",`PARTITION_SIZE);
for (kk = 0; kk < `MAX_CORES; kk = kk+1)
180,7 → 181,7
 
$fclose(out2);
$fwrite(log, "Simulation end time : %dns\n",$time);
$fclose(log);
 
271,15 → 272,15
$fflush;
end
end
$display("\nDone Intilializing TMEM @ %dns",$time);
TMWE_O = 0;
rHostEnable = 1;
log = $fopen("Simulation.log");
$fwrite(log, "Simulation start time : %dns\n",$time);
$fwrite(log, "Width : %d\n",`RESOLUTION_WIDTH);
$fwrite(log, "Height : %d\n",`RESOLUTION_HEIGHT);
//Start dumping VCD
$display("-I- Starting VCD Dump\n");
$dumpfile("TestBench_Theia.vcd");
/icarus_version/rtl/aDefinitions.v
33,6 → 33,12
`define MAX_TMEM_BANKS 4 //The number of memory banks for TMEM
`define MAX_TMEM_BITS 2 //2 ^ MAX_TMEM_BANKS = MAX_TMEM_BITS
`define SELECT_ALL_CORES `MAX_CORES'b1111 //XXX: Change for more cores
 
//Defnitions for the input file size (avoid nasty warnings about the size of the file being different from the
//size of the array which stores the file in verilog
`define PARAMS_ARRAY_SIZE 43 //The maximum number of byte in this input file
`define VERTEX_ARRAY_SIZE 7000 //The maximum number of byte in this input file
`define TEXTURE_BUFFER_SIZE 196608 //The maximum number of byte in this input file
//---------------------------------------------------------------------------------
//Verilog provides a `default_nettype none compiler directive. When
//this directive is set, implicit data types are disabled, which will make any
/icarus_version/simulation/Makefile
11,6 → 11,8
#iverilog CONFIG
VERILOG_CMD = iverilog
GPUCORES = 4
WIDTH = 200
HEIGHT = 200
GPUMEMBANKS = $(GPUCORES)
#VERILOG_FLAGS =
69,7 → 71,7
@exit 2
endif
cp -f $(SCENEPATH)/*.mem .
perl $(INPUTCONFIGURATIONSCRIPT) $(GPUCORES)
perl $(INPUTCONFIGURATIONSCRIPT) $(GPUCORES) $(WIDTH) $(HEIGHT)
$(VVP_CMD) ./$(TESTBENCH) -$(DUMPTYPE) $(VVP_FLAGS)
view : testbench_check
/icarus_version/scripts/run_regressions.pl
82,17 → 82,17
copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
copy("$TestPath/Instructions.mem","$TestDir/") or die "-E- $TestPath/Instructions.ppm $!\n";
#Print some information about the scene
my $Line = `grep -i width $TestDir/Params.mem`;
my ($Width,$Height) = split(" ", $Line);
$Width = (hex $Width)/$Scale;
$Height = (hex $Height)/$Scale;
my $Width = $TestList{$TestName}->{'width'};
my $Height = $TestList{$TestName}->{'height'};
print LOG "Scene Resolution: $Width x $Height\n";
$Line = `grep -i texture $TestDir/Params.mem`;
my ($Width,$Height) = split(" ", $Line);
$Width = (hex $Width)/$Scale;
$Height = (hex $Height)/$Scale;
print LOG "Texture: $Width x $Height\n";
my $Line = `grep -i texture $TestDir/Params.mem`;
my ($tWidth,$tHeight) = split(" ", $Line);
$tWidth = (hex $tWidth)/$Scale;
$tHeight = (hex $tHeight)/$Scale;
print LOG "Texture: $tWidth x $tHeight\n";
my $TringleCount = `grep -A 1 -i child $TestDir/Vertex.mem | grep -v -i child`;
print LOG "Triangle count: $TringleCount\n";
114,7 → 114,7
";
chdir "../simulation";
if ( system("make compile GPUCORES=$CoreCount GPUMEMBANKS=$MemBankCount") != 0)
if ( system("make compile GPUCORES=$CoreCount GPUMEMBANKS=$MemBankCount WIDTH=$Width HEIGHT=$Height") != 0)
{
die "-E- Error compiling test code! ($!)\n";
}
182,6 → 182,13
close F;
return $string;
}
#-------------------------------------------------------------------------------
sub Round
{
my $number = shift;
my $rounded = sprintf("%.3f", $number);
return $rounded;
}
#----------------------------------------------------------------
sub ParseOutputPPM()
{
209,5 → 216,22
$i++;
}
close FILE;
my $TotalTime = 0;
open F, "$TestDir/Simulation.log" or die "$TestDir/Simulation.log' : $!\n";
 
 
local $/=undef;
my $Temp = <F>;
close F;
my($junk,$StartSimTime) = split /Simulation start time \:\s+/,$Temp;
my($junk,$EndSimTime) = split /Simulation end time \:\s+/,$Temp;
$StartSimTime =~ s/ns//;
$EndSimTime =~ s/ns//;
$TotalTime = ($EndSimTime-$StartSimTime)/1000000000;
print LOG "Simulated start time: $StartSimTime\n";
print LOG "Simulated end time: $EndSimTime\n";
print LOG "Total Time: $TotalTime seconds\n";
print LOG "Theorical FPS: ". Round( (1 /$TotalTime) )."\n";
}
 
/icarus_version/scripts/testlist.pl
7,16 → 7,33
%TestList
=
(
'test_1' => {run_index => 1, path => "../examples/scenes/example1/", core_count => 2, mem_bank_count => 2, },
'test_2' => {run_index => 2, path => "../examples/scenes/example1/", core_count => 4, mem_bank_count => 4, },
'test_3' => {run_index => 3, path => "../examples/scenes/example1/", core_count => 8, mem_bank_count => 8, },
'test_4' => {run_index => 4, path => "../examples/scenes/example1/", core_count => 16, mem_bank_count => 16,},
'test_5' => {run_index => 5, path => "../examples/scenes/example2/", core_count => 4, mem_bank_count => 4, },
'test_6' => {run_index => 6, path => "../examples/scenes/example2/", core_count => 8, mem_bank_count => 8, },
'test_7' => {run_index => 7, path => "../examples/scenes/example2/", core_count => 16, mem_bank_count => 16, },
'test_8' => {run_index => 8, path => "../examples/scenes/example3/", core_count => 4, mem_bank_count => 4, },
'test_9' => {run_index => 9, path => "../examples/scenes/example3/", core_count => 8, mem_bank_count => 8, },
'test_10' => {run_index => 10, path => "../examples/scenes/example3/", core_count => 16, mem_bank_count => 16, },
'test_1' => {run_index => 1, path => "../examples/scenes/example1/", core_count => 2, mem_bank_count => 2, width => 512, height => 512 },
'test_2' => {run_index => 2, path => "../examples/scenes/example1/", core_count => 4, mem_bank_count => 4, width => 512, height => 512 },
'test_3' => {run_index => 3, path => "../examples/scenes/example1/", core_count => 8, mem_bank_count => 8, width => 512, height => 512 },
'test_4' => {run_index => 4, path => "../examples/scenes/example1/", core_count => 16, mem_bank_count => 16,width => 512, height => 512},
'test_5' => {run_index => 5, path => "../examples/scenes/example1/", core_count => 32, mem_bank_count => 32, width => 512, height => 512},
'test_6' => {run_index => 6, path => "../examples/scenes/example1/", core_count => 64, mem_bank_count => 64, width => 512, height => 512},
'test_7' => {run_index => 7, path => "../examples/scenes/example1/", core_count => 128, mem_bank_count => 128, width => 512, height => 512},
'test_8' => {run_index => 8, path => "../examples/scenes/example1/", core_count => 256, mem_bank_count => 256, width => 512, height => 512},
'test_9' => {run_index => 9, path => "../examples/scenes/example1/", core_count => 512, mem_bank_count => 512, width => 512, height => 512},
'test_10' => {run_index => 10, path => "../examples/scenes/example2/", core_count => 2, mem_bank_count => 2, width => 512, height => 512 },
'test_11' => {run_index => 11, path => "../examples/scenes/example2/", core_count => 4, mem_bank_count => 4, width => 512, height => 512 },
'test_12' => {run_index => 12, path => "../examples/scenes/example2/", core_count => 8, mem_bank_count => 8, width => 512, height => 512 },
'test_13' => {run_index => 13, path => "../examples/scenes/example2/", core_count => 16, mem_bank_count => 16, width => 512, height => 512 },
'test_14' => {run_index => 14, path => "../examples/scenes/example2/", core_count => 32, mem_bank_count => 32, width => 512, height => 512 },
'test_15' => {run_index => 15, path => "../examples/scenes/example2/", core_count => 64, mem_bank_count => 64, width => 512, height => 512 },
'test_16' => {run_index => 16, path => "../examples/scenes/example2/", core_count => 128, mem_bank_count => 128, width => 512, height => 512 },
'test_17' => {run_index => 17, path => "../examples/scenes/example2/", core_count => 256, mem_bank_count => 256, width => 512, height => 512 },
'test_18' => {run_index => 18, path => "../examples/scenes/example2/", core_count => 512, mem_bank_count => 512, width => 512, height => 512 },
'test_19' => {run_index => 19, path => "../examples/scenes/example3/", core_count => 2, mem_bank_count => 2, width => 512, height => 512 },
'test_20' => {run_index => 20, path => "../examples/scenes/example3/", core_count => 4, mem_bank_count => 4, width => 512, height => 512 },
'test_21' => {run_index => 21, path => "../examples/scenes/example3/", core_count => 8, mem_bank_count => 8, width => 512, height => 512 },
'test_22' => {run_index => 22, path => "../examples/scenes/example3/", core_count => 16, mem_bank_count => 16, width => 512, height => 512 },
'test_23' => {run_index => 23, path => "../examples/scenes/example3/", core_count => 32, mem_bank_count => 32, width => 512, height => 512 },
'test_24' => {run_index => 24, path => "../examples/scenes/example3/", core_count => 64, mem_bank_count => 64, width => 512, height => 512 },
'test_25' => {run_index => 25, path => "../examples/scenes/example3/", core_count => 128, mem_bank_count => 128, width => 512, height => 512 },
'test_25' => {run_index => 26, path => "../examples/scenes/example3/", core_count => 256, mem_bank_count => 256, width => 512, height => 512 },
'test_27' => {run_index => 27, path => "../examples/scenes/example3/", core_count => 512, mem_bank_count => 512, width => 512, height => 512 },
 
);
/icarus_version/scripts/configure_gpu.pl
21,9 → 21,12
use Tie::File;
$NumberOfCores = $ARGV[0];
$NumberOfBanks = $ARGV[1];
$MaxVertexBufferSize = $ARGV[2];
$MaxTextureBufferSize = $ARGV[3];
 
 
 
 
die "\nusage:\nconfigure_gpu.pl number_of_cores width height\n\n" if (not defined $NumberOfCores );
 
 
30,11 → 33,22
if (not defined $NumberOfBanks)
{
$NumberOfBanks = $NumberOfCores;
print "Number of TMEM banks not specified, making default to Number of execution cores ($NumberOfCores)\n";
print "Number of TMEM banks not specified, making default to Number of execution cores ($NumberOfCores)\n";;
}
if (not defined $MaxVertexBufferSize)
{
$MaxVertexBufferSize = 7000;
print "Vertex Buffer Size was no defined\n, making vertex buffer size default value of $MaxVertexBufferSize Bytes\n";
}
if (not defined $MaxTextureBufferSize)
{
print "Texture Buffer Size was no defined\n, making texture buffer big enough to store 256x256 textures\n";
$MaxTextureBufferSize = 256*256*3;
}
 
$DefsPath = "../rtl/aDefinitions.v";
$TopPath = "../rtl/Theia.v";
 
$TestBenchPath = "../rtl/TestBench_THEIA.v";
$RCOMMIT_O = "assign RCOMMIT_O = wRCommited[0]";
$HDL_O = "assign HDL_O = wHostDataLatched[0]";
72,10 → 86,14
s/define MAX_TMEM_BANKS .*(\/\/.*)/define MAX_TMEM_BANKS $NumberOfBanks \t\t$1/;
$MaxCoreBits = log( $NumberOfCores ) / log(2);
$MaxBankBits = log( $NumberOfBanks ) / log(2);
$MaxParamSize = (19 + 3*2*$NumberOfCores);
 
s/define MAX_CORE_BITS .*(\/\/.*)/define MAX_CORE_BITS $MaxCoreBits \t\t$1/;
s/define SELECT_ALL_CORES .*(\/\/.*)/$SELECT_ALL_CORES \t\t$1/;
s/define MAX_TMEM_BITS .*(\/\/.*)/define MAX_TMEM_BITS $MaxBankBits \t\t$1/;
s/define PARAMS_ARRAY_SIZE .*(\/\/.*)/define PARAMS_ARRAY_SIZE $MaxParamSize \t\t$1/;
s/define VERTEX_ARRAY_SIZE .*(\/\/.*)/define VERTEX_ARRAY_SIZE $MaxVertexBufferSize \t\t$1/;
s/define TEXTURE_BUFFER_SIZE .*(\/\/.*)/define TEXTURE_BUFFER_SIZE $MaxTextureBufferSize \t\t$1/;
}
untie @array;
 
/icarus_version/scripts/configure_params.pl
42,6 → 42,10
$array[5] =~ m/(\w+)\s+(\w+).*/g;
$Widht = hex($1) / (2 ** $Scale);
$Height = hex($2) / (2 ** $Scale)
} else {
$array[5] = hex($Widht*2)."0000 ".hex($Height*2)."0000 0";
}
 
print

powered by: WebSVN 2.1.0

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