From 2bc58585fc542a6e5819eeecaee1f4820185149f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 2 Sep 2013 22:59:57 +0200 Subject: [PATCH] bsp2arch.pl: add host processor, emem size to xml --- hdf2arch/bsp2arch.pl | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) 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 = { -- 2.30.2