# 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'}) {
'type' => 'RISC',
'configuration' => [
{ 'name' => 'version',
- 'value' => '3' },
+ 'value' => $version },
],
};
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;
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'}!";
}
# TODO: add hw_channels data
-my @hw_channels;
# generate XML output
my $output = {