Hi Patrick,
From: bosp-...@googlegroups.com [mailto:bosp-...@googlegroups.com] On Behalf Of Patrick Bellasi
Sent: Friday, March 01, 2013 7:24 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
Subject: [STHORM] Integration issue - SDK v2013.1 - p12Runtime not properly initializing the platform descriptor
Hi Germain!
Finally we got the SThorm HW here in our office.
Now we are trying to get a working setup with BarbequeRTRM which is able to talk with the accelerator firmware. So far, when we run barbeque, wither:
1. it stops waiting for platform data loading
or
2. is load a wrong set of platform data (e.g. 8 cluster descriptors instead of the expected 4)
This is how we configured the current setup, please check each point and let us know if we have to do something in a different way.
.:: SDK
We are using SDK 2013.1 which provides a new sthormStart script, this is the initialization we are doing in the shell used thereafter:
// First define some required env variables
$> export ANDROID_SDK_ROOT=/opt/android-sdk-linux
$> export ANDROID_NDK_ROOT=/opt/android-ndk-r7
$> export ANDROID_TOOLSET_ROOT=$ANDROID_SDK_ROOT/tools
$> export SX=/opt/SDK-release-2013.1/tools/STxP70
You should remove the last one (SX), it is only needed for the partial SDKs I’ve sent you in the past. Anyway, I think the toolset is still the same in 2013.1, this won’t have any impact.
Note that I will be sending you regular SDK now, the toolset is now always included, thus you won’t need anymore this SX variable.
// Enter the SDK root
$> cd /top/SDK-release-2013.1
$> source env/sdk_setup.sh
// Add some missing definitions (should these be defined by the sdk_setup.sh?!?)
$> export STHORM_SDK_OCL_HOME=$STHORM_SDK_HOME
$> export P2012_STHORM_IP_ADDR=192.168.1.10
In fact the sdk_setup.sh was used in the previous development SDKs. For official SDK, you should source the file setup.sh in the root directory. This explains why you are missing the first variable. Note than for future intermediate SDKs, you can also source the same file than for official SDKs.
The procedure for using the board is not yet well documented and it is still evolving. I will document it soon. For now I think it is better that you use the new SDK I sent today. The command for uploading the new design and software is the following:
p12run --platform=sthorm --sthorm-steps="design sw config"
Then you have to reset the board.
The OCL daemon is always running but can receive requests for taking or releasing clusters. This is the functionality we discussed some time ago and which is available through the Android binder. You have to interact with this daemon in order to manage the device.
I think something may have been broken recently on these aspects as they not yet automatically tested. Could you check with the new SDK and procedure if you still have the issue ? If yes, I will have to debug that, something must be wrong with the runtime. Could you sent me a binary package with BBQ that allows me to reproduce and see the issue ?
Ciao,
Germain
Have a nice week-end,
Patrick
--
#include <best/regards.h>
Patrick Bellasi
Post-Doc at Politecnico di Milano
http://home.dei.polimi.it/bellasi
--
You received this message because you are subscribed to the Google Groups "BOSP Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bosp-devel+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
.:: SDK
We are using SDK 2013.1 which provides a new sthormStart script, this is the initialization we are doing in the shell used thereafter:
// First define some required env variables
$> export ANDROID_SDK_ROOT=/opt/android-sdk-linux
$> export ANDROID_NDK_ROOT=/opt/android-ndk-r7
$> export ANDROID_TOOLSET_ROOT=$ANDROID_SDK_ROOT/tools
$> export SX=/opt/SDK-release-2013.1/tools/STxP70
You should remove the last one (SX), it is only needed for the partial SDKs I’ve sent you in the past. Anyway, I think the toolset is still the same in 2013.1, this won’t have any impact.
Note that I will be sending you regular SDK now, the toolset is now always included, thus you won’t need anymore this SX variable.
The procedure for using the board is not yet well documented and it is still evolving. I will document it soon. For now I think it is better that you use the new SDK I sent today. The command for uploading the new design and software is the following:
p12run --platform=sthorm --sthorm-steps="design sw config"
Then you have to reset the board.
It is worth to notice that both the P2012 daemon (p2012d_dbg) and the OpenCL daemon (oclDaemon) are running.
Germain: correct me if I'm wrong, but I expect at least the P2012 daemon not running if the accelerator if managed by BBQ. Is that correct? Otherwise, could this daemon interfere somehow with BBQ?
The OCL daemon is always running but can receive requests for taking or releasing clusters. This is the functionality we discussed some time ago and which is available through the Android binder. You have to interact with this daemon in order to manage the device.
Now, if we start the BarbequeRTRM daemon, the platform initialization is completed but the enumeration we get is wrong.
./dumpDescriptor.sh 0x70500000 0x1DC 2
Value at address 0x705001DC (0xb6fbf1dc): 0x8 (clusters_count)
Value at address 0x705001E0 (0xb6ffa1e0): 0x10 (pes_coount)
I think something may have been broken recently on these aspects as they not yet automatically tested. Could you check with the new SDK and procedure if you still have the issue ? If yes, I will have to debug that, something must be wrong with the runtime. Could you sent me a binary package with BBQ that allows me to reproduce and see the issue ?
Ciao,
Germain
Sent: Monday, March 04, 2013 6:21 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
I’ve attached the AIDL.
Now, if we start the BarbequeRTRM daemon, the platform initialization is completed but the enumeration we get is wrong.
Unfortunately still we get a wrong enumeration:
V/bq.pp ( 1171): PLAT P2012: ... Loading platform data ...
I//vendor/modules/p2012d_dbg( 1018): p2012d_pipe.c main(305) P2012d: waiting for client (opening pipes) ... V/bq.pp ( 1171): PLAT P2012: Message queues initialized V/bq.pp ( 1171): PLAT P2012: Start notification sent V/bq.pp ( 1171): PLAT P2012: Driver initialized V/bq.pp ( 1171): PLAT P2012: Device descriptor mapped in [b6769000] V/bq.pp ( 1171): PLAT P2012: Platform initialization performed V/bq.pp ( 1171): PLAT P2012: Platform is ready I/bq.pp ( 1171): PLAT PRX: Platform [com.st.sthorm] initialization COMPLETED V/bq.ra ( 1171): Report on state view: 0 I/bq.ra ( 1171): ========================================================================= I/bq.ra ( 1171): | RESOURCES | USED | UNRESERVED | TOTAL | I/bq.ra ( 1171): |-------------------------------+-------------+---------------------------| I/bq.ra ( 1171): | sys0.acc0.grp0.io0 I : 0.000e+0 | 1849937024. | 1849937024. | I/bq.ra ( 1171): | sys0.acc0.grp0.io1 I : 0.000e+0 | 1849937024. | 1849937024. | I/bq.ra ( 1171): | sys0.acc0.grp0.mem0 I : 0.000e+0 | 1535.500e+9 | 1535.500e+9 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe0 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe1 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe10 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe11 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe12 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe13 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe14 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe15 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe2 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe3 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe4 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe5 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe6 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe7 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe8 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp0.pe9 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | [... entries removed for brevity ...] I/bq.ra ( 1171): | sys0.acc0.grp7.io0 I : 0.000e+0 | 1849937024. | 1849937024. | I/bq.ra ( 1171): | sys0.acc0.grp7.io1 I : 0.000e+0 | 1849937024. | 1849937024. | I/bq.ra ( 1171): | sys0.acc0.grp7.mem0 I : 0.000e+0 | 0.000e+0 | 0.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe0 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe1 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe10 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe11 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe12 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe13 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe14 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe15 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe2 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe3 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe4 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe5 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe6 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe7 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe8 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): | sys0.acc0.grp7.pe9 I : 0.000e+0 | 100.000e+0 | 100.000e+0 | I/bq.ra ( 1171): ========================================================================= V/bq.pp ( 1171): Worker[bq.pp]: Registered V/bq.pp ( 1171): PLAT PRX: Monitoring thread STARTED
And this is the new kernel logile we get:
[ 207.410000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1593) : case P2012_P2012D_OPEN
[ 207.440000] DD[kernel-1040] p2012_ld.c, allocP2012Priv(583) : [ 207.460000] DD[kernel-1040] p2012_ld.c, p2012_initHandles(569) : [ 207.490000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1610) : p2012Priv = d8284c00 [ 207.530000] DD[kernel-1040] p2012_ld.c, p2012_allocSysQueuesPrivateHandle(1100) : p2012Priv = d8284c00 [ 207.560000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1303) : case P2012_CREATE_QUEUE from(5) to (4) [ 207.600000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(65) : sizeof(P2012_message_t)=256 [ 207.630000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(66) : nr_elem=8 [ 207.660000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(73) : msg_host_virt_address=ffda2000 [ 207.690000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(80) : msg_fabric_phys_address=983c7000 [ 207.730000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1339) : data.back_link= (null) [ 207.760000] DD[kernel-1040] p2012_ld.c, p2012_setProcess(489) : backlink= (null) [ 207.790000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1351) : Queue has been allocated: [ 207.820000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1352) : - usrHandle: 118 [ 207.860000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1353) : - realHandle: 21 [ 207.890000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1354) : - :queue->id 21 [ 207.920000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1355) : - process: 0xd8284c00 [ 207.950000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1303) : case P2012_CREATE_QUEUE from(4) to (5) [ 207.990000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(65) : sizeof(P2012_message_t)=256 [ 208.020000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(66) : nr_elem=8 [ 208.050000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(73) : msg_host_virt_address=ffda1000 [ 208.080000] DD[kernel-1040] p2012_queue_mgmt.c, allocMsgQueue(80) : msg_fabric_phys_address=983fd000 [ 208.120000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1339) : data.back_link= (null) [ 208.150000] DD[kernel-1040] p2012_ld.c, p2012_setProcess(489) : backlink= (null) [ 208.180000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1351) : Queue has been allocated: [ 208.210000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1352) : - usrHandle: 117 [ 208.250000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1353) : - realHandle: 22 [ 208.280000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1354) : - :queue->id 22 [ 208.310000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1355) : - process: 0xd8284c00 [ 208.330000] DD[kernel-1083] p2012_ld.c, usr_ioctl(2033) : case P2012_SEND_MSG [ 208.360000] DD[kernel-1083] p2012_ld.c, usr_ioctl(2054) : queue_ptr=ffdc0670, from5 to 4 [ 208.390000] DD[kernel-1083] p2012_ld.c, usr_ioctl(2055) : posIn=0, posOut=0 [ 208.420000] DD[kernel-1083] p2012_ld.c, usr_ioctl(2077) : callback= (null) [ 208.460000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1439) : case P2012_BBQ_INIT [ 208.490000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1444) : case P2012_BBQ_INIT handle = 70500000 [ 208.530000] DD[kernel-1040] p2012_ld.c, p2012_daemon_ioctl(1445) : case P2012_BBQ_INIT size = 524288, 0x80000 [ 208.550000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2289) : vm_pgoff=460032=0x70500 [ 208.580000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2290) : offset=1884291072=0x70500000 [ 208.610000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2291) : vma_size=524288=0x80000 [ 208.640000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2323) : curr->busAddr=0x70500000 [ 208.670000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2324) : curr->userLogicalAddr=0x (null) [ 208.710000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2326) : curr->busAddr=0x70500000 [ 208.740000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2327) : curr->userLogicalAddr=0x (null) [ 208.770000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2377) : userLogicalAddr=b6714000 [ 208.800000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2378) : busAddr=0x70500000 [ 208.830000] DD[kernel-1083] p2012_ld.c, p2012_ld_mmap(2379) : kernelLogicalAddr=e1500000
./dumpDescriptor.sh 0x70500000 0x1DC 2
Value at address 0x705001DC (0xb6fbf1dc): 0x8 (clusters_count)
Value at address 0x705001E0 (0xb6ffa1e0): 0x10 (pes_coount)
These are still the value I can read from the device descriptor.
This, yes... the firmware has some issue with respect to BBQ integration.
I think something may have been broken recently on these aspects as they not yet automatically tested. Could you check with the new SDK and procedure if you still have the issue ? If yes, I will have to debug that, something must be wrong with the runtime. Could you sent me a binary package with BBQ that allows me to reproduce and see the issue ?
Ok, thansk!
All the required SW and tools are linked in the previous text. Hope they could be useful.
Meanwhile, I would like to ask you if you could give us access to the p12Runtime source code, so that we could possibly support you better on investigating these integration issues.
You can find the runtime sources in the SDK, in src/p12Runtime. In order to compile you can configure the SDK and execute:
make clean build package FABRIC_TYPE=xp70
Meanwhile I will also try to find the issue.
Ciao,
Germain
Ciao,
Germain
Ciao Patrick
Hi Patrick,
indeed I’ve fixed a bug in the PIL that has been recently introduced. I’ll send you a new SDK today. Meanwhile you can modify and recompile the runtime :
--- a/src/p2012/main.c
+++ b/src/p2012/main.c
@@ -569,7 +569,7 @@ int main()
// Platform descriptor
int i;
- dev->pdesc.clusters_count = p_cc->runtimeConf.rtConf.nbCluster;
+ dev->pdesc.clusters_count = 0;
dev->pdesc.pes_count = p_cc->runtimeConf.rtConf.nbPe;
for (i=0; i<P2012_MAX_FABRIC_CLUSTER_COUNT; i++) {
if (p_cc->runtimeConf.rtConf.clusterMask & (1<<i)) {
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Monday, March 04, 2013 6:21 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
By the way: do you have an AIDL already defined for this Binder interface? Could you share it with us?
I’ve attached the AIDL.
You can find the runtime sources in the SDK, in src/p12Runtime. In order to compile you can configure the SDK and execute:
make clean build package FABRIC_TYPE=xp70
Meanwhile I will also try to find the issue.
Ciao,
Germain
indeed I’ve fixed a bug in the PIL that has been recently introduced. I’ll send you a new SDK today.
Meanwhile you can modify and recompile the runtime :
--- a/src/p2012/main.c
+++ b/src/p2012/main.c
@@ -569,7 +569,7 @@ int main()
// Platform descriptor
int i;
- dev->pdesc.clusters_count = p_cc->runtimeConf.rtConf.nbCluster;
+ dev->pdesc.clusters_count = 0;
dev->pdesc.pes_count = p_cc->runtimeConf.rtConf.nbPe;
for (i=0; i<P2012_MAX_FABRIC_CLUSTER_COUNT; i++) {
if (p_cc->runtimeConf.rtConf.clusterMask & (1<<i)) {
Ciao,
Germain
--- a/src/p2012/main.c
+++ b/src/p2012/main.c
@@ -569,7 +569,7 @@ int main()
// Platform descriptor
int i;
- dev->pdesc.clusters_count = p_cc->runtimeConf.rtConf.nbCluster;
+ dev->pdesc.clusters_count = 0;
dev->pdesc.pes_count = p_cc->runtimeConf.rtConf.nbPe;
for (i=0; i<P2012_MAX_FABRIC_CLUSTER_COUNT; i++) {
if (p_cc->runtimeConf.rtConf.clusterMask & (1<<i)) {
Sure... I'll try to deply this new runtime and check if it solves ;-)
I must admit this was quite painful to handle this binder part in the native part because this functionality is not visible in the Android NDK (on purpose). As this should be used only by the framework, this mean that you need the Android sources in order to compile the part that will interact with the OpenCL daemon. Is it an issue for you ?
If yes, what I can do is to hide the binder stuff behind a C api within a classic shared library, that you can call from BBQ. This is already what I did for OpenCL applications that want to connect to the OCL runtime. The binder stuff is hidden within the OpenCL library.
Bye,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Tuesday, March 05, 2013 10:55 AM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
Subject: Re: [STHORM] Integration issue - SDK v2013.1 - p12Runtime not properly initializing the platform descriptor
On Tue, Mar 5, 2013 at 9:32 AM, Germain HAUGOU <germain...@st.com> wrote:
I must admit this was quite painful to handle this binder part in the native part because this functionality is not visible in the Android NDK (on purpose).
As this should be used only by the framework, this mean that you need the Android sources in order to compile the part that will interact with the OpenCL daemon. Is it an issue for you ?
If yes, what I can do is to hide the binder stuff behind a C api within a classic shared library, that you can call from BBQ.
This is already what I did for OpenCL applications that want to connect to the OCL runtime. The binder stuff is hidden within the OpenCL library.
Bye,
Germain
I think we should go for a C wrapper, I already have the shared library, it should take one hour to add the call to the binder for the daemon config. Tell me if it is fine so that I add it.
Ciao,
Germain
From: Patrick Bellasi [mailto:derk...@gmail.com]
Sent: Tuesday, March 05, 2013 12:16 PM
To: Germain HAUGOU
Cc: bosp-...@googlegroups.com
Subject: Re: [STHORM] Integration issue - SDK v2013.1 - p12Runtime not properly initializing the platform descriptor
On Tue, Mar 5, 2013 at 11:47 AM, Germain HAUGOU <germain...@st.com> wrote:
I think we should go for a C wrapper, I already have the shared library, it should take one hour to add the call to the binder for the daemon config. Tell me if it is fine so that I add it.
Ciao,
Germain