-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
60,244 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<h3>Useful Links</h3> | ||
<ul> | ||
<li><a href="{{ pathto('index') }}">Revelation documentation</a></li> | ||
<li><a href="{{ pathto('contributing') }}">Contribution Guide</a></li> | ||
<li><a href="{{ pathto('contributing') }}">Contribution guide</a></li> | ||
<li><a href="https://github.com/futurecore/revelation/">Revelation @GitHub</a></li> | ||
<li><a href="https://github.com/futurecure/revelation/issues">Issue Tracker</a></li> | ||
<li><a href="https://github.com/futurecure/revelation/issues">Revelation issue tracker</a></li> | ||
<li><a href="http://www.adapteva.com/epiphanyiii/">Epiphany III</a></li> | ||
<li><a href="http://www.adapteva.com/epiphanyiv/">Epiphany IV</a></li> | ||
<li><a href="http://adapteva.com/docs/epiphany_arch_ref.pdf">Epiphany Architecture Reference</a></li> | ||
<li><a href="http://adapteva.com/docs/epiphany_arch_ref.pdf">Epiphany architecture reference</a></li> | ||
<li><a href="https://github.com/cornell-brg/pydgin">Pydgin project</a></li> | ||
<li><a href="http://www.csl.cornell.edu/~berkin/lockhart-pydgin-ispass2015.pdf">Pydgin paper</a></li> | ||
<li><a href="http://rpython.readthedocs.io/en/latest/">RPython documentation</a></li> | ||
</ul> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,3 @@ pytest-cov==2.2.1 | |
pytest-xdist==1.14 | ||
requests==2.9.1 | ||
Sphinx==1.4.5 | ||
sphinx-rtd-theme==0.1.9 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from revelation.isa import decode | ||
|
||
BKPT16 = 0b0000000111000010 | ||
NOP16 = 0b0000000110100010 | ||
|
||
|
||
class BreakPointManager(object): | ||
"""Manage breakpoints during GDB execution. | ||
""" | ||
|
||
def __init__(self, simulator): | ||
self.target = simulator | ||
self.breakpoints = {} # Address -> (opcode, size in bytes) | ||
|
||
def _get_global_address(self, address, coreid=0x808): | ||
"""Remap any local addresses to global address. | ||
""" | ||
if (address & 0xfff00000) == 0x0: | ||
return (coreid << 20) | address | ||
return address | ||
|
||
def is_breakpoint_set(self, address, coreid=0x808): | ||
global_address = self._get_global_address(address, coreid) | ||
return global_address in self.breakpoints | ||
|
||
def set_breakpoint(self, address, coreid=0x808): | ||
"""Set a breakpoint at a given address. | ||
1. Read 32 bit current instructions at address, save in dictionary. | ||
2. If current instruction is 16 bit, replace with bkpt16. | ||
3. If current instruction is 32 bit, replace with bkpt16, nop16. | ||
""" | ||
global_address = self._get_global_address(address, coreid) | ||
opcode = self.target.memory.iread(global_address, 4) | ||
mnemonic, _ = decode(opcode) | ||
if mnemonic.endswith('16'): | ||
self.breakpoints[global_address] = (opcode & 0xffff, 2) | ||
self.target.memory.write(global_address, 2, BKPT16) | ||
else: | ||
self.breakpoints[global_address] = (opcode, 4) | ||
self.target.memory.write(global_address, 2, BKPT16) | ||
self.target.memory.write(global_address + 2, 2, NOP16) | ||
|
||
def remove_breakpoint(self, address, coreid=0x808): | ||
"""Remove a breakpoint at a given address.""" | ||
global_address = self._get_global_address(address, coreid) | ||
if global_address not in self.breakpoints: | ||
return | ||
opcode, size = self.breakpoints[global_address] | ||
self.target.memory.write(global_address, size, opcode) | ||
del self.breakpoints[global_address] |
Oops, something went wrong.