Tuesday, January 3, 2017

Debugging using T32 on a Multi cores/cpus

Contemporary processors are multi core/cpus. This has made life of a developer bit tougher. For eg, for the break point to hit, you need to set it on all the cpus, because you never know where the code is going to run. Another instance is to stop all the core at the same time.

Below is a set of scritps which helps you to make your job easier.

For eg we will consider working on a 4 core processor.

You need to create few cmm files. Contents and file names as shown below,

1) main.cmm
=========
GLOBAL &ScriptPath &vmlinuxPath

&ScriptPath="Z:\deleteme\T32"
&vmlinuxPath="Z:\kdevs\3.18\kdev\kobj"

globalon cmd i do &ScriptPath\initcore_all.cmm
globalon cmd pos do &ScriptPath\pos.cmm
globalon cmd load do &ScriptPath\load_all.cmm
globalon cmd ball do &ScriptPath\break_all.cmm


==========

2) initcore_all.cmm
============
intercom.execute localhost:15370 do &ScriptPath\initcore.cmm
intercom.execute localhost:15371 do &ScriptPath\initcore.cmm
intercom.execute localhost:15372 do &ScriptPath\initcore.cmm
intercom.execute localhost:15373 do &ScriptPath\initcore.cmm
============

3) initcore.cmm
==========
sys.m.a
snoop.pc ON
b.d
b.s die  /Onchip
b.s panic  /Onchip
===========

4) loadall.cmm
=========
intercom.execute localhost:15370 do &ScriptPath\load.cmm &vmlinuxPath
intercom.execute localhost:15371 do &ScriptPath\load.cmm &vmlinuxPath
intercom.execute localhost:15372 do &ScriptPath\load.cmm &vmlinuxPath
intercom.execute localhost:15373 do &ScriptPath\load.cmm &vmlinuxPath
==========

5) load.cmm
========
ENTRY &vmlinuxPath
d.load.elf &vmlinuxPath\vmlinux /NOCODE
========

6) pos.cmm
=======
intercom.execute localhost:15370 framepos 0 0 65 13
intercom.execute localhost:15371 framepos 75 0 65 13
intercom.execute localhost:15372 framepos 0 25 65 13
intercom.execute localhost:15373 framepos 75 25 65 13
========

7) break_all.cmm
===========
intercom.execute localhost:15370 break
intercom.execute localhost:15371 break
intercom.execute localhost:15372 break
intercom.execute localhost:15373 break
===========

Open four instances of T32. run main.cmm on T32 associated with core 0.

then type the i in the command line to run intercore_all.cmm




1 comment:

Anonymous said...

What does the command "snoop.pc on" do?