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
tapasco
tapasco
Commits
e88fd10c
Commit
e88fd10c
authored
Nov 10, 2017
by
Jens Korinth
Browse files
VC709: Fix bug in LED plugin
parent
6c8a19dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
platform/vc709/plugins/leds.tcl
View file @
e88fd10c
...
...
@@ -35,24 +35,35 @@ namespace eval leds {
puts
" WARNING: can only connect up to 6 LEDs, additional inputs will be discarded"
}
set rlist
[
list
]
# create tie-off constant zero
set zero
[
tapasco::createConstant one 1 0
]
set zero_pin
[
get_bd_pins -of_objects $zero -filter
{
DIR ==
"O"
}]
for
{
set i 0
}
{
$i
< 6 &&
[
llength $inputs
]
> $i
}
{
incr i
}
{
set pin
[
lindex $inputs $i
]
puts
" LED
$i:
$pin
"
lappend rlist
[
get_bd_pins $pin
]
set bd_pin
[
get_bd_pins $pin
]
if
{
$bd
_pin !=
{}}
{
lappend rlist $bd_pin
}
else
{
lappend rlist $zero_pin
}
}
if
{[
llength $inputs
]
< 6
}
{
# create tie-off constant one
set one
[
tapasco::createConstant one 1 0
]
set onepin
[
get_bd_pins -of_objects $one -filter
{
DIR ==
"O"
}]
for
{}
{
$i
< 6
}
{
incr i
}
{
lappend rlist $
one
pin
lappend rlist $
zero_
pin
}
}
if
{[
lsearch rlist $zero_pin
]
== -1
}
{
# delete the constant
delete_bd_objs $zero
}
return $rlist
}
proc create_led_core
{{
name
"gp_led"
}
{
inputs
[
list
]}}
{
variable vlnv
variable default_led_pins
puts
"Creating LED core ..."
puts
" VLNV:
$vlnv
"
if
{[
llength $inputs
]
== 0
}
{
...
...
@@ -82,7 +93,10 @@ namespace eval leds {
puts
"Implementing Platform feature LED ..."
# create and connect LED core
set const_one
[
tapasco::createConstant
"const_one"
1 1
]
set gp_led
[
create_led_core
"gp_led"
[
dict get
[
tapasco::get_feature
"LED"
]
"inputs"
]]
set f
[
tapasco::get_feature
"LED"
]
set inputs
[
list
]
if
{[
dict exists $f
"inputs"
]}
{
set inputs
[
dict get $f
"inputs"
]
}
set gp_led
[
create_led_core
"gp_led"
$inputs
]
set pcie_aclk
[
get_bd_pins
"/PCIe/pcie_aclk"
]
set pcie_aresetn
[
get_bd_pins
"/PCIe/pcie_aresetn"
]
set pcie_aclk_net
[
get_bd_net -of_objects $pcie_aclk
]
...
...
Write
Preview
Markdown
is supported
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