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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [geda/] [gen_geda] - Blame information for rev 135

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 135 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3
#/**********************************************************************/
4
#/*                                                                    */
5
#/*             -------                                                */
6
#/*            /   SOC  \                                              */
7
#/*           /    GEN   \                                             */
8
#/*          /    TOOL    \                                            */
9
#/*          ==============                                            */
10
#/*          |            |                                            */
11
#/*          |____________|                                            */
12
#/*                                                                    */
13
#/*                                                                    */
14
#/*                                                                    */
15
#/*                                                                    */
16
#/*  Author(s):                                                        */
17
#/*      - John Eaton, jt_eaton@opencores.org                          */
18
#/*                                                                    */
19
#/**********************************************************************/
20
#/*                                                                    */
21
#/*    Copyright (C) <2010-2011>                */
22
#/*                                                                    */
23
#/*  This source file may be used and distributed without              */
24
#/*  restriction provided that this copyright statement is not         */
25
#/*  removed from the file and that any derivative work contains       */
26
#/*  the original copyright notice and the associated disclaimer.      */
27
#/*                                                                    */
28
#/*  This source file is free software; you can redistribute it        */
29
#/*  and/or modify it under the terms of the GNU Lesser General        */
30
#/*  Public License as published by the Free Software Foundation;      */
31
#/*  either version 2.1 of the License, or (at your option) any        */
32
#/*  later version.                                                    */
33
#/*                                                                    */
34
#/*  This source is distributed in the hope that it will be            */
35
#/*  useful, but WITHOUT ANY WARRANTY; without even the implied        */
36
#/*  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR           */
37
#/*  PURPOSE.  See the GNU Lesser General Public License for more      */
38
#/*  details.                                                          */
39
#/*                                                                    */
40
#/*  You should have received a copy of the GNU Lesser General         */
41
#/*  Public License along with this source; if not, download it        */
42
#/*  from http://www.opencores.org/lgpl.shtml                          */
43
#/*                                                                    */
44
#/**********************************************************************/
45
 
46
 
47
############################################################################
48
# General PERL config
49
############################################################################
50
use Getopt::Long;
51
use English;
52
use File::Basename;
53
use Cwd;
54
use Scalar::Util qw(looks_like_number);
55
use XML::LibXML;
56
use lib './tools';
57
use sys::lib;
58
use yp::lib;
59
use BerkeleyDB;
60
 
61
 
62
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
63
 
64
 
65
############################################################################
66
### Process the options
67
############################################################################
68
Getopt::Long::config("require_order", "prefix=-");
69
GetOptions("h","help",
70
           "envidentifier=s"  => \$envidentifier,
71
           "prefix=s"         => \$prefix,
72
           "vendor=s"         => \$vendor,
73
           "library=s"        => \$library,
74
           "version=s"        => \$version,
75
           "component=s"      => \$component,
76
           "dest_dir=s"       => \$dest_dir
77
) || die "(use '$program_name -h' for help)";
78
 
79
 
80
##############################################################################
81
## Help option
82
##############################################################################
83
if ( $opt_h  or $opt_help  )
84
  { print "\n gen_geda -envidentifier :*Simulation:*  -prefix /work/children -vendor vendor_name -library library_name  -component component_name  -version version_name     \n";
85
    exit 1;
86
  }
87
 
88
 
89
 
90
#############################################################################
91
##
92
##
93
#############################################################################
94
 
95
$home = cwd();
96
 
97
 
98
my $variant;
99
 
100
if($version)       {$variant   = "${component}_${version}";}
101
else               {$variant   = "${component}";}
102
print "\n---GEN_geda    -vendor $vendor -library $library -component $component -version $version    \n";
103
 
104
 
105
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
106
 
107
my $destination = $main_module_name;
108
 
109
my  $configuration = "default";
110
 
111
my $repo           = yp::lib::find_library_repo($vendor,$library);
112
 
113
my $parser = XML::LibXML->new();
114
 
115
my $socgen_file              = $parser->parse_file(yp::lib::find_componentConfiguration($vendor,$library,$component));
116
 
117
unless ($socgen_file)      { print "No socgen ip file   \n";};
118
 
119
my $doc_library_path = $socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:library_path/text()")->to_literal;
120
 
121
my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
122
 
123
my $path  = "${home}${repo}/${vendor}/${library}${doc_library_path}";
124
mkdir $path,0755             unless( -e $path );
125
 
126
 
127
if (defined $dest_dir && length $dest_dir > 0)
128
   {
129
   $doc_library_path = "${doc_library_path}/${dest_dir}";
130
   }
131
 
132
 my $path  = "${home}${repo}/${vendor}/${library}${doc_library_path}";
133
 mkdir $path,0755             unless( -e $path );
134
 
135
 my $sym_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/sym";
136
 mkdir $sym_path,0755             unless( -e $sym_path );
137
 
138
 my $sch_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/sch";
139
 mkdir $sch_path,0755             unless( -e $sch_path );
140
 
141
 
142
 my $png_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/png";
143
 mkdir $png_path,0755             unless( -e $png_path );
144
 
145
 
146
 my $html_path  = "${home}${repo}/${vendor}/${library}${doc_library_path}/html";
147
 mkdir $html_path,0755             unless( -e $html_path );
148
 
149
 
150
   $symfile ="${sym_path}/${destination}.sym";
151
   print "$symfile  \n";
152
   open SYM_FILE,">$symfile" or die "unable to open $symfile";
153
 
154
 
155
   my $sym_pngfile ="${png_path}/${destination}_sym.png";
156
 
157
 
158
 
159
   $schfile ="${sch_path}/${destination}.sch";
160
   print "$schfile  \n";
161
   open SCH_FILE,">$schfile" or die "unable to open $outfile";
162
 
163
 
164
   my $sch_pngfile ="${png_path}/${destination}_sch.png";
165
 
166
 
167
   my $htmlfile ="${html_path}/${destination}.html";
168
 
169
 
170
 
171
  unless( -e $htmlfile )
172
    {
173
    my $cmd = "cp  ${home}/tools/documentation/template.html   $htmlfile      ";
174
    if (system($cmd)) {}
175
    };
176
 
177
 
178
   open HTML_FILE,">$htmlfile" or die "unable to open $outfile";
179
 
180
 
181
 
182
 
183
 
184
 
185
 
186
 
187
 
188
 
189
 
190
 
191
 
192
my   @instantiations    =       ();
193
my   @parameters        =       ();
194
my   %parameter_values  =       ();
195
my   %parameter_descriptions  = ();
196
 
197
 
198
 
199
#/******************************************************************************************/
200
#/*                                                                                        */
201
#/* get parameters                                                                         */
202
#/*                                                                                        */
203
#/******************************************************************************************/
204
 
205
 
206
print "PAM \n";
207
my @Pams = yp::lib::get_parameters($vendor,$library,$component,$version,$configuration);
208
 
209
foreach my $Pam (@Pams)
210
{
211
my $param_name;
212
my $param_value;
213
 
214
 
215
( $param_name,$param_value) = split( /\::/ , $Pam);
216
unless(defined $parameter_values{$param_name}) {push ( @parameters,  "$param_name");};
217
$parameter_values{$param_name} = $param_value;
218
}
219
 
220
 
221
 
222
 
223
my @signals = yp::lib::get_signals($vendor,$library,$component,$version);
224
 
225
 
226
 
227
 
228
 
229
   my @I_names = yp::lib::get_instance_names($vendor,$library,$component,$version,$configuration);
230
 
231
   foreach my $I_name (@I_names)
232
        {
233
        my $foo_ven;
234
        my $foo_lib;
235
        my $foo_cmp;
236
        my $foo_ver;
237
        my $foo_cfg;
238
 
239
        my $vlnvc  = yp::lib::get_instance_vlnvc($vendor,$library,$component,$version,$I_name,$configuration );
240
 
241
          ( $foo_ven,$foo_lib,$foo_cmp,$foo_ver,$foo_cfg) = split( /\:/ , $vlnvc);
242
 
243
 
244
        push @instantiations  , "/*  ${vlnvc}  */ \n";
245
        my $module_name  = yp::lib::get_instance_module_name($vendor,$library,$component,$version,$I_name,$configuration);
246
        if(defined $foo_cfg && length $foo_cfg > 0)
247
          {
248
          push @instantiations  ,          "${module_name}_${foo_cfg}\n";
249
          }
250
        else
251
          {
252
          push @instantiations  ,          "${module_name}\n";
253
          $first = 1;
254
          my @Pams = yp::lib::get_Parameters($vendor,$library,$component,$version,"root.${I_name}",$configuration);
255
          foreach my $pam (@Pams)
256
            {
257
            ( $foo_name,$foo_value) = split( /\::/ , $pam);
258
            if($first)
259
              {
260
              push @instantiations  , "#( .${foo_name} (${foo_value})";
261
              $first = 0;
262
              }
263
            else  {push @instantiations  , ",\n   .${foo_name} (${foo_value})";}
264
            }
265
 
266
          if($first == 0)  { push @instantiations  , ")\n";}
267
          }
268
 
269
          push @instantiations  , "$I_name \n   (\n ";
270
          $first = 1;
271
 
272
          my @Inst_conns = yp::lib::get_instance_adhoc_conns($vendor,$library,$component,$version,$I_name);
273
          my @Buss_conns = yp::lib::get_instance_conns($vendor,$library,$component,$version,$I_name);
274
          foreach my $Buss_conn (@Buss_conns)
275
             {
276
               push @instantiations  ,          "  $Buss_conn";
277
             }
278
          foreach my $Inst_conn (@Inst_conns)
279
             {
280
               push @instantiations  ,          "  $Inst_conn";
281
             }
282
        push @instantiations  , ");\n\n";
283
        }
284
 
285
 
286
 
287
 
288
 
289
 
290
   #/**********************************************************************/
291
   #/*                                                                    */
292
   #/* Add any and all global parameters with their default values        */
293
   #/*                                                                    */
294
   #/**********************************************************************/
295
 
296
 
297
     foreach my $parameter_name (@parameters)
298
        {
299
        my $parameter_value = $parameter_values{$parameter_name};
300
#        print SCH_FILE  "    parameter \n      ${parameter_name}=${parameter_value}";
301
        }
302
 
303
 
304
 
305
 
306
 
307
 
308
 
309
   #/**********************************************************************/
310
   #/*                                                                    */
311
   #/* sort all  ports  with their type, size and direction               */
312
   #/*                                                                    */
313
   #/**********************************************************************/
314
 
315
   my @in_port_list   = ();
316
   my @out_port_list  = ();
317
   my @io_port_list  = ();
318
   my @in_bus_port_list   = ();
319
   my @out_bus_port_list  = ();
320
   my @io_bus_port_list  = ();
321
 
322
 
323
 
324
   my $key;
325
   my $value;
326
 
327
my $in_count;
328
my $out_count;
329
my $in_length;
330
my $out_length;
331
 
332
 
333
   foreach my $signal (@signals)
334
         {
335
         ( ${port_name},${direction},${type},${vector},${left},${right}) = split ':', $signal;
336
#         print " ${port_name},${direction},${type},${vector},${left},${right} \n";
337
         if( ${vector} eq "vector" )
338
            {
339
            $port_name ="${port_name}[${left}:${right}]";
340
            if(  $direction eq "input"   )
341
              {
342
              $in_count = $in_count+1;
343
              push (@in_bus_port_list,  "${port_name}");
344
              my $length = length $port_name;
345
              if($length > $in_length ){$in_length = $length }
346
              }
347
             elsif(  $direction eq "output"   )
348
              {
349
              $out_count = $out_count+1;
350
              push (@out_bus_port_list,  "${port_name}");
351
              my $length = length $port_name;
352
              if($length > $out_length ){$out_length = $length }
353
              }
354
             elsif(  $direction eq "inout"   )
355
              {
356
              $out_count = $out_count+1;
357
              push (@io_bus_port_list,  "${port_name}");
358
              my $length = length $port_name;
359
              if($length > $out_length ){$out_length = $length }
360
              }
361
             }
362
          else
363
            {
364
            if(  $direction eq "input"   )
365
              {
366
              $in_count = $in_count+1;
367
              push (@in_port_list,  "${port_name}");
368
              my $length = length $port_name;
369
              if($length > $in_length ){$in_length = $length }
370
              }
371
            elsif(  $direction eq "output"   )
372
              {
373
              $out_count = $out_count+1;
374
              push (@out_port_list,  "${port_name}");
375
              my $length = length $port_name;
376
              if($length > $out_length ){$out_length = $length }
377
              }
378
            elsif(  $direction eq "inout"   )
379
              {
380
              $out_count = $out_count+1;
381
              push (@io_port_list,  "${port_name}");
382
              my $length = length $port_name;
383
              if($length > $out_length ){$out_length = $length }
384
              }
385
            }
386
         }
387
 
388
 
389
   @in_port_list          = sys::lib::trim_sort(@in_port_list);
390
   @out_port_list         = sys::lib::trim_sort(@out_port_list);
391
   @io_port_list          = sys::lib::trim_sort(@io_port_list);
392
   @in_bus_port_list      = sys::lib::trim_sort(@in_bus_port_list);
393
   @out_bus_port_list     = sys::lib::trim_sort(@out_bus_port_list);
394
 
395
   my @In_port_list      = @in_port_list;
396
   my @Out_port_list     = @out_port_list;
397
   my @Io_port_list      = @io_port_list;
398
   my @In_bus_port_list  = @in_bus_port_list;
399
   my @Out_bus_port_list = @out_bus_port_list;
400
   my @Io_bus_port_list  = @io_bus_port_list;
401
 
402
 
403
   my @hIn_port_list      = @in_port_list;
404
   my @hOut_port_list     = @out_port_list;
405
   my @hIo_port_list      = @io_port_list;
406
   my @hIn_bus_port_list  = @in_bus_port_list;
407
   my @hOut_bus_port_list = @out_bus_port_list;
408
   my @hIo_bus_port_list  = @io_bus_port_list;
409
 
410
 
411
 
412
 
413
#  Dump out symbol
414
 
415
        my $color =  5;
416
        my $size  = 10;
417
        my $max_pins;
418
        if($in_count > $out_count) {$max_pins = $in_count ;} else  {$max_pins = $out_count ;}
419
        my $width = $in_length +$out_length;
420
 
421
        print "SIZE width  $width height $max_pins \n";
422
 
423
 
424
 
425
        my $box_h     = ($max_pins * 200) +300;
426
        my $box_w     = ($in_length +$out_length)*10*$size +400;
427
        my $out_title = ($in_length +$out_length)*10*$size +600;
428
        my $out_edg   = ($in_length +$out_length)*10*$size +700;
429
        my $out_pad   = ($in_length +$out_length)*10*$size +1000;
430
        my $title     = $box_h +150;
431
        my $ref_des   = $box_h +350;
432
        my $vlnv      = $box_h +500;
433
 
434
        printf SYM_FILE ("v 20100214 1\n");
435
        printf SYM_FILE ("B 300 0  $box_w $box_h 3 60 0 0 -1 -1 0 -1 -1 -1 -1 -1\n");
436
        printf SYM_FILE ("T 400 $title   5 10 1 1 0 0 1 1\ndevice=${main_module_name}\n");
437
        printf SYM_FILE ("T 400 $ref_des 5 10 1 1 0 0 1 1\nrefdes=U?\n");
438
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nvendor=${vendor}\n");
439
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nlibrary=${library}\n");
440
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\ncomponent=${component}\n");
441
        printf SYM_FILE ("T 400 $vlnv    0 10 0 1 0 0 1 1\nversion=${version}\n");
442
 
443
 
444
 
445
         my $pin_y = 200;
446
         my $pin_seq = 1;
447
 
448
         while( $name =pop(@In_bus_port_list))
449
          {
450
          printf SYM_FILE ("P 300 $pin_y 0 $pin_y 10 1 1 \n");
451
          printf SYM_FILE ("{\nT 400 $pin_y $color $size 1 1 0 1 1 1\npinnumber=%s\n",$name);
452
          printf SYM_FILE ("T 400 $pin_y $color $size 0 1 0 1 1 1\npinseq=%s\n}\n",$pin_seq);
453
          $pin_seq = $pin_seq +1;
454
          $pin_y = $pin_y +200;
455
          }
456
 
457
 
458
         while( $name =pop(@In_port_list))
459
          {
460
           printf SYM_FILE ("P 300 $pin_y 0 $pin_y 4 0 1  \n");
461
           printf SYM_FILE ("{\nT 400 $pin_y $color $size 1 1 0 1 1 1 \npinnumber=%s\n",$name);
462
           printf SYM_FILE ("T 400 $pin_y $color $size 0 1 0 1 1 1 \npinseq=%s\n}\n",$pin_seq);
463
           $pin_seq = $pin_seq +1;
464
           $pin_y = $pin_y +200;
465
          }
466
 
467
 
468
 
469
         $pin_y = 200;
470
 
471
         while( $name =pop(@Out_bus_port_list))
472
          {
473
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 10 1 1\n");
474
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1 \npinnumber=%s\n",$name);
475
           printf SYM_FILE ("T $out_title $pin_y $color  $size 0 1 0 7 1 1 \npinseq=%s\n}\n",$pin_seq);
476
           $pin_seq = $pin_seq +1;
477
           $pin_y = $pin_y +200;
478
          }
479
 
480
         while( $name =pop(@Io_bus_port_list))
481
          {
482
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 10 1 1\n");
483
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1 \npinnumber=%s\n",$name);
484
           printf SYM_FILE ("T $out_title $pin_y $color  $size 0 1 0 7 1 1 \npinseq=%s\n}\n",$pin_seq);
485
           $pin_seq = $pin_seq +1;
486
           $pin_y = $pin_y +200;
487
          }
488
 
489
 
490
         while( $name =pop(@Out_port_list))
491
          {
492
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 4 0 1\n");
493
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1\npinnumber=%s\n",$name);
494
           printf SYM_FILE ("T $out_edg $pin_y $color  $size 0 1 0 7 1 1\npinseq=%s\n}\n",$pin_seq);
495
           $pin_seq = $pin_seq +1;
496
           $pin_y = $pin_y +200;
497
          }
498
 
499
 
500
         while( $name =pop(@Io_port_list))
501
          {
502
           printf SYM_FILE ("P $out_edg $pin_y $out_pad $pin_y 4 0 1\n");
503
           printf SYM_FILE ("{\nT $out_title $pin_y $color  $size 1 1 0 7 1 1\npinnumber=%s\n",$name);
504
           printf SYM_FILE ("T $out_edg $pin_y $color  $size 0 1 0 7 1 1\npinseq=%s\n}\n",$pin_seq);
505
           $pin_seq = $pin_seq +1;
506
           $pin_y = $pin_y +200;
507
          }
508
 
509
 
510
 
511
        my $in_edg  = ($in_length)*10*$size +200;
512
        my $in_pad  = ($in_length)*10*$size +200;
513
        my $out_edg = ($in_length +$out_length)*10*$size +2500;
514
        my $out_pad = ($in_length +$out_length)*10*$size +1500;
515
 
516
        printf SCH_FILE ("v 20100214 1\n");
517
 
518
 
519
         my $pin_y = 300;
520
 
521
         while( $name =pop(@in_bus_port_list))
522
          {
523
         printf SCH_FILE ("C $in_pad $pin_y 1 0 0 in_port_vector.sym   \n{\nT $in_edg $pin_y $color $size 1 1 0 6 1 1\nrefdes=%s\n}\n",$name);
524
         $pin_y = $pin_y +400;
525
          }
526
 
527
 
528
         while( $name =pop(@in_port_list))
529
          {
530
           printf  SCH_FILE  ("C $in_pad $pin_y 1 0 0 in_port.sym  \n{\nT $in_edg $pin_y $color $size 1 1 0 6 1 1 \nrefdes=%s\n}\n",$name);
531
           $pin_y = $pin_y +400;
532
          }
533
 
534
 
535
         $pin_y = 300;
536
 
537
         while( $name =pop(@out_bus_port_list))
538
          {
539
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0  0 out_port_vector.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1 \nrefdes=%s\n}\n",$name);
540
           $pin_y = $pin_y +400;
541
          }
542
 
543
 
544
         while( $name =pop(@out_port_list))
545
          {
546
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0 0 out_port.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1\nrefdes=%s\n}\n",$name);
547
           $pin_y = $pin_y +400;
548
          }
549
 
550
 
551
         while( $name =pop(@io_bus_port_list))
552
          {
553
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0  0 io_port_vector.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1 \nrefdes=%s\n}\n",$name);
554
           $pin_y = $pin_y +400;
555
          }
556
 
557
 
558
         while( $name =pop(@io_port_list))
559
          {
560
           printf  SCH_FILE  ("C $out_pad $pin_y  1 0 0 io_port.sym\n{\nT $out_edg $pin_y $color  $size 1 1 0 0 1 1\nrefdes=%s\n}\n",$name);
561
           $pin_y = $pin_y +400;
562
          }
563
 
564
 
565
 
566
 
567
 
568
 
569
 
570
 
571
 
572
 
573
 
574
 
575
 
576
 
577
 
578
 
579
 
580
 
581
   #/**********************************************************************/
582
   #/*                                                                    */
583
   #/* Now add all ports  with their type, size and direction             */
584
   #/*                                                                    */
585
   #/**********************************************************************/
586
 
587
 #  print SCH_FILE  "\n    ";
588
 
589
   foreach $port_line (@port_list)
590
        {
591
 #           print SCH_FILE  " ${port_line} \n";
592
 
593
 
594
        }
595
 
596
 
597
 
598
     #/**********************************************************************/
599
     #/*                                                                    */
600
     #/* Dump everything from the ip-xact files into component              */
601
     #/*                                                                    */
602
     #/**********************************************************************/
603
 
604
#     print SCH_FILE  "\n\n\n";
605
#     while(   my $line_out      = shift(@instantiations))             {  print SCH_FILE  "$line_out";}
606
 
607
 
608
 
609
my $cmd ="gaf export -c -s auto -m 5px  --dpi  600  --no-color -o  $sym_pngfile $symfile \n";
610
if (system($cmd)) {}
611
print "$cmd";
612
my $cmd ="gaf export -c -s auto -m 5px  --dpi  600  --no-color -o  $sch_pngfile $schfile \n";
613
if (system($cmd)) {}
614
print "$cmd";
615
 
616
 
617
 
618
 
619
 
620
 
621
   print HTML_FILE  "   \n";
622
   print HTML_FILE  "   \n";
623
   print HTML_FILE  "   \n";
624
   print HTML_FILE  "     \n";
625
   print HTML_FILE  "   start  \n";
626
   print HTML_FILE  "     \n";
627
   print HTML_FILE  "     \n";
628
   print HTML_FILE  "     \n";
629
   print HTML_FILE  "     \n";
630
   print HTML_FILE  "     \n";
631
   print HTML_FILE  "     \n";
632
   print HTML_FILE  "     \n";
633
   print HTML_FILE  "     \n";
634
   print HTML_FILE  "   \n";
635
   print HTML_FILE  "   \n";
636
   print HTML_FILE  " 

SOCGEN Datasheet:
\n";

637
   print HTML_FILE  "   \n";
638
   print HTML_FILE  " 
\n";
639
   print HTML_FILE  " 
    \n";
640
   print HTML_FILE  "   
  • \n";
  • 641
       print HTML_FILE  "     

    ${main_module_name}
    \n";

    642
       print HTML_FILE  "     

    \n";
    643
     
    644
       foreach my $socgen_cfg ($socgen_file->findnodes("//socgen:componentConfiguration/socgen:doc/socgen:versions/socgen:version/socgen:name[text() = '$version']"))
    645
                 {
    646
                 $module_description        = $socgen_cfg->findnodes('../socgen:description/text()')->to_literal ;
    647
                 }
    648
       print HTML_FILE  " 
    \n";
    649
       print HTML_FILE  " 
    $module_description \n";
    650
       print HTML_FILE  " 
    \n";
    651
     
    652
       print HTML_FILE  "       
  • \n";
  • 653
       print HTML_FILE  "         

    SourceCode
    \n";

    654
       print HTML_FILE  "         

    \n";
    655
       print HTML_FILE  "         \n";
    656
     
    657
     
    658
       print HTML_FILE  "       
  • \n";
  • 659
       print HTML_FILE  "         

    Parameters
    \n";

    660
       print HTML_FILE  "         

    \n";
    661
       print HTML_FILE  "         \n";
    662
     
    663
       print HTML_FILE  "       
  • \n";
  • 664
       print HTML_FILE  "         

    Interface
    \n";

    665
       print HTML_FILE  "         

    \n";
    666
       print HTML_FILE  "         \n";
    667
     
    668
     
    669
       print HTML_FILE  "       
  • \n";
  • 670
       print HTML_FILE  "         

    Children
    \n";

    671
       print HTML_FILE  "         

    \n";
    672
       print HTML_FILE  "         \n";
    673
     
    674
     
    675
     
    676
       print HTML_FILE  "       
  • \n";
  • 677
       print HTML_FILE  "         

    Theory of Operation
    \n";

    678
       print HTML_FILE  "         

    \n";
    679
       print HTML_FILE  "         \n";
    680
     
    681
     
    682
       print HTML_FILE  "       \n";
    683
       print HTML_FILE  "     \n";
    684
       print HTML_FILE  "   \n";
    685
       print HTML_FILE  "   \n";
    686
     
    687
       if($in_count >= $out_count) {$max_lines = $in_count }
    688
       else  {$max_lines = $out_count }
    689
     
    690
       $scale = 0.7500;
    691
       $max_lines =(($max_lines *24)+110);
    692
       $max_width = $in_length +  $out_length;
    693
       $max_width =(($max_width * 10) + 343) * $scale ;
    694
     
    695
       print "$max_width   $max_width  max_lines  $max_lines \n";
    696
     
    697
       print HTML_FILE  " \"\"
    \n";
    698
       print HTML_FILE  " 
    \n";
    699
     
    700
       print HTML_FILE  " 

    Parameters

    \n";
    701
       print HTML_FILE  " 
    \n";
    702
       print HTML_FILE  " 
    \n";
    703
       print HTML_FILE  "   \n";
    704
       print HTML_FILE  " \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n       \n           \n           \n          \n";  \n";
    705
       print HTML_FILE  "  
    706
     
    707
       print HTML_FILE  "   
    708
       print HTML_FILE  "      
    Name
    709
       print HTML_FILE  "      
    default
    710
       print HTML_FILE  "      
    Description
    711
       print HTML_FILE  "    
    712
     
    713
     
    714
     
    715
       foreach my $Pam (@Pams)
    716
        {
    717
        my $param_name;
    718
        my $param_value;
    719
        ( $param_name,$param_value) = split( /\::/ , $Pam);
    720
     
    721
        print HTML_FILE "   
    ${param_name}
    ${param_value}
    ${parameter_description}
    722
     
    723
        }
    724
     
    725
     
    726
     
    727
     
    728
     
    729
     
    730
       print HTML_FILE  "   
    731
       print HTML_FILE  "  
    \n";
    732
       print HTML_FILE  " 


    \n";

    733
       print HTML_FILE  " 

    \n";
    734
       print HTML_FILE  " 


    \n";

    735
       print HTML_FILE  " 

    \n";
    736
       print HTML_FILE  " 


    \n";

    737
       print HTML_FILE  " 

    \n";
    738
       print HTML_FILE  " 


    \n";

    739
     
    740
       print HTML_FILE  " 
    \n";
    741
       print HTML_FILE  " 

    \n";
    742
     
    743
       print HTML_FILE  " 

    Interface 
    \n";

    744
       print HTML_FILE  "   \n";
    745
       print HTML_FILE  " 

    \n";
    746
       print HTML_FILE  " 
    \n";
    747
       print HTML_FILE  " 
    \n";
    748
       print HTML_FILE  " 
    \n";
    749
     
    750
     
    751
       print HTML_FILE  "   \n";  \n";  \n";  \n";  \n";  \n";  \n          \n         \n         \n       \n"  ;  \n          \n         \n         \n       \n"  ;  \n          \n         \n         \n       \n"  ;  \n          \n         \n         \n       \n"  ;  \n          \n         \n         \n       \n"  ;  \n";
    752
       print HTML_FILE  "  cellpadding=\"4\" cellspacing=\"4\">  \n";
    753
       print HTML_FILE  "   
    754
       print HTML_FILE  "     
    755
       print HTML_FILE  "       
    NAME
    756
       print HTML_FILE  "       
    Type
    757
       print HTML_FILE  "       
    Description
    758
       print HTML_FILE  "     
    759
     
    760
       foreach my $line (@hIn_port_list)
    761
          {
    762
          print HTML_FILE "     
    ${line}
    input
    ${interface_description}
    763
          }
    764
     
    765
       foreach my $line (@hIn_bus_port_list)
    766
          {
    767
          print HTML_FILE "     
    ${line}
    input
    ${interface_description}
    768
          }
    769
     
    770
     
    771
       foreach my $line (@hOut_port_list)
    772
          {
    773
          print HTML_FILE "     
    ${line}
    output
    ${interface_description}
    774
          }
    775
     
    776
     
    777
       foreach my $line (@hOut_bus_port_list)
    778
          {
    779
          print HTML_FILE "     
    ${line}
    output
    ${interface_description}
    780
          }
    781
     
    782
     
    783
       foreach my $line (@hIo_bus_port_list)
    784
          {
    785
          print HTML_FILE "     
    ${line}
    inout
    ${interface_description}
    786
          }
    787
     
    788
     
    789
       print HTML_FILE  "   
    790
       print HTML_FILE  "  
    \n";
    791
       print HTML_FILE  " 


    \n";

    792
       print HTML_FILE  " 

    \n";
    793
     
    794
     
    795
     
    796
       print HTML_FILE  " 

    Children

    \n";
    797
       print HTML_FILE  " 
    \n";
    798
       print HTML_FILE  "   \n";
    799
       print HTML_FILE  " \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n"; \n";  \n";
    800
       print HTML_FILE  "  
    801
     
    802
       print HTML_FILE  "   
    803
       print HTML_FILE  "      
    Instance
    804
       print HTML_FILE  "      
    Vendor
    805
       print HTML_FILE  "      
    Library
    806
       print HTML_FILE  "      
    Component
    807
       print HTML_FILE  "      
    Version
    808
       print HTML_FILE  "    
    809
     
    810
         my @spirit_design_files       = yp::lib::find_ipxact_design_files($vendor,$library,$component,$version);
    811
     
    812
         foreach  my   $sd_file (@spirit_design_files)
    813
         {
    814
     
    815
         $_ = $sd_file;
    816
            if(/:::(\S+):::(\S+):::(\S+):::(\S+):::/)
    817
              {
    818
              $q_vendor            = $1;
    819
              $q_library           = $2;
    820
              $q_design            = $3;
    821
              $q_version           = $4;
    822
              $sd_file             = $parser->parse_file(yp::lib::find_ipxact_design($q_vendor,$q_library,$q_design,$q_version));
    823
              }
    824
     
    825
              foreach  my   $x_name ($sd_file->findnodes("//ipxact:design/ipxact:componentInstances/ipxact:componentInstance/ipxact:instanceName"))
    826
                {
    827
                #/**********************************************************************/
    828
                #/*                                                                    */
    829
                #/* Lookup VLNV for each instantiated component                        */
    830
                #/*                                                                    */
    831
                #/**********************************************************************/
    832
     
    833
     
    834
               my($instance_name)       = $x_name ->findnodes('./text()')->to_literal ;
    835
               my($vendor_name)         = $x_name  ->findnodes('../ipxact:componentRef/@vendor')->to_literal ;
    836
               my($library_name)        = $x_name  ->findnodes('../ipxact:componentRef/@library')->to_literal ;
    837
               my($component_name)      = $x_name  ->findnodes('../ipxact:componentRef/@name')->to_literal ;
    838
               my($version_name)        = $x_name  ->findnodes('../ipxact:componentRef/@version')->to_literal ;
    839
     
    840
               print HTML_FILE  "   
    841
               print HTML_FILE  "      
    $instance_name
    842
               print HTML_FILE  "      
    $vendor_name
    843
               print HTML_FILE  "      
    $library_name
    844
               print HTML_FILE  "      
    $component_name
    845
               print HTML_FILE  "      
    $version_name
    846
               print HTML_FILE  "    
    847
               }
    848
         }
    849
     
    850
         print HTML_FILE  "   
    851
         print HTML_FILE  "  
    \n";
    852
         print HTML_FILE  " 


    \n";

    853
         print HTML_FILE  " 

    \n";
    854
         print HTML_FILE  " 
    \n";
    855
         print HTML_FILE  " 
    \n";
    856
         print HTML_FILE  " 
    \n";
    857
         print HTML_FILE  " 
    \n";
    858
         print HTML_FILE  " 
    \n";
    859
         print HTML_FILE  " 
    \n";
    860
         print HTML_FILE  " 
    \n";
    861
         print HTML_FILE  " 
    \n";
    862
         print HTML_FILE  " \"\"
    \n";
    863
         print HTML_FILE  " 
    \n";
    864
         print HTML_FILE  " 
    \n";
    865
         print HTML_FILE  " 
    \n";
    866
         print HTML_FILE  " 
    \n";
    867
         print HTML_FILE  " 
    \n";
    868
         print HTML_FILE  " 
    \n";
    869
         print HTML_FILE  " 
    \n";
    870
         print HTML_FILE  " 
    \n";
    871
         print HTML_FILE  " 
    \n";
    872
         print HTML_FILE  " 
    \n";
    873
         print HTML_FILE  " 
    \n";
    874
         print HTML_FILE  " 
    \n";
    875
         print HTML_FILE  " 
    \n";
    876
         print HTML_FILE  " 
    \n";
    877
         print HTML_FILE  " 
    \n";
    878
         print HTML_FILE  " 
    \n";
    879
         print HTML_FILE  " 
    \n";
    880
         print HTML_FILE  " 
    \n";
    881
         print HTML_FILE  " 
    \n";
    882
         print HTML_FILE  " 
    \n";
    883
         print HTML_FILE  " 
    \n";
    884
         print HTML_FILE  " 
    \n";
    885
         print HTML_FILE  " 
    \n";
    886
         print HTML_FILE  " 
    \n";
    887
         print HTML_FILE  " 
    \n";
    888
         print HTML_FILE  "   \n";
    889
         print HTML_FILE  "   \n";
    890
     
    891
     
    892
     
    893
     
    894
     
    895
     
    896
     
    897
     
    898
     
    899
     
    900
    1
    901
     

    powered by: WebSVN 2.1.0

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