Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vecs
FIJI Public
Commits
0a8ba479
Commit
0a8ba479
authored
Apr 07, 2016
by
Stefan Tauner
Browse files
netlist: check the index of pins of cells in _get_net_connections()
Bonus: some cleanups and comments
parent
deeadc79
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/FIJI/Netlist.pm
View file @
0a8ba479
...
...
@@ -1037,6 +1037,7 @@ sub _get_net_connections {
# find nets driven by this module's input ports or driving its outputs
foreach
my
$port
(
$mod
->
ports
)
{
# NB: we do not check any index because there can't be multiple ports with the same name
if
(
defined
$port
->
net
&&
(
$port
->
net
->
name
eq
$net_name
))
{
$logger
->
debug
("
port:
\"
"
.
$mod
->
name
.
HIERSEP
.
$port
->
name
.
"
\"
");
...
...
@@ -1070,7 +1071,7 @@ sub _get_net_connections {
foreach
my
$cell
(
$mod
->
cells
)
{
foreach
my
$pin
(
$cell
->
pins
)
{
foreach
my
$netname
(
@
{
$pin
->
netnames
})
{
if
(
$netname
->
{'
netname
'}
eq
$net_name
)
{
if
(
$netname
->
{'
netname
'}
eq
$net_name
&&
(
_offset_of_bit_in_range
(
$bit
,
$netname
->
{'
msb
'},
$netname
->
{'
lsb
'})
!=
-
1
)
)
{
my
$dir
=
(
!
defined
(
$pin
->
port
))
?
"
unknown
"
:
(
$pin
->
port
->
direction
eq
'
in
')
?
"
in
"
:
"
out
";
$logger
->
debug
("
pin (
"
.
$dir
.
"
)
\"
"
.
$pin
->
cell
->
name
.
HIERSEP
.
$pin
->
name
.
"
\"
");
# The pin might be the driver but we can't be sure without a preselection.
...
...
@@ -1133,14 +1134,11 @@ sub export {
return
undef
;
}
## @method private _offset_of_bit_in_netdescr($bit, $net_descr)
# sub _offset_of_bit_in_netdescr {
# my ($self, $bit, $net_descr) = @_;
# return _offset_of_bit_in_range($bit, $net_descr->{'msb'}, $net_descr->{'lsb'});
# }
## @method private _offset_of_bit_in_netrange($bit, $net)
# @brief Tests if a bit is contained in the range of a net
#
# @returns 0 if any parameter is undefined
# @returns -1 if the bit is not contained, or its offset within the range
sub
_offset_of_bit_in_netrange
{
my
(
$bit
,
$net
)
=
@_
;
...
...
@@ -1150,7 +1148,7 @@ sub _offset_of_bit_in_netrange {
## @method private _offset_of_bit_in_range($bit, $range_msb, $range_lsb)
# @brief Tests if bit is contained in the given range
#
# @return
e
s 0 if any parameter is undefined
# @returns 0 if any parameter is undefined
# @returns -1 if the bit is not contained, or its offset within the range
sub
_offset_of_bit_in_range
{
my
(
$bit
,
$range_msb
,
$range_lsb
)
=
@_
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment