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

Subversion Repositories socgen

[/] [socgen/] [trunk/] [tools/] [verilog/] [read_ports] - Blame information for rev 135

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 131 jt_eaton
eval 'exec `which perl` -S $0 ${1+"$@"}'
2
   if 0;
3 135 jt_eaton
#/****************************************************************************/
4
#/*                                                                          */
5
#/*   SOCGEN Design for Reuse toolset                                        */
6
#/*                                                                          */
7
#/*   Version 1.0.0                                                          */
8
#/*                                                                          */
9
#/*   Author(s):                                                             */
10
#/*      - John Eaton, z3qmtr45@gmail.com                                    */
11
#/*                                                                          */
12
#/****************************************************************************/
13
#/*                                                                          */
14
#/*                                                                          */
15
#/*             Copyright 2016 John T Eaton                                  */
16
#/*                                                                          */
17
#/* Licensed under the Apache License, Version 2.0 (the "License");          */
18
#/* you may not use this file except in compliance with the License.         */
19
#/* You may obtain a copy of the License at                                  */
20
#/*                                                                          */
21
#/*    http://www.apache.org/licenses/LICENSE-2.0                            */
22
#/*                                                                          */
23
#/* Unless required by applicable law or agreed to in writing, software      */
24
#/* distributed under the License is distributed on an "AS IS" BASIS,        */
25
#/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
26
#/* See the License for the specific language governing permissions and      */
27
#/* limitations under the License.                                           */
28
#/*                                                                          */
29
#/*                                                                          */
30
#/****************************************************************************/
31 131 jt_eaton
 
32
 
33
############################################################################
34
# General PERL config
35
############################################################################
36
use Getopt::Long;
37
use English;
38
use File::Basename;
39
use Cwd;
40
use Scalar::Util qw(looks_like_number);
41
use XML::LibXML;
42
use lib './tools';
43
use sys::lib;
44
use yp::lib;
45
use BerkeleyDB;
46
 
47
 
48
$OUTPUT_AUTOFLUSH = 1; # set autoflush of stdout to TRUE.
49
 
50
 
51
############################################################################
52
### Process the options
53
############################################################################
54
Getopt::Long::config("require_order", "prefix=-");
55
GetOptions("h","help",
56
           "vendor=s" => \$vendor,
57
           "library=s" => \$library,
58
           "version=s" => \$version,
59
           "component=s" => \$component,
60
           "debug","verbose"
61
) || die "(use '$program_name -h' for help)";
62
 
63
 
64
##############################################################################
65
## Help option
66
##############################################################################
67
if ( $opt_h  or $opt_help  )
68
  { print "\n read_ports    -vendor vendor_name -library library_name  -component component_name  -version version_name   ";
69
    print "\n";
70
    exit 1;
71
  }
72
 
73
 
74
 
75
 
76
 
77
 
78
#############################################################################
79
##
80
##
81
#############################################################################
82
 
83
 
84
$home = cwd();
85
 
86
 
87
my $variant;
88
 
89
if($version)       {$variant   = "${component}_${version}";}
90
else               {$variant   = "${component}";}
91
 
92
 
93
my $main_module_name = yp::lib::get_module_name($vendor,$library,$component,$version) ;
94
my $parser = XML::LibXML->new();
95
 
96
 
97
my $spirit_component_file    = $parser->parse_file(yp::lib::find_ipxact_component($vendor,$library,$component,$version));
98
 
99
print "\n READ_ports     $vendor $library $component $version         \n";
100
 
101
 
102
 
103
my $io_ports  = yp::lib::get_io_ports() ;
104
 
105
   my $gen_port_outfile = yp::lib::get_io_ports_db_filename($vendor,$library,$component,$version);
106
   $ports_db   = new BerkeleyDB::Hash( -Filename => $gen_port_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_port_outfile}: $!";
107
#   print "XXXXXXXX   $gen_port_outfile           READ PORTS  \n";
108
 
109
 
110 134 jt_eaton
   my $gen_bus_outfile = yp::lib::get_io_busses_db_filename($vendor,$library,$component,$version,"default");
111 131 jt_eaton
   $busses_db   = new BerkeleyDB::Hash( -Filename => $gen_bus_outfile, -Flags => DB_CREATE ) or die "Cannot open ${gen_bus_outfile}: $!";
112
#   print "XXXXXXXX   $gen_bus_outfile           READ PORTS  \n";
113
 
114
 
115
 
116
   my $key;
117
   my $value;
118
 
119
 
120
 
121
   my @bus_list;
122
   my @adhoc_list;
123
 
124
   my $cursor = $busses_db ->db_cursor() ;
125
   while ($cursor->c_get($key, $value, DB_NEXT) == 0)
126
   {
127
#   print "INPUT  $key,   $value  \n";
128
                 ( ${key_type},${busref},${conn}) = split( /\./ , $key);
129
                 ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value;
130
                 if(($key_type eq "BusRef"))
131
                    {
132
                    push (@bus_list,  "${busref}_${conn}     ${phy_name}  ${log_name}   ${direction}  ${type}  ${vector}   ${left}:${right}    ");
133
 
134
                    }
135
                 else
136
                    {
137
 
138
                    }
139
 
140
   }
141
 
142
   my $status = $cursor->c_close() ;
143
 
144
 
145
 
146
   $cursor = $ports_db ->db_cursor() ;
147
   while ($cursor->c_get($key, $value, DB_NEXT) == 0)
148
   {
149
   ( ${key_type},${busref},${conn}) = split( /\./ , $key);
150
   ( ${log_name},${direction},${type},${vector},${left},${right},${phy_name}) = split ':', $value;
151
   print "OUTPUT $key,   $value  \n";
152
                 if(($key_type eq "BusRef"))
153
                    {
154
                    }
155
                 else
156
                    {
157
                    push (@adhoc_list,"              ${log_name}   ${direction}   ${type}  ${vector}   ${left}:${right}  ");
158
                    }
159
   }
160
 
161
   my $status = $cursor->c_close() ;
162
 
163
 
164
   $ports_db   -> db_close();
165
   $busses_db   -> db_close();
166
 
167
 
168
 
169
   @bus_list      = sys::lib::trim_sort(@bus_list);
170
   @adhoc_list    = sys::lib::trim_sort(@adhoc_list);
171
 
172
    foreach $list (@bus_list)   { print   "${list}\n";}
173
#
174
 
175
 
176
my @busses  = yp::lib::get_busses($vendor,$library,$component,$version);
177
 
178
    foreach $list (@busses) {  print   "${list}\n";  }
179
 
180
 
181
 
182
 
183
1

powered by: WebSVN 2.1.0

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