X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=hdf2arch%2Fbsp2arch.pl;h=986b2cf458a8e0ac11c626d8da4be78f00f023f2;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=6e80ed066ff520a30b3b08796297ffabc8048750;hpb=43d950acc04e4ebaff00908b61b622d3d6e9b376;p=jump.git diff --git a/hdf2arch/bsp2arch.pl b/hdf2arch/bsp2arch.pl index 6e80ed0..986b2cf 100755 --- a/hdf2arch/bsp2arch.pl +++ b/hdf2arch/bsp2arch.pl @@ -19,14 +19,17 @@ if(!$infile || !$outfile) { # parse input xml file my $input = XMLin($infile, ForceArray => '1', KeyAttr => ['chips']); - -# per-core definitions +# output content my @processors; my @memories; +my @hw_channels; + +# per-core definitions foreach my $chips ($input->{'chips'}->[0]->{'chip'}) { foreach my $chip (@$chips) { $chip->{'id'} =~ /\((\d+),(\d+)\)/; - my @origin = ($1, $2); + my @origin = ($1, $2); + my $version = $chip->{'version'}; foreach my $row (1..$chip->{'rows'}) { foreach my $col (1..$chip->{'cols'}) { @@ -41,7 +44,7 @@ foreach my $chips ($input->{'chips'}->[0]->{'chip'}) { 'type' => 'RISC', 'configuration' => [ { 'name' => 'version', - 'value' => '3' }, + 'value' => $version }, ], }; @@ -59,13 +62,26 @@ foreach my $chips ($input->{'chips'}->[0]->{'chip'}) { push @memories, { 'name' => "regs_${newrow}_${newcol}", 'type' => 'REG', + 'configuration' => [ + { 'name' => 'size', + 'value' => '0x7FF' }, + ], } } } - } } +# ARM host processor +push @processors, { + 'name' => 'arm_0', + 'type' => 'RISC', + 'configuration' => [ + { 'name' => 'cores', + 'value' => '2' }, + ] +}; + # external memory foreach my $banks ($input->{'external_memory'}->[0]->{'bank'}) { my $counter = 0; @@ -77,6 +93,12 @@ foreach my $banks ($input->{'external_memory'}->[0]->{'bank'}) { push @memories, { 'name' => "emem_${counter}", 'type' => 'DXM', + 'configuration' => [ + { 'name' => 'size', + 'value' => $bank->{'size'} }, + { 'name' => 'start', + 'value' => $bank->{'start'} } + ] }; next; say "Warning: Unknown Extmem $bank->{'name'}!"; @@ -85,7 +107,6 @@ foreach my $banks ($input->{'external_memory'}->[0]->{'bank'}) { } # TODO: add hw_channels data -my @hw_channels; # generate XML output my $output = {