1
0
mirror of https://github.com/rzzzwilson/pymlac.git synced 2025-06-10 09:32:41 +00:00

Testing PTR ROM code

This commit is contained in:
Ross Wilson 2016-02-28 12:11:14 +07:00
parent 6b857e7cad
commit 176b507dc1
2 changed files with 20 additions and 16 deletions

View File

@ -7,17 +7,18 @@ test:
pymlac -b ptr -c -ptr dumpmem_test.ptp -t 040,045:050,052:055,060:065,066:071,077:0100,0110:03700,03761:03766,03777 -r 040 -r 0100
test_debug:
rm -f test.ptr test.ptp CPU.test.trace test_CPU.log
./make_ptr > test.ptr
python test_CPU.py CPU.test
#python test_Display.py # interactive!
@echo "########## Run 'python test_Display.py' by hand! ##########"
#python test_KBD.py # interactive!
@echo "########## Run 'python test_KBD.py' by hand! ##########"
python test_Memory.py
python test_PTR_PTP.py
python test_TTYIN.py
python test_TTYOUT.py
rm -f test.ptr test.ptp CPU.test.trace test_CPU.log pymlac.trace
python test_CPU.py dumpmem.test
# ./make_ptr > test.ptr
# python test_CPU.py CPU.test
# #python test_Display.py # interactive!
# @echo "########## Run 'python test_Display.py' by hand! ##########"
# #python test_KBD.py # interactive!
# @echo "########## Run 'python test_KBD.py' by hand! ##########"
# python test_Memory.py
# python test_PTR_PTP.py
# python test_TTYIN.py
# python test_TTYOUT.py
%: %.ptp

View File

@ -276,8 +276,11 @@ class TestCPU(object):
self.used_cycles= 0
while self.cpu.running:
cycles = self.cpu.execute_one_instruction()
trace.itraceend(False)
(cycles, tracestr) = self.cpu.execute_one_instruction()
if tracestr:
endstr = trace.itraceend(False)
trace.comment('%s\t%s' % (tracestr, endstr))
trace.flush()
self.ptrptp.ptr_tick(cycles)
self.ptrptp.ptp_tick(cycles)
self.used_cycles += cycles
@ -426,8 +429,8 @@ class TestCPU(object):
if len(s) != 2:
return "dumpmem: dump limits are bad: %s" % addresses
(begin, end) = s
begin = str2int(begin)
end = str2int(end)
begin = self.str2int(begin)
end = self.str2int(end)
if begin is None or end is None:
return "dumpmem: dump limits are bad: %s" % addresses
@ -625,7 +628,7 @@ class TestCPU(object):
print(test)
print('\t' + '\n\t'.join(result))
self.memdump('core.txt', 0, 0200)
self.memdump('core.txt', 03700, 0100)
def memdump(self, filename, start, number):
"""Dump memory from 'start' into 'filename', 'number' words dumped."""