Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in the printing of chanend readyness #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ reads from register at offset 0x0 which is the "Device identification" register.
tilestate
=========

Requires 14.2.0 tools or newer.

The tilestate script defines functions that can be used to debug the state of
xCORE hardware resources.
Example usage::
Expand Down Expand Up @@ -122,3 +124,14 @@ all resources, then after sourcing the tilestate script do::
following flag after sourcing the script::
(gdb) set $res_print_details = 1

watchstack
==========

Requires 14.3.0 tools or newer.

Can be run to print the stack usage of each core within a design::

gdb BIN < watchstack

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be xgdb


Note: It has to be run this way rather than the -x in order to ignore the errors when
checking whether there are multiple cores on a tile.
23 changes: 22 additions & 1 deletion tilestate
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ define res_print_port
resreg $tile $resourceId $PS_RDYSRC
set $rdySrc = $resregval
printf " clkSrc=0x%08x, rdySrc=0x%08x\n", $clkSrc, $rdySrc

# VECTOR/EV
resreg $tile $resourceId $PS_VECTOR
set $vector = $resregval
resreg $tile $resourceId $PS_EV
set $ev = $resregval
printf " vector=0x%08x, ev=0x%08x\n", $vector, $ev
end
end

Expand Down Expand Up @@ -222,6 +229,13 @@ define res_print_timer
printf "EV=0x%x, ", $resregval
end
printf "tWaiting=%d, tNum=%d\n", $tWaiting, $tNum

# VECTOR/EV
resreg $tile $resourceId $PS_VECTOR
set $vector = $resregval
resreg $tile $resourceId $PS_EV
set $ev = $resregval
printf " vector=0x%08x, ev=0x%08x\n", $vector, $ev
end
end

Expand Down Expand Up @@ -260,7 +274,7 @@ define res_print_chanend
printf "Chanend %d:\n", $chanend
printf " inUse=%d, ieMode=", $inUse
res_print_if $ieMode "I" "E"
printf ", ieEnabled=%d, ready=%d, cond=", $ieEnabled, $ready
printf ", ieEnabled=%d, ready=%d, cond=", $ieEnabled, $inReady
res_print_cond $cond
printf "\n "
if $evValid
Expand All @@ -275,6 +289,13 @@ define res_print_chanend
set $dest = $resregval

printf " dest=0x%08x\n", $dest

# VECTOR/EV
resreg $tile $resourceId $PS_VECTOR
set $vector = $resregval
resreg $tile $resourceId $PS_EV
set $ev = $resregval
printf " vector=0x%08x, ev=0x%08x\n", $vector, $ev
end
end

Expand Down
38 changes: 38 additions & 0 deletions watchstack
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
define install_breakpoints
# Check whether there are actually multiple cores
set $start_other_addr = &__start_other_cores + 62
if ($start_other_addr)
break __start_core
commands
getthread
stackfor $r1
set $nbytes = $nstackwords * 4
set $base = $sp - $nbytes
set $mask = 0xff - (1 << $xcore_current_thread)
printf "%d:%d: watchrange 0x%x %d 0x%x\n", $xcore_current_tile, $xcore_current_thread, $base, $nbytes, $mask
continue
end

# Address of the bla instruction
break *$start_other_addr
commands
getthread
stackfor $r11
set $nbytes = $nstackwords * 4
set $base = $sp - $nbytes
set $mask = 0xff - (1 << $xcore_current_thread)
printf "%d:%d: watchrange 0x%x %d 0x%x\n", $xcore_current_tile, $xcore_current_thread, $base, $nbytes, $mask
continue
end
end
end

connect

tile 0
install_breakpoints

tile 1
install_breakpoints

run