summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f31270)
raw | patch | inline | side by side (parent: 0f31270)
author | Vivek Bardia <x0161644@ti.com> | |
Fri, 14 Mar 2014 13:12:20 +0000 (18:42 +0530) | ||
committer | Vivek Bardia <x0161644@ti.com> | |
Fri, 14 Mar 2014 13:12:20 +0000 (18:42 +0530) |
1. Zero Copy app updated with cfg file as input for thread config
2. Sample cfg files to run this messageq app
Signed-off-by: Vivek Bardia <x0161644@ti.com>
2. Sample cfg files to run this messageq app
Signed-off-by: Vivek Bardia <x0161644@ti.com>
35 files changed:
diff --git a/messageq/README b/messageq/README
index 37ecb55afe2a48ba0c8dbe6abfc4a1e0146b2f5b..f1de8dca07128fe581b53cc98985939f0ac37140 100755 (executable)
--- a/messageq/README
+++ b/messageq/README
BIOS
In order to build the BIOS side binary for this app
-1. Make sure you have a IPC Source Package already built for a particular platform.
-2. navigate to this directory and update the <PATH> in the below command and choose the desired platform and run
+1. Make sure you have a IPC Source Package already built for particular platform
+2. navigate to this directory and update the tool paths in the below commands & tools version & choose the platform and build
$ cd messageq_ipc_bios
-$ make -f ipc-bios.mak all PLATFORM=<omap54xx_smp/dra7xx-evm> IPCSRC=<PATH>/ipc_3_10_00_08 XDC_INSTALL_DIR=<PATH>/xdctools_3_25_02_70 BIOS_INSTALL_DIR=<PATH>/bios_6_35_02_45 ti.targets.arm.elf.M4=<PATH>/TI_CGT_TI_ARM_5.0.1 ti.targets.elf.C64T=<PATH>/TI_CGT_C6000_7.2.0
+$ make -f ipc-bios.mak all PLATFORM=<OMAP54XX/DRA7XX> IPCSRC=<GLSDK>/component-sources/ipc_x.xx.xx.xx XDC_INSTALL_DIR=<GLSDK>/component-sources/xdctools_x_xx_xx_xx BIOS_INSTALL_DIR=<GLSDK>/component-sources/bios_x_xx_xx_xx ti.targets.arm.elf.M4=<GLSDK>/ti-devkit/cgt470_5_0_1
Copy the built BIOS side binary found here
*************
IPU:
example-applications/messageq/messageq_ipc_bios/packages/ti/ipc/tests/bin/ti_platforms_sdp5430_IPU/messageq_zerocpy.xem4
+or
+example-applications/messageq/messageq_ipc_bios/packages/ti/ipc/tests/bin/ti_platforms_evmDRA7XX_ipu2/messageq_zerocpy.xem4
*************
in to the target filesystem location: /lib/firmware rename the binary to ducati-m3-core0.xem3
diff --git a/messageq/configs/high_40_recv.cfg b/messageq/configs/high_40_recv.cfg
--- /dev/null
@@ -0,0 +1,54 @@
+#Forty receiver threads at A15, from IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 40 # RX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/high_40_send.cfg b/messageq/configs/high_40_send.cfg
--- /dev/null
@@ -0,0 +1,54 @@
+#Forty sender threads from A15 to IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 40 # TX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/low_1_recv.cfg b/messageq/configs/low_1_recv.cfg
--- /dev/null
@@ -0,0 +1,15 @@
+#Single receiver thread at A15 from IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 1 # RX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/low_1_send.cfg b/messageq/configs/low_1_send.cfg
--- /dev/null
@@ -0,0 +1,15 @@
+#Single sender thread from A15 to IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 1 # TX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/mid_10_recv.cfg b/messageq/configs/mid_10_recv.cfg
--- /dev/null
@@ -0,0 +1,24 @@
+#Ten receiver threads at A15, from IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 10 # RX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/mid_10_send.cfg b/messageq/configs/mid_10_send.cfg
--- /dev/null
@@ -0,0 +1,24 @@
+#Ten sender threads from A15 to IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 10 # TX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
diff --git a/messageq/configs/mix_5_send_recv.cfg b/messageq/configs/mix_5_send_recv.cfg
--- /dev/null
@@ -0,0 +1,25 @@
+#five sender threads from A15 to IPU & five receiver threads at A15 from IPU
+#legend
+#
+#direction: 0-Send, 1-Recv
+#msgSize: in bytes(Should be 4 bytes aligned)
+#msgCount: number of messages to be exchanged
+#interval: in microsecs(us)
+#procID: core, Hardcoded to IPU2 for the time being
+#
+#######################################################################
+# Number # Direction # Size # Count # Interval # Proc ID #
+# 5 # TX # 2MB # 5000 # 2500 # 1 #
+# 5 # RX # 2MB # 5000 # 2500 # 1 #
+#######################################################################
+#
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=0, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
+direction=1, msgSize=2097152, msgCount=5000, interval=2500, procID=1
index 1a7026b5791ab33b4588dfcbc4e302a7bc8914be..e96b008970b5a1d1253666b844d117a98ae00b56 100755 (executable)
" --cinit_compression=off"
};
-/* Enable building SMP-BIOS enabled libraries for targets that support it */
-if (Pkg.name.match(/^ti\.sdo\.(ipc|utils)/)) {
- xdc.module("ti.targets.arm.elf.M3").profiles["smp"] =
- xdc.module("ti.targets.arm.elf.M3").profiles["debug"];
- xdc.module("ti.targets.arm.elf.M4").profiles["smp"] =
- xdc.module("ti.targets.arm.elf.M4").profiles["debug"];
-}
-
var platform = "";
+var smpEnabled = true;
+var Bld_goal = "";
/* initialize local vars with those set in xdcpaths.mak (via XDCARGS) */
for (arg = 0; arg < arguments.length; arg++) {
platform = configParts[0].split("=")[1];
continue;
}
+ else if (configParts[0].split("=")[0] == "BIOS_SMPENABLED") {
+ // print("FOUND SMP_ENABLED ARG - " + configParts[0]);
+ smpEnabled = configParts[0].split("=")[1].match(/^1$/);
+ continue;
+ }
+ else if (configParts[0].split("=")[0] == "GOAL") {
+ Bld_goal = configParts[0].split("=")[1];
+ continue;
+ }
+
+ if (platform == "") {
+ platform = "NONE";
+ }
+
/*
* Get the compiler's installation directory.
* For "ti.targets.elf.C674=/vendors/c6x/7.2.0", we get "/vendors/c6x/7.2.0"
/* Add appropriate platforms to build for based on target name */
if (targetName.match(/elf\.C674/)) {
- if (platform == 'omapl138') {
+ if (platform == 'OMAPL138') {
target.platforms.$add("ti.platforms.evmOMAPL138:DSP");
}
}
if (targetName.match(/elf\.C66$/)) {
switch (platform) {
- case 'tci6636':
+ case 'TCI6636':
target.platforms.$add("ti.platforms.evmTCI6636K2H");
break;
- case 'tci6638':
+ case 'TCI6638':
target.platforms.$add("ti.platforms.evmTCI6638K2K");
break;
- case 'dra7xx':
+ case 'DRA7XX':
target.platforms.$add("ti.platforms.evmDRA7XX:dsp1");
target.platforms.$add("ti.platforms.evmDRA7XX:dsp2");
break;
+ case 'NONE':
+ /* okay, no platform specified */
+ break;
+
default:
print("Unknown platform, skipping " + platform);
break;
}
if (targetName.match(/elf\.C64T/)) {
- if (platform == 'omap54xx_smp') {
+ if (platform == 'OMAP54XX') {
target.platforms.$add("ti.platforms.sdp5430:DSP");
}
}
if (targetName.match(/elf\.M4$/)) {
switch (platform) {
- case 'omap54xx_smp':
+ case 'OMAP54XX':
target.platforms.$add("ti.platforms.sdp5430:IPU");
break;
- case 'dra7xx':
+ case 'DRA7XX':
target.platforms.$add("ti.platforms.evmDRA7XX:ipu2");
target.platforms.$add("ti.platforms.evmDRA7XX:ipu1");
break;
+ case 'NONE':
+ /* okay, no platform specified */
+ break;
+
default:
print("Unknown platform, skipping " + platform);
break;
Build.targets.$add(target);
}
+if (smpEnabled) {
+ /* Enable building SMP-BIOS enabled libraries for targets that support it */
+ if (Pkg.name.match(/^ti\.sdo\.(ipc|utils)/)) {
+ xdc.module("ti.targets.arm.elf.M3").profiles["smp"] =
+ xdc.module("ti.targets.arm.elf.M3").profiles["debug"];
+ xdc.module("ti.targets.arm.elf.M4").profiles["smp"] =
+ xdc.module("ti.targets.arm.elf.M4").profiles["debug"];
+ }
+}
/* lib/ is a generated directory that 'xdc clean' should remove */
Pkg.generatedFiles.$add("lib/");
index 67b6a8473769df2fde0a67ffb44d4742ed1c52f3..ac4e779cfda3a20dde2e5743e4ff2c3386df7e27 100755 (executable)
# Where to install/stage the packages
# Typically this would point to the devkit location
#
-DESTDIR ?=
+DESTDIR ?= <UNDEFINED>
-packagesdir ?=
+packagesdir ?= /packages
libdir ?= /lib
includedir ?= /include
#
XDCARGS= \
PLATFORM=\"$(PLATFORM)\" \
+ BIOS_SMPENABLED=\"$(BIOS_SMPENABLED)\" \
ti.targets.C28_large=\"$(ti.targets.C28_large)\" \
ti.targets.C28_float=\"$(ti.targets.C28_float)\" \
ti.targets.C64P=\"$(ti.targets.C64P)\" \
gnu.targets.arm.A8F=\"$(gnu.targets.arm.A8F)\" \
gnu.targets.arm.A15F=\"$(gnu.targets.arm.A15F)\"
+ifeq ($(MAKECMDGOALS),release)
+ XDCARGS += GOAL=release
+endif
+
#
# Get list of packages to rebuild. Remove examples from the list.
#
######################################################
all:
- @ echo building ipc packages ...
+ @echo building ipc packages ...
# build everything in the Bios IPC package
- @ $(XDC) -P $(LIST)
+ @$(XDC) -P $(LIST)
libs:
@echo "#"
@echo "# Making $@ ..."
- $(XDC) .dlls -P $(LIST)
+ @$(XDC) .dlls -P $(LIST)
release:
- @ echo building ipc packages ...
+ @echo building ipc packages ...
# create a XDC release for the Bios IPC package
- @ $(XDC) release -P $(LIST)
+ @$(XDC) release -P $(LIST)
clean:
@ echo cleaning ipc packages ...
install:
@ echo installing ti/ipc to $(DESTDIR) ...
@ mkdir -p $(DESTDIR)/$(prefix)/$(docdir)
-# @ cp -rf $(wildcard ipc_*_release_notes.html) docs/* $(DESTDIR)/$(prefix)/$(docdir)
+ @ cp -rf $(wildcard ipc_*_release_notes.html) docs/* $(DESTDIR)/$(prefix)/$(docdir)
@ mkdir -p $(DESTDIR)/$(prefix)/$(includedir)/ti/ipc
@ cp -rf packages/ti/ipc/*.h $(DESTDIR)/$(prefix)/$(includedir)/ti/ipc
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuCore0.cfg b/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuCore0.cfg
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* -------------------------------- CORE0 ----------------------------------*/
-var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-MultiProc.setConfig("CORE0", ["HOST", "CORE0", "CORE1", "DSP"]);
-
-/* Required to run BIOS on SysM3 (core 0) */
-var Core = xdc.useModule('ti.sysbios.family.arm.ducati.Core');
-Core.id = 0;
-
-/* ----------------------------- TICK ---------------------------------------*/
-var Clock = xdc.useModule('ti.sysbios.knl.Clock');
-Clock.tickSource = Clock.TickSource_USER;
-/* Configure GPTimer3 as BIOS clock source */
-Clock.timerId = 0;
-
-var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
-var timerParams = new Timer.Params();
-timerParams.period = Clock.tickPeriod;
-timerParams.periodType = Timer.PeriodType_MICROSECS;
-/* Smart-idle wake-up-capable mode */
-timerParams.tiocpCfg.idlemode = 0x3;
-/* Wake-up generation for Overflow */
-timerParams.twer.ovf_wup_ena = 0x1;
-Timer.create(Clock.timerId, Clock.doTick, timerParams);
-
-/* Modules used in Power Management */
-xdc.loadPackage('ti.pm');
-var Power = xdc.useModule('ti.sysbios.family.arm.ducati.omap4430.Power');
-Power.loadSegment = "PM_DATA";
-
-/* Idle functions - PM functions should be last */
-var Idle = xdc.useModule('ti.sysbios.knl.Idle');
-Idle.addFunc('&VirtQueue_cacheWb'); /* Function to flush unicache in idle */
-Idle.addFunc('&ti_deh_Deh_idleBegin'); /* Watchdog detect idle function */
-Idle.addFunc('&IpcPower_idle'); /* IpcPower_idle must be at the end */
-
-/*
- * These lines coerce BIOS into creating a unique interrupt vector table for
- * each core. Core 0's interrupt vector table is placed at 0x400, Core 1's
- * is placed at 0x800.
- *
- * Additionally, because both sections (.vecs AND .resetVecs) are placed at
- * the same address, BIOS will NOT generate a vector table that gets placed
- * at location 0.
- *
- * A common vector table that gets placed at address 0 is being inserted into
- * the load image by the script that combines the two M3 programs into a
- * single load image.
- */
-Program.sectMap[".resetVecs"].loadAddress = (Core.id + 1) * 0x400;
-Program.sectMap[".vecs"].loadAddress = (Core.id + 1) * 0x400;
-
-Program.sectMap[".tracebuf"] = "TRACE_BUF";
-Program.sectMap[".errorbuf"] = "EXC_DATA";
-
-/*
- * Add support for offloading algorithms.
- * The section is placed at an unused address in the common segment.
- */
-Program.sectMap[".interm3offload"] = new Program.SectionSpec();
-Program.sectMap[".interm3offload"].loadAddress = 0x2000;
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuCore1.cfg b/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuCore1.cfg
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* -------------------------------- CORE1 ----------------------------------*/
-var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
-MultiProc.setConfig("CORE1", ["HOST", "CORE0", "CORE1", "DSP"]);
-
-/* Required to run BIOS on AppM3 (core 1) */
-var Core = xdc.useModule('ti.sysbios.family.arm.ducati.Core');
-Core.id = 1;
-
-/* ----------------------------- TICK ---------------------------------------*/
-var Clock = xdc.useModule('ti.sysbios.knl.Clock');
-Clock.tickSource = Clock.TickSource_USER;
-/* Configure GPTimer4 as BIOS clock source */
-Clock.timerId = 1;
-
-var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
-var timerParams = new Timer.Params();
-timerParams.period = Clock.tickPeriod;
-timerParams.periodType = Timer.PeriodType_MICROSECS;
-/* Smart-idle wake-up-capable mode */
-timerParams.tiocpCfg.idlemode = 0x3;
-/* Wake-up generation for Overflow */
-timerParams.twer.ovf_wup_ena = 0x1;
-Timer.create(Clock.timerId, Clock.doTick, timerParams);
-
-/* Modules used in Power Management */
-xdc.loadPackage('ti.pm');
-var Power = xdc.useModule('ti.sysbios.family.arm.ducati.omap4430.Power');
-Power.loadSegment = "PM_DATA";
-
-/* Idle functions - PM functions should be last */
-var Idle = xdc.useModule('ti.sysbios.knl.Idle');
-Idle.addFunc('&VirtQueue_cacheWb'); /* Function to flush unicache in idle */
-Idle.addFunc('&ti_deh_Deh_idleBegin'); /* Watchdog detect idle function */
-Idle.addFunc('&IpcPower_idle'); /* IpcPower_idle must be at the end */
-
-/*
- * These lines coerce BIOS into creating a unique interrupt vector table for
- * each core. Core 0's interrupt vector table is placed at 0x400, Core 1's
- * is placed at 0x800.
- *
- * Additionally, because both sections (.vecs AND .resetVecs) are placed at
- * the same address, BIOS will NOT generate a vector table that gets placed
- * at location 0.
- *
- * A common vector table that gets placed at address 0 is being inserted into
- * the load image by the script that combines the two M3 programs into a
- * single load image.
- */
-Program.sectMap[".resetVecs"].loadAddress = (Core.id + 1) * 0x400;
-Program.sectMap[".vecs"].loadAddress = (Core.id + 1) * 0x400;
-
-Program.sectMap[".tracebuf"] = "TRACE_BUF";
-Program.sectMap[".errorbuf"] = "EXC_DATA";
-
-/*
- * Add support for offloading algorithms.
- * The section is placed at an unused address in the common segment.
- */
-Program.sectMap[".interm3offload"] = new Program.SectionSpec();
-Program.sectMap[".interm3offload"].loadAddress = 0x2000;
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/package.bld b/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/package.bld
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*!
- * File generated by platform wizard.
- *
- */
-
-Pkg.attrs.exportAll = true;
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/package.xdc b/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/package.xdc
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * ======== package.xdc ========
- *
- */
-
-/*!
- * ======== ti.configs.omap54xx ========
- * Common config files.
- *
- */
-
-package ti.configs.omap54xx [1,0,0] {
-}
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/package.bld b/messageq/messageq_ipc_bios/packages/ti/configs/vayu/package.bld
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*!
- * File generated by platform wizard.
- *
- */
-
-Pkg.attrs.exportAll = true;
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/package.xdc b/messageq/messageq_ipc_bios/packages/ti/configs/vayu/package.xdc
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * ======== package.xdc ========
- *
- */
-
-/*!
- * ======== ti.configs.vayu ========
- * Common config files.
- *
- */
-
-package ti.configs.vayu [1,0,0] {
-}
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/Dsp.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/Dsp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/Dsp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp1.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp1.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp1.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp1.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp1.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp1.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp2.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp2.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp2.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp2.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Dsp2.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Dsp2.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/DspAmmu.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/DspAmmu.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/DspAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/DspAmmu.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/DspAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/DspAmmu.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpcCommon.cfg.xs b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_omap5.cfg.xs
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpcCommon.cfg.xs
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_omap5.cfg.xs
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpcCommon.cfg.xs
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_omap5.cfg.xs
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpcCommon.cfg.xs b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_vayu.cfg.xs
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpcCommon.cfg.xs
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_vayu.cfg.xs
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpcCommon.cfg.xs
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpcCommon_vayu.cfg.xs
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu1Smp.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu1Smp.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu1Smp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu1Smp.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu1Smp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu1Smp.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu2Smp.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu2Smp.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 97%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu2Smp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu2Smp.cfg
index a172b98..155f6bf
new mode 100644 (file)
similarity index 97%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/Ipu2Smp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/Ipu2Smp.cfg
index a172b98..155f6bf
*/
/* Idle Power Management functions for each core */
-Idle.addCoreFunc('&IpcPower_idle', 0);
-Idle.addCoreFunc('&IpcPower_idle', 1);
+/*Idle.addCoreFunc('&IpcPower_idle', 0);
+Idle.addCoreFunc('&IpcPower_idle', 1);*/
Program.sectMap[".tracebuf"] = "TRACE_BUF";
Program.sectMap[".errorbuf"] = "EXC_DATA";
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuAmmu.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_omap5.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_omap5.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_omap5.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpuAmmu.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_vayu.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpuAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_vayu.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/vayu/IpuAmmu.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuAmmu_vayu.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuSmp.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuSmp.cfg
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuSmp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuSmp.cfg
new mode 100644 (file)
similarity index 100%
rename from messageq/messageq_ipc_bios/packages/ti/configs/omap54xx/IpuSmp.cfg
rename to messageq/messageq_ipc_bios/packages/ti/ipc/tests/IpuSmp.cfg
diff --git a/messageq/messageq_ipc_bios/packages/ti/ipc/tests/load_task.c b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/load_task.c
--- /dev/null
@@ -0,0 +1,307 @@
+/*
+ * Monitor load and trace any change.
+ * Author: Vincent Stehlév-stehle@ti.com>, copied from ping_tasks.c
+ *
+ * Copyright (c) 2014, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <xdc/std.h>
+#include <xdc/cfg/global.h>
+#include <xdc/runtime/System.h>
+#include <xdc/runtime/Types.h>
+#include <ti/sysbios/hal/Hwi.h>
+#include <ti/sysbios/BIOS.h>
+#include <ti/sysbios/knl/Task.h>
+#include <ti/sysbios/utils/Load.h>
+#include <ti/sysbios/knl/Clock.h>
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <load_task.h>
+
+#ifdef __TMS470__
+#pragma DATA_SECTION(gUtils_prfObj, ".bss")
+#pragma DATA_SECTION(gUtils_accPrfLoadObj, ".bss")
+#endif
+
+Utils_PrfObj gUtils_prfObj;
+Utils_AccPrfLoadObj gUtils_accPrfLoadObj;
+UInt32 gUtils_startLoadCalc = 0;
+UInt32 gUtils_LoadLogInterval = 0;
+UInt32 gUtils_AutoResetLogInterval = 0;
+Task_Handle loadTaskHndl;
+
+Int32 Utils_prfInit()
+{
+ memset(&gUtils_prfObj, 0, sizeof(gUtils_prfObj));
+ memset(&gUtils_accPrfLoadObj, 0, sizeof(Utils_AccPrfLoadObj));
+/*
+ * Time to sleep between load reporting attempts, in ticks.
+ * On TI platforms, 1 tick == 1 ms.
+ */
+ gUtils_LoadLogInterval = 5000;
+
+ return 0;
+}
+
+Int32 Utils_prfLoadRegister(Task_Handle pTsk, char *name)
+{
+ UInt32 hndlId;
+ UInt32 cookie;
+ Int32 status = -1;
+ Utils_PrfLoadObj *pHndl;
+
+ cookie = Hwi_disable();
+
+ for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
+ {
+ pHndl = &gUtils_prfObj.loadObj[hndlId];
+
+ if (pHndl->isAlloc == FALSE)
+ {
+ pHndl->isAlloc = TRUE;
+ pHndl->pTsk = pTsk;
+ strncpy(pHndl->name, name, sizeof(pHndl->name));
+ System_printf("Utils_prfLoadRegister: %s, handle:0x%x\n", name, pTsk);
+ status = 0;
+ break;
+ }
+ }
+
+ Hwi_restore(cookie);
+
+ return status;
+}
+
+Int32 Utils_prfLoadUnRegister(Task_Handle pTsk)
+{
+ UInt32 hndlId;
+ UInt32 cookie;
+ Int32 status = -1;
+ Utils_PrfLoadObj *pHndl;
+
+ cookie = Hwi_disable();
+
+ for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
+ {
+ pHndl = &gUtils_prfObj.loadObj[hndlId];
+
+ if (pHndl->isAlloc && pHndl->pTsk == pTsk)
+ {
+ pHndl->isAlloc = FALSE;
+ System_printf("Utils_prfLoadUnRegister:handle:0x%x\n", pTsk);
+ status = 0;
+ break;
+ }
+ }
+
+ Hwi_restore(cookie);
+
+ return status;
+}
+
+Int32 Utils_prfLoadPrintAll()
+{
+ Int32 hwiLoad, swiLoad, tskLoad, hndlId, cpuLoad, totalLoad, otherLoad;
+ Utils_PrfLoadObj *pHndl;
+
+ hwiLoad = swiLoad = tskLoad = -1;
+
+ hwiLoad = (gUtils_accPrfLoadObj.totalHwiThreadTime * 1000) /
+ gUtils_accPrfLoadObj.totalTime;
+ swiLoad = (gUtils_accPrfLoadObj.totalSwiThreadTime * 1000) /
+ gUtils_accPrfLoadObj.totalTime;
+ cpuLoad = 1000 - ((gUtils_accPrfLoadObj.totalIdlTskTime * 1000) /
+ gUtils_accPrfLoadObj.totalTime);
+
+ totalLoad = hwiLoad+swiLoad;
+
+ System_printf("\n [%d]LOAD: CPU: %d.%d%% HWI: %d.%d%%, SWI:%d.%d%%, ",gUtils_AutoResetLogInterval,
+ cpuLoad/10, cpuLoad%10,
+ hwiLoad/10, hwiLoad%10,
+ swiLoad/10, swiLoad%10
+ );
+
+ for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
+ {
+ pHndl = &gUtils_prfObj.loadObj[hndlId];
+
+ if (pHndl->isAlloc)
+ {
+ tskLoad = -1;
+
+ tskLoad = (pHndl->totalTskThreadTime * 1000) /
+ gUtils_accPrfLoadObj.totalTime;
+
+ totalLoad += tskLoad;
+ if (tskLoad)
+ {
+ System_printf(" TSK: %s: %d.%d%%",
+ pHndl->name,
+ tskLoad/10,
+ tskLoad%10
+ );
+ }
+ }
+ }
+
+ otherLoad = cpuLoad - totalLoad;
+
+ System_printf(" %s: %d.%d%%",
+ "MISC",
+ otherLoad/10,
+ otherLoad%10
+ );
+
+ System_printf(" \n");
+
+ return 0;
+}
+
+Void Utils_prfLoadCalcReset()
+{
+ Utils_PrfLoadObj *pHndl;
+ UInt32 hndlId;
+
+ gUtils_accPrfLoadObj.totalHwiThreadTime = 0;
+ gUtils_accPrfLoadObj.totalSwiThreadTime = 0;
+ gUtils_accPrfLoadObj.totalTime = 0;
+ gUtils_accPrfLoadObj.totalIdlTskTime = 0;
+ /* Reset the performace loads accumulator */
+ for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
+ {
+ pHndl = &gUtils_prfObj.loadObj[hndlId];
+
+ if (pHndl->isAlloc && pHndl->pTsk != NULL)
+ {
+ pHndl->totalTskThreadTime = 0;
+
+ }
+ }
+}
+
+/* Monitor load and trace any change. */
+static Void loadTaskFxn(UArg arg0, UArg arg1)
+{
+ /* Suppress warnings. */
+ (void)arg0;
+ (void)arg1;
+
+ System_printf(
+ "loadTask: started\n"
+ " SLEEP_TICKS: %u\n"
+ " Load_hwiEnabled: %d\n"
+ " Load_swiEnabled: %d\n"
+ " Load_taskEnabled: %d\n"
+ " Load_updateInIdle: %d\n"
+ " Load_windowInMs: %u\n"
+ ,
+ gUtils_LoadLogInterval,
+ Load_hwiEnabled,
+ Load_swiEnabled,
+ Load_taskEnabled,
+ Load_updateInIdle,
+ Load_windowInMs
+ );
+
+ /* Infinite loop to trace load. */
+ for (;;) {
+
+ if (TRUE == gUtils_startLoadCalc)
+ {
+ Utils_prfLoadPrintAll();
+ gUtils_AutoResetLogInterval++;
+ }
+
+ /* Delay. */
+ Task_sleep(gUtils_LoadLogInterval);
+
+ /*Resetting the LoadCalcs every fifty iterations of data assumed to be collected,
+ So that acummulated load figures are more real and correct*/
+ if((gUtils_AutoResetLogInterval >= 50) && (gUtils_LoadLogInterval != 500))
+ {
+ Utils_prfLoadCalcReset();
+ gUtils_AutoResetLogInterval = 0;
+ }
+ }
+}
+
+/* Function called by Loadupdate for each update cycle */
+Void Utils_prfLoadUpdate()
+{
+ Utils_PrfLoadObj *pHndl;
+ Load_Stat hwiLoadStat, swiLoadStat, idlTskLoadStat,tskLoadStat;
+ Task_Handle idlTskHndl = NULL;
+ UInt32 hndlId;
+
+ idlTskHndl = Task_getIdleTask();
+ /* Get the all loads first */
+ Load_getGlobalHwiLoad(&hwiLoadStat);
+ Load_getGlobalSwiLoad(&swiLoadStat);
+ Load_getTaskLoad(idlTskHndl, &idlTskLoadStat);
+
+ gUtils_accPrfLoadObj.totalHwiThreadTime += hwiLoadStat.threadTime;
+ gUtils_accPrfLoadObj.totalSwiThreadTime += swiLoadStat.threadTime;
+ gUtils_accPrfLoadObj.totalTime += hwiLoadStat.totalTime;
+ gUtils_accPrfLoadObj.totalIdlTskTime += idlTskLoadStat.threadTime;
+
+ for (hndlId = 0; hndlId < UTILS_PRF_MAX_HNDL; hndlId++)
+ {
+ pHndl = &gUtils_prfObj.loadObj[hndlId];
+
+ if (pHndl->isAlloc && pHndl->pTsk != NULL)
+ {
+ Load_getTaskLoad(pHndl->pTsk, &tskLoadStat);
+ pHndl->totalTskThreadTime += tskLoadStat.threadTime;
+ }
+ }
+
+}
+
+void start_load_task(void)
+{
+ Task_Params params;
+ Utils_prfInit();
+ /* Monitor load and trace any change. */
+ Task_Params_init(¶ms);
+ params.instance->name = "loadtsk";
+ params.priority = 4;
+ loadTaskHndl = Task_create(loadTaskFxn, ¶ms, NULL);
+
+ if( NULL != loadTaskHndl)
+ {
+ Utils_prfLoadRegister(loadTaskHndl, "loadtsk");
+ }
+ else
+ System_printf("Could not create load task!\n");
+}
diff --git a/messageq/messageq_ipc_bios/packages/ti/ipc/tests/load_task.h b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/load_task.h
--- /dev/null
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * *
+ * Copyright (c) 2012 Texas Instruments Incorporated - http://www.ti.com/ *
+ * *
+ * All rights reserved. Property of Texas Instruments Incorporated. *
+ * Restricted rights to use, duplicate or disclose this code are *
+ * granted through contract. *
+ * *
+ * The program may not be used without the written permission *
+ * of Texas Instruments Incorporated or against the terms and conditions *
+ * stipulated in the agreement under which this program has been *
+ * supplied. *
+ * *
+ *****************************************************************************/
+/*
+* @file profile_task.h
+*
+*/
+
+#ifndef PROFILE_TASK_H
+#define PROFILE_TASK_H
+
+
+#ifdef _cplusplus
+extern "C"
+{
+#endif /* _cplusplus */
+
+#define UTILS_PRF_MAX_HNDL (10)
+
+/*
+ * Time to sleep between load reporting attempts, in ticks.
+ * On TI platforms, 1 tick == 1 ms.
+ */
+#define SLEEP_TICKS 1000
+
+#define UTILS_FLOAT2INT_ROUND(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
+
+typedef struct {
+ Bool isAlloc;
+ char name[32];
+ Task_Handle pTsk;
+ UInt64 totalTskThreadTime;
+
+} Utils_PrfLoadObj;
+
+typedef struct {
+ //ils_PrfTsHndl tsObj[UTILS_PRF_MAX_HNDL];
+ Utils_PrfLoadObj loadObj[UTILS_PRF_MAX_HNDL];
+
+} Utils_PrfObj;
+
+typedef struct {
+ UInt64 totalSwiThreadTime;
+ UInt64 totalHwiThreadTime;
+ UInt64 totalTime;
+ UInt64 totalIdlTskTime;
+} Utils_AccPrfLoadObj;
+
+void start_load_task(void);
+Int32 Utils_prfLoadRegister(Task_Handle pTsk, char *name);
+Void Utils_prfLoadCalcReset();
+Int32 Utils_prfInit();
+
+#ifdef _cplusplus
+}
+#endif /* _cplusplus */
+
+#endif /* PROFILE_TASK_H */
diff --git a/messageq/messageq_ipc_bios/packages/ti/ipc/tests/messageq_zerocpy.c b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/messageq_zerocpy.c
index 883110ec0e76880ab9c5ae9627d5222fb55e113f..3f392664e6be2b4ac71d58ef167148752e1ed378 100755 (executable)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <ti/ipc/mm/MmServiceMgr.h>
#include <ti/sysbios/hal/Cache.h>
+#include <ti/ipc/tests/load_task.h>
+
#define SLAVE_MESSAGEQNAME "SLAVE"
#define HOST_MESSAGEQNAME "HOST"
-#define NUMOFTHREADSMAX 20
+#define A15_MESSAGEQNAME "A15"
+#define M4_MESSAGEQNAME "M4"
static unsigned int numThreads;
-static unsigned int numMsgs;
-static unsigned int numMsgSize;
+
+enum ThreadDirection {
+ unidirectional_send = 0,
+ unidirectional_recv,
+ bidirectional
+};
+
+typedef struct SyncMsg {
+ unsigned int boBufPayloadPtr; /*Shared Region pointer address to be exchanged using MessageQ*/
+ unsigned int boBufPayloadSize; /*Shared Region pointer address Size*/
+ unsigned int numThread; /* Indicates the number of threads to the other core: Handshake */
+ unsigned int numMessages; /* Indicates the number of messages: Handshake */
+ unsigned int numWaitTime; /* Indicates the sleep/wait between send messages: Handshake */
+ unsigned int payloadSize; /* Indicates the size of the payload which will be carried by each message: Handshake */
+ unsigned int procId; /* Indicates the size of the payload which will be carried by each message: Handshake */
+ unsigned int thrDirection; /* Used a double to use each bit field for a thread. hence restriction of 64 threads*/
+ Task_Handle thrId;
+ } SyncMsg;
+
+
+typedef struct RemoteBufSyncMsg {
+ MessageQ_MsgHeader header;
+ unsigned int *boBufPayloadPtr; /*Shared Region pointer address to be exchanged using MessageQ*/
+ unsigned int boBufPayloadSize; /*Shared Region pointer address Size*/
+} RemoteBufSyncMsg;
static int gFinishedCounter = 0;
/* turn on/off printf's */
#define CHATTER 0
+#define HEAPID 0u
+
+extern UInt32 gUtils_startLoadCalc;
+extern UInt32 gUtils_LoadLogInterval;
+
#define SERVICE_NAME "rpc_example"
/* MxServer skel function declarations */
Void dataTransactFxn(Void)
{
- MessageQ_Msg getMsg;
- MessageQ_Handle messageQ;
- MessageQ_QueueId remoteQueueId;
+ MessageQ_Msg getMsgData;
+ MessageQ_Handle messageQData;
+ MessageQ_QueueId remoteQueueIdData;
Int status,i;
Char localQueueName[64];
Char hostQueueName[64];
System_sprintf(hostQueueName, "%s_%d", HOST_MESSAGEQNAME, 0);
/* Create a message queue. */
- messageQ = MessageQ_create(localQueueName, NULL);
- if (messageQ == NULL) {
+ messageQData = MessageQ_create(localQueueName, NULL);
+ if (messageQData == NULL) {
System_abort("MessageQ_create failed\n");
}
- System_printf("loopbackFxn: created MessageQ: %s; QueueID: 0x%x\n",
- localQueueName, MessageQ_getQueueId(messageQ));
- System_printf("Start the main loop: %d\n", 0);
+ System_printf("dataTransactFxn: created MessageQ: %s; QueueID: 0x%x\n",
+ localQueueName, MessageQ_getQueueId(messageQData));
//startC = Clock_getTicks();
/* Get a message */
- status = MessageQ_get(messageQ, &getMsg, MessageQ_FOREVER);
+ status = MessageQ_get(messageQData, &getMsgData, MessageQ_FOREVER);
if (status != MessageQ_S_SUCCESS) {
System_abort("This should not happen since timeout is forever\n");
}
- remoteQueueId = MessageQ_getReplyQueue(getMsg);
+ remoteQueueIdData = MessageQ_getReplyQueue(getMsgData);
- handshake_params = MessageQ_payload(getMsg);
+ handshake_params = MessageQ_payload(getMsgData);
boBufPayloadPtr = (UInt32 *)handshake_params[0];
boBufPayloadSize = handshake_params[1];
#if CHATTER
- System_printf("Recvd boBufPayloadPtr:0x%x, boBufPayloadSize= %d, boBufPayloadPtr[0]=0x%x, boBufPayloadPtr[boBufPayloadSize-4]=0x%x\n",
+ System_printf("dataTransactFxn: Recvd boBufPayloadPtr:0x%x, boBufPayloadSize= %d, boBufPayloadPtr[0]=0x%x, boBufPayloadPtr[boBufPayloadSize-4]=0x%x\n",
boBufPayloadPtr,
boBufPayloadSize,
boBufPayloadPtr[0],
for (i = 0; i < (boBufPayloadSize/sizeof(uint32_t)); i++) {
boBufPayloadPtr[i] = 0xdeadbeef;
}
-
+
/* test id of message received */
- if (MessageQ_getMsgId(getMsg) != 1) {
+ if (MessageQ_getMsgId(getMsgData) != 1) {
System_abort("The id received is incorrect!\n");
}
- status = MessageQ_put(remoteQueueId, getMsg);
+ status = MessageQ_put(remoteQueueIdData, getMsgData);
if (status != MessageQ_S_SUCCESS) {
System_abort("MessageQ_put had a failure/error\n");
}
arg0,numMsgs,
endC - startC, ((endC - startC) * Clock_tickPeriod) / numMsgs);*/
- MessageQ_delete(&messageQ);
+ MessageQ_delete(&messageQData);
}
+
/*
- * ======== loopbackFxn========
+ * ======== loopbackFxn_Send========
* Receive and return messages.
* Run at priority lower than tsk1Fxn above.
* Inputs:
* - arg0: number of the thread, appended to MessageQ host and slave names.
*/
-Void loopbackFxn(UArg arg0, UArg arg1)
+Void loopbackFxn_Send(UArg arg0, UArg arg1)
+{
+ MessageQ_Msg sndMsg;
+#if CHATTER
+ MessageQ_Handle messageQ;
+ Char localQueueName[64];
+ UInt32 *handshake_params;
+ UInt32 *boBufPayloadPtr, boBufPayloadSize;
+#endif
+ MessageQ_QueueId HostQueueId;
+ Char hostQueueName[64];
+ Int status;
+ UInt32 msgId = 0;
+ UInt32 startC;
+ UInt32 endC;
+ struct SyncMsg *thisTask = (struct SyncMsg *)arg0;
+
+#if CHATTER
+ System_printf("Thread loopbackFxn: %d\n", thisTask->numThread);
+#endif
+ System_sprintf(hostQueueName, "%s_RECV_MQ_%d", A15_MESSAGEQNAME, thisTask->numThread);
+#if CHATTER
+ System_printf("loopbackFxn: created MessageQ: %s; QueueID: 0x%x\n",
+ localQueueName, MessageQ_getQueueId(messageQ));
+ System_printf("Start the main loop: %d\n", thisTask->numThread);
+#endif
+ /* Poll until remote side has it's messageQ created before we send: */
+ do {
+ status = MessageQ_open (hostQueueName, &HostQueueId);
+ Task_sleep(1000);
+ } while (status == MessageQ_E_NOTFOUND);
+ if (status < 0) {
+ System_printf ("Error in MessageQ_open [0x%x]\n", status);
+ }
+
+ startC = Clock_getTicks();
+ while (msgId < thisTask->numMessages) {
+ sndMsg = MessageQ_alloc (HEAPID, sizeof(RemoteBufSyncMsg));
+ if (sndMsg == NULL) {
+ System_printf ("Error in MessageQ_alloc\n");
+ break;
+ }
+
+ MessageQ_setMsgId (sndMsg, msgId);
+
+ /* Have the remote proc reply to this message queue */
+ ((RemoteBufSyncMsg *)sndMsg)->boBufPayloadPtr = (unsigned int *)thisTask->boBufPayloadPtr;
+ ((RemoteBufSyncMsg *)sndMsg)->boBufPayloadSize = thisTask->boBufPayloadSize;
+
+ /* Send it back */
+ status = MessageQ_put(HostQueueId, sndMsg);
+ if (status != MessageQ_S_SUCCESS) {
+ System_abort("MessageQ_put had a failure/error\n");
+ }
+ msgId++;
+ Task_sleep((thisTask->numWaitTime/1000)+ ((thisTask->numWaitTime % 1000) != 0 )); /* Convert the receievd value which is in us to ms */
+ }
+
+ endC = Clock_getTicks();
+ System_printf("Thread %d: End Tic: %d\n",thisTask->numThread,endC);
+ System_printf("Thread %d: %d iterations took %d ticks or %d usecs/msg\n",
+ thisTask->numThread, thisTask->numMessages,
+ endC - startC, ((endC - startC) * Clock_tickPeriod) / thisTask->numMessages);
+
+#if CHATTER
+ System_printf("Test thread %d complete!\n", thisTask->numThread);
+#endif
+ MessageQ_close(&HostQueueId);
+
+ gFinishedCounter++;
+}
+
+/*
+ * ======== loopbackFxn_Recv========
+ * Receive and return messages.
+ * Run at priority lower than tsk1Fxn above.
+ * Inputs:
+ * - arg0: number of the thread, appended to MessageQ host and slave names.
+ */
+Void loopbackFxn_Recv(UArg arg0, UArg arg1)
{
MessageQ_Msg getMsg;
MessageQ_Handle messageQ;
- MessageQ_QueueId remoteQueueId;
Int status;
- UInt16 msgId = 0;
+ UInt32 msgId = 0;
Char localQueueName[64];
- Char hostQueueName[64];
UInt32 startC;
UInt32 endC;
+ struct SyncMsg *thisTask = (struct SyncMsg *)arg0;
+
+#if CHATTER
UInt32 *handshake_params;
UInt32 *boBufPayloadPtr, boBufPayloadSize;
+ System_printf("Thread loopbackFxn_Recv: %d\n", thisTask->numThread);
+#endif
+ System_sprintf(localQueueName, "%s_RECV_MQ_%d", M4_MESSAGEQNAME, thisTask->numThread);
#if CHATTER
- System_printf("Thread loopbackFxn: %d\n", arg0);
+ System_printf("Thread loopbackFxn_Recv: %d from Name:%s\n", thisTask->numThread,localQueueName);
#endif
- System_sprintf(localQueueName, "%s_%d", SLAVE_MESSAGEQNAME, arg0);
- System_sprintf(hostQueueName, "%s_%d", HOST_MESSAGEQNAME, arg0);
-
/* Create a message queue. */
messageQ = MessageQ_create(localQueueName, NULL);
if (messageQ == NULL) {
}
#if CHATTER
- System_printf("loopbackFxn: created MessageQ: %s; QueueID: 0x%x\n",
+ System_printf("loopbackFxn_Recv: created MessageQ: %s; QueueID: 0x%x\n",
localQueueName, MessageQ_getQueueId(messageQ));
- System_printf("Start the main loop: %d\n", arg0);
+ System_printf("Start the main loop: %d\n", thisTask->numThread)
#endif
startC = Clock_getTicks();
- while (msgId < numMsgs) {
+
+ while (msgId < thisTask->numMessages) {
/* Get a message */
status = MessageQ_get(messageQ, &getMsg, MessageQ_FOREVER);
if (status != MessageQ_S_SUCCESS) {
System_abort("This should not happen since timeout is forever\n");
}
- remoteQueueId = MessageQ_getReplyQueue(getMsg);
+#if CHATTER
handshake_params = MessageQ_payload(getMsg);
boBufPayloadPtr = (UInt32 *)handshake_params[0];
boBufPayloadSize = handshake_params[1];
-#if CHATTER
System_printf("Recvd boBufPayloadPtr:0x%x, boBufPayloadSize= %d, boBufPayloadPtr[0]=0x%x, boBufPayloadPtr[boBufPayloadSize-4]=0x%x\n",
boBufPayloadPtr,
boBufPayloadSize,
if (MessageQ_getMsgId(getMsg) != msgId) {
System_abort("The id received is incorrect!\n");
}
-
- /* Send it back */
- status = MessageQ_put(remoteQueueId, getMsg);
- if (status != MessageQ_S_SUCCESS) {
- System_abort("MessageQ_put had a failure/error\n");
- }
+ status = MessageQ_free (getMsg);
msgId++;
}
- gFinishedCounter++;
endC = Clock_getTicks();
-
+ System_printf("Thread %d: End Tic: %d\n",thisTask->numThread,endC);
System_printf("Thread %d: %d iterations took %d ticks or %d usecs/msg\n",
- arg0,numMsgs,
- endC - startC, ((endC - startC) * Clock_tickPeriod) / numMsgs);
-
+ thisTask->numThread,thisTask->numMessages,
+ endC - startC, ((endC - startC) * Clock_tickPeriod) / thisTask->numMessages);
+
MessageQ_delete(&messageQ);
#if CHATTER
- System_printf("Test thread %d complete!\n", arg0);
+ System_printf("Test thread %d complete!\n", thisTask->numThread);
#endif
+
+ gFinishedCounter++;
}
Void tsk1Fxn(UArg arg0, UArg arg1)
MessageQ_Handle messageQ;
MessageQ_QueueId remoteQueueId;
Char localQueueName[64];
- UInt16 procId;
+ Char tempTaskName[64];
UInt32 *handshake_params;
Task_Params params;
- Int i;
+ Int i, status;
+ struct SyncMsg *pTaskConfigs = NULL;
+ gUtils_startLoadCalc = 1;
/* Create handshake thread to correspond with host side test app: */
while(1)
{
- gFinishedCounter = 0;
-
- /* Construct a MessageQ name adorned with core name: */
- System_sprintf(localQueueName, "%s_%s", SLAVE_MESSAGEQNAME,
- MultiProc_getName(MultiProc_self()));
-
- messageQ = MessageQ_create(localQueueName, NULL);
- if (messageQ == NULL) {
- System_abort("MessageQ_create failed\n");
+ #if 1
+ gFinishedCounter = 0;
+ Task_sleep(2000);
+ Utils_prfLoadCalcReset();
+
+ /* Construct a MessageQ name adorned with core name: */
+ System_sprintf(localQueueName, "%s_%s", SLAVE_MESSAGEQNAME,
+ MultiProc_getName(MultiProc_self()));
+
+ messageQ = MessageQ_create(localQueueName, NULL);
+ if (messageQ == NULL) {
+ System_abort("MessageQ_create failed\n");
+ }
+
+ System_printf("tsk1Fxn: created MessageQ: %s; QueueID: 0x%x\n",
+ localQueueName, MessageQ_getQueueId(messageQ));
+
+ /* handshake with host to get starting parameters */
+ System_printf("Awaiting handshake sync message from host...\n");
+
+ MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
+
+ /* Reset the Load figures at the start so that we are able to get accurate CPU Load profin for this instance of run */
+ Utils_prfLoadCalcReset();
+
+ handshake_params = MessageQ_payload(msg);
+ numThreads = handshake_params[2];
+ remoteQueueId = MessageQ_getReplyQueue(msg);
+
+ status = MessageQ_put(remoteQueueId, msg);
+ if (status != MessageQ_S_SUCCESS) {
+ System_abort("MessageQ_put had a failure/error\n");
+ }
+
+ pTaskConfigs = (struct SyncMsg *)Memory_alloc(NULL, (numThreads * sizeof(struct SyncMsg)), 0, NULL);
+ /*
+ * Time to sleep between load reporting attempts, in ticks.
+ * On TI platforms, 1 tick == 1 ms.
+ */
+ gUtils_LoadLogInterval = 500;
+ for(i=0; i<numThreads;i++)
+ {
+
+ MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
+ handshake_params = MessageQ_payload(msg);
+ pTaskConfigs[i].numThread = i;
+ pTaskConfigs[i].numMessages = handshake_params[3];
+ pTaskConfigs[i].numWaitTime = handshake_params[4];
+ pTaskConfigs[i].payloadSize = handshake_params[5];
+
+ pTaskConfigs[i].boBufPayloadPtr = (UInt32)handshake_params[0];
+ pTaskConfigs[i].boBufPayloadSize = handshake_params[1];
+
+ if(handshake_params[7] == unidirectional_recv)
+ {
+ pTaskConfigs[i].thrDirection = unidirectional_send;
+ }
+ else if (handshake_params[7] == unidirectional_send)
+ {
+ pTaskConfigs[i].thrDirection = unidirectional_recv;
+ }
+
+ remoteQueueId = MessageQ_getReplyQueue(msg);
+#if CHATTER
+ System_printf("Received handshake msg from (procId:remoteQueueId): 0x%x:0x%x\n"
+ "Threads:%d Direction:%d messages: %d Wait Time(in us):%d payload: %d bytes, boBufPayloadPtr:%x, boBufPayloadSize:%d\n",
+ MessageQ_getProcId(remoteQueueId), remoteQueueId,
+ i,
+ pTaskConfigs[i].thrDirection,
+ pTaskConfigs[i].numMessages,
+ pTaskConfigs[i].numWaitTime,
+ pTaskConfigs[i].payloadSize,
+ pTaskConfigs[i].boBufPayloadPtr,
+ pTaskConfigs[i].boBufPayloadSize);
+#endif
+ status = MessageQ_put(remoteQueueId, msg);
+ if (status != MessageQ_S_SUCCESS) {
+ System_abort("MessageQ_put had a failure/error\n");
+ }
+
+ }
+
+ MessageQ_delete(&messageQ);
+
+ System_printf("Overall Starting Tic: %d\n",Clock_getTicks());
+ /* Create N threads to correspond with host side N thread test app: */
+ Task_Params_init(¶ms);
+ params.priority = 3;
+ for (i = 0; i < numThreads; i++) {
+ System_sprintf(tempTaskName, "MessageQ_Task_%d",i);
+ if(pTaskConfigs[i].thrDirection == unidirectional_recv)
+ {
+ params.arg0 = (unsigned int)&pTaskConfigs[i];
+ pTaskConfigs[i].thrId = Task_create(loopbackFxn_Recv, ¶ms, NULL);
+ if( NULL == pTaskConfigs[i].thrId)
+ System_printf("Task[%d]:Could not create %s task!\n",i,tempTaskName);
+ }
+ else if(pTaskConfigs[i].thrDirection == unidirectional_send)
+ {
+ params.arg0 = (unsigned int)&pTaskConfigs[i];
+ pTaskConfigs[i].thrId = Task_create(loopbackFxn_Send, ¶ms, NULL);
+ if( NULL == pTaskConfigs[i].thrId)
+ System_printf("Task[%d]:Could not create %s task!\n",i,tempTaskName);
+ }
+ }
+
+ while(gFinishedCounter < numThreads)
+ {
+ Task_sleep(1000); // sleep 1 second
+ }
+
+ dataTransactFxn();
+
+ for (i = 0; i < numThreads; i++) {
+ Task_delete(&pTaskConfigs[i].thrId);
}
- System_printf("tsk1Fxn: created MessageQ: %s; QueueID: 0x%x\n",
- localQueueName, MessageQ_getQueueId(messageQ));
-
- /* handshake with host to get starting parameters */
- System_printf("Awaiting handshake sync message from host...\n");
- MessageQ_get(messageQ, &msg, MessageQ_FOREVER);
-
- handshake_params = MessageQ_payload(msg);
- numThreads = handshake_params[0];
- numMsgs = handshake_params[1];
- numMsgSize = handshake_params[2];
-
- remoteQueueId = MessageQ_getReplyQueue(msg);
- procId = MessageQ_getProcId(remoteQueueId);
-
- System_printf("Received hanshake msg from (procId:remoteQueueId): 0x%x:0x%x\n"
- "Threads:%d messages: %d payload: %d bytes\n",
- procId, remoteQueueId,
- numThreads,
- numMsgs,
- numMsgSize);
-
- MessageQ_put(remoteQueueId, msg);
- MessageQ_delete(&messageQ);
-
- /* Create N threads to correspond with host side N thread test app: */
- Task_Params_init(¶ms);
- params.priority = 3;
- for (i = 0; i < numThreads; i++) {
- params.arg0 = i;
- Task_create(loopbackFxn, ¶ms, NULL);
- }
-
- while(gFinishedCounter < numThreads)
- {
- Task_sleep(1000); // sleep 1 second
- }
+ Memory_free(NULL,pTaskConfigs, (numThreads * sizeof(struct SyncMsg)));
- dataTransactFxn();
+ gUtils_LoadLogInterval = 5000;
+ #endif
}
}
+
Void mmrpc_tsk1Fxn(UArg arg0, UArg arg1)
{
register_MxServer();
*/
Int main(Int argc, Char* argv[])
{
- Task_create(tsk1Fxn, NULL, NULL);
- Task_create(mmrpc_tsk1Fxn, NULL, NULL);
-
+ Task_Handle mqTask;
+ Task_Handle mmrpcTask;
+ Task_Params paramsMq;
+ Task_Params paramsMMrpc;
+
+ Utils_prfInit();
+
+ start_load_task();
+
+ /* Monitor load and trace any change. */
+ Task_Params_init(¶msMq);
+ paramsMq.instance->name = "MessageQ_Task";
+ paramsMq.priority = 1;
+ Task_Params_init(¶msMMrpc);
+ paramsMMrpc.instance->name = "MMRPC_Task";
+ paramsMMrpc.priority = 1;
+
+ mqTask = Task_create(tsk1Fxn, ¶msMq, NULL);
+ if( NULL != mqTask)
+ {
+ Utils_prfLoadRegister(mqTask, "Main_Task");
+ }
+ else
+ System_printf("Could not create MessageQ_Task task!\n");
+
+ mmrpcTask = Task_create(mmrpc_tsk1Fxn, ¶msMMrpc, NULL);
+ if( NULL != mmrpcTask)
+ {
+ Utils_prfLoadRegister(mmrpcTask, "MMRPC_Task");
+ }
+ else
+ System_printf("Could not create MessageQ_Task task!\n");
+
BIOS_start();
return (0);
diff --git a/messageq/messageq_ipc_bios/packages/ti/ipc/tests/messageq_zerocpy.cfg b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/messageq_zerocpy.cfg
index a617e500105dc6fc74c27fffefc91e2ff489cf06..34b925e60370ed6bf8c55e71f2ad025504120501 100755 (executable)
rcmSettings.ipc = rcmSettings.IpcSupport_ti_sdo_ipc;
xdc.useModule('ti.grcm.RcmServer');
- xdc.loadCapsule("ti/configs/omap54xx/IpcCommon.cfg.xs");
- xdc.includeFile("ti/configs/omap54xx/IpuSmp.cfg");
- xdc.includeFile("ti/configs/omap54xx/IpuAmmu.cfg");
+ xdc.loadCapsule("IpcCommon_omap5.cfg.xs");
+ xdc.loadCapsule("IpuSmp.cfg");
+ xdc.loadCapsule("IpuAmmu_omap5.cfg");
var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.defaultStackSize = 12 * 0x400;
var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
VirtioSetup.common$.diags_INFO = Diags.ALWAYS_ON;
- xdc.includeFile("ti/configs/omap54xx/Dsp.cfg");
- xdc.includeFile("ti/configs/omap54xx/DspAmmu.cfg");
+ xdc.loadCapsule("Dsp.cfg");
+ xdc.loadCapsule("DspAmmu.cfg");
xdc.loadPackage('ti.ipc.mm');
}
xdc.loadPackage('ti.ipc.ipcmgr');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.addUserStartupFunction('&IpcMgr_ipcStartup');
+ var Memory = xdc.useModule('xdc.runtime.Memory');
+ var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
+ var GateHwi = xdc.useModule('ti.sysbios.gates.GateHwi');
+ HeapMem.common$.gate = GateHwi.create();
- var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
- var params = new HeapBuf.Params;
- params.align = 8;
- params.blockSize = 512;
- params.numBlocks = 256;
- var msgHeap = HeapBuf.create(params);
+ var heapMemParams = new HeapMem.Params;
+ heapMemParams.size = 0x2800000; // 40MB
+ heapMemParams.sectionName = ".systemHeap";
+ var heap0 = HeapMem.create(heapMemParams);
+ Memory.defaultHeapInstance = heap0;
+ Program.global.heap0 = heap0;
+
+ /* Mark heaps as NOINIT for optimizing boot-time */
+ Program.sectMap[".systemHeap"] = new Program.SectionSpec();
+ Program.sectMap[".systemHeap"].loadSegment = "EXT_HEAP";
+ Program.sectMap[".systemHeap"].type = "NOINIT";
var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
- MessageQ.registerHeapMeta(msgHeap, 0);
+ MessageQ.registerHeapMeta(heap0, 0);
var Diags = xdc.useModule('xdc.runtime.Diags');
Diags.setMaskMeta("ti.ipc.transports.TransportRpmsg",
xdc.loadPackage('ti.ipc.mm');
- xdc.loadCapsule("ti/configs/vayu/IpcCommon.cfg.xs");
+ var Load = xdc.useModule('ti.sysbios.utils.Load');
+ /* load calculation related settings */
+ Load.swiEnabled = true;
+ Load.hwiEnabled = true;
+ Load.taskEnabled = true;
+ Load.updateInIdle = true;
+ Load.windowInMs = 50;
+ Load.postUpdate = '&Utils_prfLoadUpdate';
+
+ var Task = xdc.useModule('ti.sysbios.knl.Task');
+ Task.defaultStackSize = 12 * 0x400;
+
+ xdc.loadCapsule("IpcCommon_vayu.cfg.xs");
if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX\:ipu1/)) {
- xdc.includeFile("ti/configs/vayu/Ipu1Smp.cfg");
+ xdc.loadCapsule("Ipu1Smp.cfg");
}
else {
- xdc.includeFile("ti/configs/vayu/Ipu2Smp.cfg");
+ xdc.loadCapsule("Ipu2Smp.cfg");
}
- xdc.includeFile("ti/configs/vayu/IpuAmmu.cfg");
+ xdc.loadCapsule("IpuAmmu_vayu.cfg");
}
else if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX/) &&
Program.cpu.attrs.cpuCore.match(/^6600$/)) {
xdc.loadPackage('ti.ipc.mm');
if (Program.platformName.match(/^ti\.platforms\.evmDRA7XX\:dsp1/)) {
- xdc.includeFile("ti/configs/vayu/Dsp1.cfg");
+ xdc.loadCapsule("Dsp1.cfg");
}
else {
- xdc.includeFile("ti/configs/vayu/Dsp2.cfg");
+ xdc.loadCapsule("Dsp2.cfg");
}
}
else {
diff --git a/messageq/messageq_ipc_bios/packages/ti/ipc/tests/package.bld b/messageq/messageq_ipc_bios/packages/ti/ipc/tests/package.bld
index 379cc45b79c36eb2a2583ad086585a7152cc331c..bd8be7a95bd18198dfddca7745fc00ce760ed2bd 100755 (executable)
EXT_HEAP: {
name: "EXT_HEAP",
base: 0x80200000,
- len: 0x00300000,
+ len: 0x09600000,
space: "data",
access: "RW"
},
Pkg.addExecutable(name + "/messageq_zerocpy", targ, platform, {
cfgScript: "messageq_zerocpy",
defs: "-D BENCHMARK -D IPU -D OMAP5xxx -DRPMSG_NS_2_0" + extraDefs
- }).addObjects(["messageq_zerocpy.c"]);
+ }).addObjects(["messageq_zerocpy.c","load_task.c"]);
}
}
index 2d64d850139c6f59a7a1f7ae1cef1e6ceb794ecb..880bc340477e8843d708ec02968f279b3919805e 100755 (executable)
# Optional: recommended to install all dependent components in one folder.
#
-DEPOT ?=
+DEPOT ?= _your_depot_folder_
-# Optional: platform to build
+# Platform to build for
# Supported platforms (choose one):
-# omapl138, omap54xx_smp, dra7xx, tci6636, tci6638
+# OMAPL138, OMAP54XX, DRA7XX, TCI6636, TCI6638
#
-# Note, this is used for both Linux and BIOS builds
+# Note, this is used for Linux, QNX and BIOS builds
#
PLATFORM ?=
# Set up required cross compiler path for IPC Linux configuration and build
#
-TOOLCHAIN_LONGNAME ?= arm-linux-gnueabihf
-TOOLCHAIN_INSTALL_DIR ?=
+TOOLCHAIN_LONGNAME ?= arm-none-linux-gnueabi
+TOOLCHAIN_INSTALL_DIR ?= $(DEPOT)/_your_arm_code_gen_install_
TOOLCHAIN_PREFIX ?= $(TOOLCHAIN_INSTALL_DIR)/bin/$(TOOLCHAIN_LONGNAME)-
-# Optional: Path to Linux Kernel - needed to build the MmRpc user libraries
-# (for devices that support it)
+# Path to Linux Kernel - needed to build the IPC user libraries
#
KERNEL_INSTALL_DIR ?=
#
DESTDIR ?=
-# List of supported devices (choose one): omap5432, vayu, simvayu
-#
-DEVICE ?=
-
#################### IPC Bios ####################
# Path to required dependencies for IPC BIOS builds
#
-XDC_INSTALL_DIR ?= $(DEPOT)/xdctools_3_25_02_70
-BIOS_INSTALL_DIR ?= $(DEPOT)/bios_6_35_02_45
+XDC_INSTALL_DIR ?= $(DEPOT)/_your_xdctools_install_
+BIOS_INSTALL_DIR ?= $(DEPOT)/_your_bios_install_
+
+# Do you want to build SMP-enabled libraries (if supported for your target)?
+# Set to either 0 (disabled) or 1 (enabled)
+#
+BIOS_SMPENABLED=1
# Path to various cgtools
#
ti.targets.elf.C64P ?=
ti.targets.elf.C64P_big_endian ?=
-ti.targets.elf.C64T ?= $(DEPOT)/TI_CGT_C6000_7.2.0
+ti.targets.elf.C64T ?=
ti.targets.elf.C66 ?=
ti.targets.elf.C66_big_endian ?=
ti.targets.elf.C674 ?=
ti.targets.arm.elf.A8F ?=
ti.targets.arm.elf.A8Fnv ?=
ti.targets.arm.elf.M3 ?=
-ti.targets.arm.elf.M4 ?= $(DEPOT)/TI_CGT_TI_ARM_5.0.1
+ti.targets.arm.elf.M4 ?=
ti.targets.arm.elf.M4F ?=
ti.targets.arp32.elf.ARP32 ?=
index 2b8ce37c8b31a24fd0d62b1865dd47548ee7dda8..08f073d582f4502f1663db93a5de079b37416c52 100755 (executable)
AM_CFLAGS = @DRM_CFLAGS@
-bin_PROGRAMS = MessageQZeroCpy
+bin_PROGRAMS = MessageQZCpy
-MessageQZeroCpy_SOURCES = MessageQZeroCpy.c
+MessageQZCpy_SOURCES = MessageQZCpy.c
-MessageQZeroCpy_LDADD = \
+MessageQZCpy_LDADD = \
@DRM_LIBS@ @GTHREAD_LIBS@ -ltiipc -ltiipcutils -lmmrpc
diff --git a/messageq/messageq_ipc_linux/MessageQZeroCpy.c b/messageq/messageq_ipc_linux/MessageQZCpy.c
old mode 100755 (executable)
new mode 100644 (file)
similarity index 53%
rename from messageq/messageq_ipc_linux/MessageQZeroCpy.c
rename to messageq/messageq_ipc_linux/MessageQZCpy.c
index cf84a40..0ecfe3a
new mode 100644 (file)
similarity index 53%
rename from messageq/messageq_ipc_linux/MessageQZeroCpy.c
rename to messageq/messageq_ipc_linux/MessageQZCpy.c
index cf84a40..0ecfe3a
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* =============================================================================
- * @file MessageQZeroCpy.c
+ * @file MessageQZCpy.c
*
* @brief Sample application for MessageQ module between MPU and Remote Proc
- * by Zero Copy Mechanism
*
* ============================================================================
*/
/* App defines: Must match on remote proc side: */
#define HEAPID 0u
-#define SLAVE_MESSAGEQNAME "SLAVE"
-#define HOST_MESSAGEQNAME "HOST"
+#define A15_HANDSHAKE_MQNAME "A15_RECEIVER_HANDSHAKE"
+#define A15_MESSAGEQNAME "A15"
+#define M4_MESSAGEQNAME "M4"
+#define SLAVE_MESSAGEQNAME "SLAVE"
+#define HOST_MESSAGEQNAME "HOST"
+
/** ============================================================================
* Macros and types
/*OMAP5 remoteproc1:IPU:proc id 1*/
#define COREPROC1 1u
-#define NUM_MESSAGES_DFLT 25200
-#define NUM_THREADS_DFLT 4
-#define NUM_MSGSIZE_DFLT 4
-#define MAX_NUM_THREADS 50
+/*Before increasing the below value handle the thrDirection variable capacity in SyncMsg
+ and check the same on the BIOS side code too*/
+#define MAX_NUM_THREADS 100
+#define MAX_INPUT_STR_SIZE (128)
/** ============================================================================
* Globals
* ============================================================================
*/
-static Int numMessages, numThreads, numMsgSize ,procNum;
-static unsigned int bufferPtr, bufferPtrRemoteAddr, bufferPtrSize;
/*!
* @brief structure
uint32_t * inBuf; /* This is the shared region space address */
} Mx_Compute;
-struct thread_info { /* Used as argument to thread_start() */
- pthread_t thread_id; /* ID returned by pthread_create() */
- int thread_num; /* Application-defined thread # */
- unsigned int boBufPayloadPtr; /*Shared Region pointer address per thread*/
- unsigned int boBufPayloadSize; /*Shared Region Size for this index of address*/
-};
typedef struct RemoteBufSyncMsg {
MessageQ_MsgHeader header;
typedef struct SyncMsg {
MessageQ_MsgHeader header; /* This is a mandatory requirement for MessageQ_alloc */
- unsigned int numChannels; /* Indicates the number of threads to the other core: Handshake */
+ unsigned int boBufPayloadPtr; /*Shared Region pointer address to be exchanged using MessageQ*/
+ unsigned int boBufPayloadSize; /*Shared Region pointer address Size*/
+ unsigned int numThreads; /* Indicates the number of threads to the other core: Handshake */
unsigned int numMessages; /* Indicates the number of messages: Handshake */
+ unsigned int numWaitTime; /* Indicates the sleep/wait between send messages: Handshake */
unsigned int payloadSize; /* Indicates the size of the payload which will be carried by each message: Handshake */
+ unsigned int procId; /* Indicates the size of the payload which will be carried by each message: Handshake */
+ unsigned int thrDirection; /* Used a double to use each bit field for a thread. hence restriction of 64 threads*/
} SyncMsg;
-static void * pingThreadFxn(void *arg);
+enum ThreadDirection {
+ unidirectional_send = 0,
+ unidirectional_recv,
+ bidirectional
+};
+
+typedef struct thread_info { /* Used as argument to thread_start() */
+ pthread_t thread_id; /* ID returned by pthread_create() */
+ unsigned int thread_num; /* Application-defined thread # */
+ int config_param; /* This will define the communication direction of this thread.*/
+ unsigned int numMessages; /* Indicates the number of messages: Handshake */
+ unsigned int numWaitTime; /* Indicates the sleep/wait between send messages: Handshake */
+ unsigned int payloadSize; /* Indicates the size of the payload which will be carried by each message: Handshake */
+ unsigned int procId; /* Indicates the procid for this thread: Handshake */
+ unsigned int boBufPayloadPtr; /*Shared Region pointer address per thread*/
+ unsigned int boBufPayloadSize; /*Shared Region Size for this index of address*/
+}thrConfigs;
+
+typedef struct stProPerfConfig {
+ int procId;
+ int numThreads;
+ int bufferPtr;
+ int bufferPtrRemoteAddr;
+ int bufferPtrSize;
+ int totalReqPayloadSize;
+ thrConfigs *pThrConfig;
+ Mx_Compute *compute;
+ SyncMsg stSyncMsg;
+}stProPerfConfig;
+
+
+static void * pingThreadFxn_uni_send(void *arg);
+static void * pingThreadFxn_uni_recv(void *arg);
struct omap_device *dev = NULL;
struct omap_bo *compute_bo = NULL;
return (temp.tv_sec * 1000000UL + temp.tv_nsec / 1000);
}
-static int callCompute_Linux(uint32_t *mmInBufPtr, uint32_t *mmRemoteInBufPtr, uint32_t *mmInBufPtrSize)
+static int callCompute_Linux(stProPerfConfig *stExpConfig)
{
- Mx_Compute *compute = NULL;
uint32_t * inBufPtr = NULL;
int status = 0;
int size;
@@ -288,23 +319,23 @@ static int callCompute_Linux(uint32_t *mmInBufPtr, uint32_t *mmRemoteInBufPtr, u
/* allocate a compute structure in shared memory and get a pointer */
compute_bo = omap_bo_new(dev, sizeof(Mx_Compute), OMAP_BO_WC);
if (compute_bo) {
- compute = (Mx_Compute *)omap_bo_map(compute_bo);
+ stExpConfig->compute = (Mx_Compute *)omap_bo_map(compute_bo);
}
else {
fprintf(stderr, "failed to allocate omap_bo\n");
}
- if (compute == NULL) {
+ if (stExpConfig->compute == NULL) {
fprintf(stderr, "failed to map omap_bo to user space\n");
return -1;
}
/* initialize compute structure */
- compute->size = (numMsgSize/(sizeof(uint32_t))); /* [TODO]Assumption: user_payload_size/sizeof(uint32_t) */
- compute->inBuf = NULL;
+ stExpConfig->compute->size = (stExpConfig->totalReqPayloadSize/(sizeof(uint32_t))); /* [TODO]Assumption: user_payload_size/sizeof(uint32_t) */
+ stExpConfig->compute->inBuf = NULL;
/* allocate an input buffer in shared memory */
- size = compute->size * sizeof(uint32_t);
+ size = stExpConfig->compute->size * sizeof(uint32_t);
inBuf_bo = omap_bo_new(dev, size, OMAP_BO_WC);
if (inBuf_bo) {
inBufPtr = (uint32_t *)omap_bo_map(inBuf_bo);
@@ -320,19 +351,19 @@ static int callCompute_Linux(uint32_t *mmInBufPtr, uint32_t *mmRemoteInBufPtr, u
}
/* fill input buffer with seed value */
- for (i = 0; i < compute->size; i++) {
+ for (i = 0; i < stExpConfig->compute->size; i++) {
inBufPtr[i] = 0xbeefdead;
}
- compute->inBuf = (uint32_t *)inBufPtr;
+ stExpConfig->compute->inBuf = (uint32_t *)inBufPtr;
/* print some debug info */
#if PRINT_DEBUG
- printf("compute->size=0x%x\n", compute->size);
- printf("compute->inBuf=0x%x\n", (unsigned int)compute->inBuf);
+ printf("compute->size=0x%x\n", stExpConfig->compute->size);
+ printf("compute->inBuf=0x%x\n", (unsigned int)stExpConfig->compute->inBuf);
#endif
/* process the buffer */
- ret = Mx_compute_Linux(compute, omap_bo_dmabuf(compute_bo),
+ ret = Mx_compute_Linux(stExpConfig->compute, omap_bo_dmabuf(compute_bo),
omap_bo_dmabuf(inBuf_bo));
if (ret < 0) {
@@ -342,13 +373,13 @@ static int callCompute_Linux(uint32_t *mmInBufPtr, uint32_t *mmRemoteInBufPtr, u
}
#if PRINT_DEBUG
printf("After Mx_compute_Linux mmrpc call \n");
- printf("compute->inBuf=0x%x\n", (unsigned int)compute->inBuf);
+ printf("compute->inBuf=0x%x\n", (unsigned int)stExpConfig->compute->inBuf);
printf("compute->inBuf[0]=0x%x\n",
- (unsigned int)compute->inBuf[0]);
+ (unsigned int)stExpConfig->compute->inBuf[0]);
#endif
/*This checks Data Transaction at mmrpc level;check the output buffer */
/* starting at index 1 because 0th index contains translated address of inBufPtr*/
- for (i = 1; i < compute->size; i++) {
+ for (i = 1; i < stExpConfig->compute->size; i++) {
if (inBufPtr[i] != 0xdeadbeef) {
status = 1;
printf("Error: incorrect InBuf\n");
@@ -356,42 +387,41 @@ static int callCompute_Linux(uint32_t *mmInBufPtr, uint32_t *mmRemoteInBufPtr, u
}
}
- *mmInBufPtr = (unsigned int)compute->inBuf;
- *mmRemoteInBufPtr = (unsigned int)compute->inBuf[0];
- *mmInBufPtrSize = size;
+ stExpConfig->bufferPtr = (unsigned int)stExpConfig->compute->inBuf;
+ stExpConfig->bufferPtrRemoteAddr = (unsigned int)stExpConfig->compute->inBuf[0];
+ stExpConfig->bufferPtrSize = stExpConfig->compute->size * sizeof(uint32_t);
return (status);
}
-Int MessageQApp_handshake(UInt32 numChannels, UInt32 numMessages, UInt32 payloadSize, UInt16 procId)
+Int MessageQApp_handshake(stProPerfConfig stExpConfig)
{
- Int32 status = 0;
+ Int32 i = 0, status = 0;
MessageQ_Msg msg = NULL;
MessageQ_Params msgParams;
MessageQ_QueueId queueId = MessageQ_INVALIDMESSAGEQ;
MessageQ_Handle msgqHandle;
char remoteQueueName[64];
+ int tempOffsetCtr = 0;
#if PRINT_DEBUG
printf("Entered MessageQApp_handshake\n");
#endif
-
+
/* Create the local Message Queue for receiving. */
MessageQ_Params_init(&msgParams);
- msgqHandle = MessageQ_create(HOST_MESSAGEQNAME, &msgParams);
+ msgqHandle = MessageQ_create(A15_HANDSHAKE_MQNAME, &msgParams);
if (msgqHandle == NULL) {
printf("Error in MessageQ_create\n");
goto exit;
}
#if PRINT_DEBUG
else {
- printf("Local MessageQId: 0x%x\n", MessageQ_getQueueId(msgqHandle));
+ printf("%s,Local MessageQId: 0x%x\n",A15_HANDSHAKE_MQNAME, MessageQ_getQueueId(msgqHandle));
}
#endif
sprintf(remoteQueueName, "%s_%s", SLAVE_MESSAGEQNAME,
- MultiProc_getName(procId));
-
- //printf("%s:%d remoteQueueName:%s\n",__func__,__LINE__,remoteQueueName);
+ MultiProc_getName(stExpConfig.procId));
/* Poll until remote side has it's messageQ created before we send: */
do {
status = MessageQ_open(remoteQueueName, &queueId);
@@ -404,33 +434,70 @@ Int MessageQApp_handshake(UInt32 numChannels, UInt32 numMessages, UInt32 payload
}
#if PRINT_DEBUG
else {
- printf("Remote queueId [0x%x]\n", queueId);
+ printf("%s Remote queueId [0x%x]\n",remoteQueueName, queueId);
}
#endif
msg = MessageQ_alloc(HEAPID, sizeof(SyncMsg));
if (msg == NULL) {
printf("Error in MessageQ_alloc\n");
- MessageQ_close(&queueId);
- goto cleanup;
+ goto close_cleanup;
}
-
+
/* handshake with remote to set the number of loops */
MessageQ_setReplyQueue(msgqHandle, msg);
- ((SyncMsg *)msg)->numMessages = numMessages;
- ((SyncMsg *)msg)->numChannels = numChannels;
- ((SyncMsg *)msg)->payloadSize = payloadSize;
-
- MessageQ_put(queueId, msg);
- MessageQ_get(msgqHandle, &msg, MessageQ_FOREVER);
+
+ /* Ensuring first I handshake no. of threads/tasks so that a loop can be created at bios side*/
+ ((SyncMsg *)msg)->numThreads = stExpConfig.numThreads;
+ status = MessageQ_put(queueId, msg);
+ if (status < 0) {
+ printf("MessageQ_put handshake failed [%d]\n", status);
+ goto free_cleanup;
+ }
+
+ status = MessageQ_get(msgqHandle, &msg, MessageQ_FOREVER);
+ if (status < 0) {
+ printf ("Error in MessageQ_get [0x%x]\n", status);
+ }
+ else {
+#if PRINT_DEBUG
+ printf("Exchanged thread count handshake with remote processor %s...\n",
+ MultiProc_getName(stExpConfig.procId));
+#endif
+ }
+
+ for (i = 0; i < stExpConfig.numThreads; i++)
+ {
+ ((SyncMsg *)msg)->boBufPayloadPtr = stExpConfig.bufferPtrRemoteAddr + tempOffsetCtr;
+ ((SyncMsg *)msg)->boBufPayloadSize = stExpConfig.pThrConfig[i].payloadSize;
+ ((SyncMsg *)msg)->numMessages = stExpConfig.pThrConfig[i].numMessages;
+ ((SyncMsg *)msg)->numWaitTime = stExpConfig.pThrConfig[i].numWaitTime;
+ ((SyncMsg *)msg)->payloadSize = stExpConfig.pThrConfig[i].payloadSize;
+ ((SyncMsg *)msg)->procId = stExpConfig.pThrConfig[i].procId;
+ ((SyncMsg *)msg)->thrDirection = stExpConfig.pThrConfig[i].config_param;
+ tempOffsetCtr += stExpConfig.pThrConfig[i].payloadSize;
+ status = MessageQ_put(queueId, msg);
+ if (status < 0) {
+ printf("MessageQ_put handshake failed [%d]\n", status);
+ goto free_cleanup;
+ }
+
+ status = MessageQ_get(msgqHandle, &msg, MessageQ_FOREVER);
+ if (status < 0) {
+ printf ("Error in MessageQ_get [0x%x]\n", status);
+ break;
+ }
+ }
+
#if PRINT_DEBUG
printf("Exchanged handshake with remote processor %s...\n",
- MultiProc_getName(procId));
+ MultiProc_getName(stExpConfig.procId));
#endif
+free_cleanup:
MessageQ_free(msg);
+close_cleanup:
MessageQ_close(&queueId);
-
cleanup:
/* Clean-up */
status = MessageQ_delete(&msgqHandle);
return (status);
}
-
-static Void * pingThreadFxn(void *arg)
+static Void * pingThreadFxn_uni_send(void *arg)
{
struct thread_info pingThreadFxnData = *(struct thread_info *)arg;
Int threadNum = 0;
Int32 status = 0;
MessageQ_Msg msg = NULL;
- MessageQ_Params msgParams;
UInt16 i;
- MessageQ_Handle handle;
MessageQ_QueueId queueId = MessageQ_INVALIDMESSAGEQ;
char remoteQueueName[64];
- char hostQueueName[64];
threadNum = pingThreadFxnData.thread_num;
- sprintf(remoteQueueName, "%s_%d", SLAVE_MESSAGEQNAME, threadNum );
- sprintf(hostQueueName, "%s_%d", HOST_MESSAGEQNAME, threadNum );
-
-#if PRINT_DEBUG
- printf("pingThreadFxn This thread num: %d\n", threadNum);
-#endif
- /* Create the local Message Queue for receiving. */
- MessageQ_Params_init (&msgParams);
- handle = MessageQ_create (hostQueueName, &msgParams);
- if (handle == NULL) {
- printf ("Error in MessageQ_create\n");
- goto exit;
- }
-#if PRINT_DEBUG
- else {
- printf ("thread: %d, Local Message: %s, QId: 0x%x\n",
- threadNum, hostQueueName, MessageQ_getQueueId(handle));
- }
-#endif
+ sprintf(remoteQueueName, "%s_RECV_MQ_%d", M4_MESSAGEQNAME, threadNum );
+
+ //printf("pingThreadFxn This thread sending to num: %d, Name: %s\n", threadNum,remoteQueueName);
/* Poll until remote side has it's messageQ created before we send: */
do {
} while (status == MessageQ_E_NOTFOUND);
if (status < 0) {
printf ("Error in MessageQ_open [0x%x]\n", status);
- goto cleanup;
+ return ((void *)status);
}
#if PRINT_DEBUG
else {
printf ("thread: %d, Remote queue: %s, QId: 0x%x\n",
threadNum, remoteQueueName, queueId);
}
-
printf ("\nthread: %d: Exchanging messages with remote processor...\n",
threadNum);
#endif
-
- for (i = 0 ; i < numMessages ; i++) {
+ for (i = 0 ; i < pingThreadFxnData.numMessages ; i++) {
/* Allocate message. */
msg = MessageQ_alloc (HEAPID, sizeof(RemoteBufSyncMsg));
if (msg == NULL) {
MessageQ_setMsgId (msg, i);
/* Have the remote proc reply to this message queue */
- MessageQ_setReplyQueue (handle, msg);
((RemoteBufSyncMsg *)msg)->boBufPayloadPtr = pingThreadFxnData.boBufPayloadPtr;
((RemoteBufSyncMsg *)msg)->boBufPayloadSize = pingThreadFxnData.boBufPayloadSize;
printf ("Error in MessageQ_put [0x%x]\n", status);
break;
}
+ usleep (pingThreadFxnData.numWaitTime); /*Sleep for 2.5ms*/
+ }
+
+ MessageQ_close (&queueId);
+ return ((void *)status);
+}
+
+static Void * pingThreadFxn_uni_recv(void *arg)
+{
+ struct thread_info pingThreadFxnData = *(struct thread_info *)arg;
+ Int threadNum = 0;
+ Int32 status = 0;
+ MessageQ_Msg msg = NULL;
+ MessageQ_Params msgParams;
+ UInt16 i;
+ MessageQ_Handle handle;
+ char hostQueueName[64];
+
+ threadNum = pingThreadFxnData.thread_num;
+ sprintf(hostQueueName, "%s_RECV_MQ_%d", A15_MESSAGEQNAME, threadNum );
+
+ //printf("pingThreadFxn_uni_recv This thread num: %d from Name:%s \n", threadNum,hostQueueName);
+
+ /* Create the local Message Queue for receiving. */
+ MessageQ_Params_init (&msgParams);
+ handle = MessageQ_create (hostQueueName, &msgParams);
+ if (handle == NULL) {
+ printf ("Error in MessageQ_create\n");
+ goto exit;
+ }
+#if PRINT_DEBUG
+ else {
+ printf ("thread: %d, Local Message: %s, QId: 0x%x\n",
+ threadNum, hostQueueName, MessageQ_getQueueId(handle));
+ }
+#endif
+ for (i = 0 ; i < pingThreadFxnData.numMessages ; i++) {
status = MessageQ_get(handle, &msg, MessageQ_FOREVER);
if (status < 0) {
printf ("Error in MessageQ_get [0x%x]\n", status);
status = MessageQ_free (msg);
}
}
-
- MessageQ_close (&queueId);
-cleanup:
/* Clean-up */
status = MessageQ_delete (&handle);
if (status < 0) {
return ((void *)status);
}
-Int dataTransactFxn()
+
+Int dataTransactFxn(stProPerfConfig stExpConfig)
{
Int32 status = 0;
- MessageQ_Msg msg = NULL;
+ MessageQ_Msg msg1 = NULL;
MessageQ_Params msgParams;
- UInt16 i;
+ Int32 i;
MessageQ_Handle handle;
MessageQ_QueueId queueId = MessageQ_INVALIDMESSAGEQ;
char remoteQueueName[64];
char hostQueueName[64];
- sprintf(remoteQueueName, "%s_%d", SLAVE_MESSAGEQNAME, 0 );
- sprintf(hostQueueName, "%s_%d", HOST_MESSAGEQNAME, 0 );
+ sprintf(remoteQueueName, "%s_%d", SLAVE_MESSAGEQNAME,0);
+ sprintf(hostQueueName, "%s_%d", HOST_MESSAGEQNAME,0);
- printf("dataTransactFxn: This function is a test to showcase data transaction \n");
+ printf("dataTransactFxn: This function is a test to showcase data transaction\n");
/* Create the local Message Queue for receiving. */
MessageQ_Params_init (&msgParams);
printf ("Error in MessageQ_create\n");
goto exit;
}
-
/* Poll until remote side has it's messageQ created before we send: */
do {
status = MessageQ_open (remoteQueueName, &queueId);
}
/* Allocate message. */
- msg = MessageQ_alloc (HEAPID, sizeof(RemoteBufSyncMsg));
- if (msg == NULL) {
+ msg1 = MessageQ_alloc (HEAPID, sizeof(RemoteBufSyncMsg));
+ if (msg1 == NULL) {
printf ("Error in MessageQ_alloc\n");
goto cleanup;
}
- MessageQ_setMsgId (msg, 1);/* Set a random number to associate with this message*/
+ MessageQ_setMsgId (msg1, 1);/* Set a random number to associate with this message*/
- for (i = 0; i < (bufferPtrSize/sizeof(uint32_t)); i++) {
- ((unsigned int *)bufferPtr)[i] = 0xbeefdead;
+ for (i = 0; i < (stExpConfig.bufferPtrSize/sizeof(uint32_t)); i++) {
+ ((unsigned int *)stExpConfig.bufferPtr)[i] = 0xbeefdead;
}
/* Have the rem te proc reply to this message queue */
- MessageQ_setReplyQueue (handle, msg);
- ((RemoteBufSyncMsg *)msg)->boBufPayloadPtr = bufferPtrRemoteAddr;
- ((RemoteBufSyncMsg *)msg)->boBufPayloadSize = bufferPtrSize;
+ MessageQ_setReplyQueue (handle, msg1);
+ ((RemoteBufSyncMsg *)msg1)->boBufPayloadPtr = stExpConfig.bufferPtrRemoteAddr;
+ ((RemoteBufSyncMsg *)msg1)->boBufPayloadSize = stExpConfig.bufferPtrSize;
- status = MessageQ_put (queueId, msg);
+ status = MessageQ_put (queueId, msg1);
if (status < 0) {
printf ("Error in MessageQ_put [0x%x]\n", status);
goto cleanup;
}
- status = MessageQ_get(handle, &msg, MessageQ_FOREVER);
+ status = MessageQ_get(handle, &msg1, MessageQ_FOREVER);
if (status < 0) {
printf ("Error in MessageQ_get [0x%x]\n", status);
goto cleanup;
}
else {
- for (i = 0; i < (bufferPtrSize/sizeof(uint32_t)); i++) {
- if (((unsigned int *)bufferPtr)[i] != 0xdeadbeef) {
+ for (i = 0; i < (stExpConfig.bufferPtrSize/sizeof(uint32_t)); i++) {
+ if (((unsigned int *)stExpConfig.bufferPtr)[i] != 0xdeadbeef) {
status = 1;
printf ("Data integrity failure!\n"
" Expected %s\n"
" Received 0x%x\n",
- "0xdeadbeef", ((unsigned int *)bufferPtr)[i]);
+ "0xdeadbeef", ((unsigned int *)stExpConfig.bufferPtr)[i]);
break;
}
}
if(status != 1)
printf("%s:Test Pass\n",__func__);
/* Validate the returned message. */
- status = MessageQ_free (msg);
+ status = MessageQ_free (msg1);
}
MessageQ_close (&queueId);
return status;
}
+#define printd(fmt, ...) \
+ do { if (debug) fprintf(stderr, fmt, __VA_ARGS__); } while (0)
-int main (int argc, char ** argv)
+int debug=0;
+
+struct config
{
- struct thread_info threads[MAX_NUM_THREADS]={{0}};
- int ret,i, tempnummsg;
- struct timespec start, end;
- long elapsed;
- Int32 status = 0;
- tempnummsg = 0;
-
- bufferPtr = 0;
- bufferPtrRemoteAddr = 0;
-
- /* Parse Args: */
- numMessages = NUM_MESSAGES_DFLT;
- numThreads = NUM_THREADS_DFLT;
- numMsgSize = NUM_MSGSIZE_DFLT;
- procNum = COREPROC1;
- switch (argc) {
- case 1:
- /* use defaults */
- break;
- case 2:
- numThreads = atoi(argv[1]);
- break;
- case 3:
- numThreads = atoi(argv[1]);
- numMessages = atoi(argv[2]);
- break;
- case 4:
- numThreads = atoi(argv[1]);
- numMessages = atoi(argv[2]);
- numMsgSize = atoi(argv[3]);
- break;
- case 5:
- numThreads = atoi(argv[1]);
- numMessages = atoi(argv[2]);
- numMsgSize = atoi(argv[3]);
- procNum = atoi(argv[4]);
- break;
- default:
- printf("Usage: %s [<numThreads>] [<numMessages>] [<numMsgPayloadSize>] [<Proc Id #]>\n",
- argv[0]);
- printf("\tDefaults: numThreads: 4, numMessages: 25200, numMsgSize: 4, IPU Proc Id: 1\n");
- printf("\tMax Threads: 50\n");
- exit(0);
- }
-
- if(numMsgSize & 0x3)
+ int direction;
+ int interval;
+ int msgSize;
+ int msgCount;
+ int procID;
+};
+
+struct config xyz[MAX_NUM_THREADS];/* [TODO]: Remove Hardcode, Assuming for the time being max threads 100*/
+int linecount = 0;
+
+char keylist[5][50] = {
+ "direction",
+ "msgSize",
+ "msgCount",
+ "interval",
+ "procID"
+};
+
+int validatekey(char *ptr)
+{
+ int i;
+ for(i=0; i<5; i++)
+ if(strcmp(ptr, keylist[i]) == 0)
+ return 0;
+
+ return 1;
+}
+
+/*
+direction: 0-Send, 1-Recv
+msgSize: in bytes(Should be 4 bytes aligned)
+msgCount: number of messages to be exchanged
+interval: in microsecs(us)
+procID: core, Hardcoded to IPU2 for the time being
+
+Sample contents of cfg file:");
+
+#Thread 1
+direction=0, msgSize=6400, msgCount=400, interval=2500, procID=1
+#Thread 2
+direction=1, msgSize=640, msgCount=800, interval=2500, procID=1
+
+*/
+#define PRINTEXIT {printusage(); exit(1);}
+
+void printusage() {
+ printf("\n --------------------------------------------");
+ printf("\n INCORRECT USAGE !");
+ printf("\n --------------------------------------------");
+ printf("\n ./MessageQZCpy -f <CFG file path>");
+ printf("\n");
+ printf("\n -f : MANDATORY : Configuration file which contains use-case configurations");
+ printf("\n");
+ printf("\n Sample contents of cfg file:");
+ printf("\n #Thread 1");
+ printf("\n direction=0, msgSize=6400, msgCount=400, interval=2500, procID=1");
+ printf("\n #Thread 2");
+ printf("\n direction=1, msgSize=640, msgCount=800, interval=2500, procID=1");
+ printf("\n");
+}
+
+
+void add_key_value(char *key, int value)
+{
+ if((linecount + 1) < MAX_NUM_THREADS)
{
- printf("each message payload size should be 4bytes aligned\n");
- numMsgSize = NUM_MSGSIZE_DFLT;
+ printd("%s", "Inside add_key_value\n");
+
+ if(strcmp(key, "direction") == 0)
+ xyz[linecount].direction = value;
+ else if(strcmp(key, "interval") == 0)
+ xyz[linecount].interval = value;
+ else if(strcmp(key, "msgSize") == 0)
+ xyz[linecount].msgSize = value;
+ else if(strcmp(key, "msgCount") == 0)
+ xyz[linecount].msgCount = value;
+ else if(strcmp(key, "procID") == 0)
+ xyz[linecount].procID = value;
+ else
+ printd("%s", "********** UNKNOWN**********");
}
-
- printf("Using: %d Threads, Messages: %d, Message Size:%d bytes, Message Payload Size(bytes):%d, ProcId %d\n",
- numThreads,
- numMessages,
- sizeof(RemoteBufSyncMsg),
- numMsgSize,
- procNum);
+ else
+ {
+ printf("Max threads limit(%d) exceeded\n",MAX_NUM_THREADS);
+ exit(1);
+ }
+}
+
+int main (int argc, char ** argv)
+{
+ stProPerfConfig stMQConfig = {0};
+
+ int ret,i, tempOffsetCtr = 0;
+ struct timespec start, end;
+ long elapsed;
+ FILE *fp;
+ char line[512];
+ char tokens[6][512];
+ char path[100];
+ int temp, flag = 0;
+ char *keyvalue, *pair;
+ char key[100];
+
+ Int32 status = 0;
+ int option;
- tempnummsg = numMsgSize * numThreads;
- numMsgSize = tempnummsg;
+
+ /* Initialize this to turn off verbosity of getopt */
+ opterr = 0;
+
+ while ((option = getopt (argc, argv, "f:")) != -1)
+ {
+ switch(option)
+ {
+ case 'f':
+ strcpy(path, optarg);
+ break;
+ default:
+ printf("Invalid option.. Exiting\n");
+ PRINTEXIT
+ }
+ }
+
+ fp = fopen(path, "r");
+ if (fp == NULL) {
+ fprintf(stderr, "couldn't open the specified file\n");
+ PRINTEXIT
+ }
+
+ while (fgets(line, sizeof line, fp)) {
+ printd("Line is = %s", line);
+
+ if (line[0] == '#' || line[0] == '\n') {
+ continue;
+ }
+
+ memset(tokens, 0, sizeof(tokens));
+ i = 0;
+
+ pair = strtok (line," ,");
+ while (pair != NULL)
+ {
+ printd ("\tPair is = %s\n",pair);
+ strcpy(tokens[i++], pair);
+ pair = strtok (NULL, " ,.-");
+ }
+
+ for(temp=0; temp< i; temp++)
+ {
+ printd("Line %d: %s\n", temp, tokens[temp]);
+ keyvalue = strtok (tokens[temp]," =");
+ while (keyvalue != NULL)
+ {
+ if(flag == 0)
+ {
+ if(validatekey(keyvalue))
+ {
+ printf("Invalid key found\n");
+ exit(0);
+ }
+ strcpy(key, keyvalue);
+ printd ("\tKey is = %s\n",key);
+ flag++;
+ }
+ else
+ {
+ printd ("\tValue is = %s",keyvalue);
+ printd (" (%d)\n", atoi(keyvalue));
+ add_key_value(key, atoi(keyvalue));
+ flag = 0;
+ }
+ keyvalue = strtok (NULL, " =");
+ }
+ }
+ linecount++;
+ printd("%s", "------------------- \n");
+ }
+
+
+ fclose(fp);
+
+ stMQConfig.procId = COREPROC1; /* [TODO]: Remove Hardcode, Assuming for the time being same proc for all threads */
+ stMQConfig.numThreads = linecount;
+ stMQConfig.pThrConfig = (thrConfigs *)malloc(stMQConfig.numThreads * sizeof(struct stProPerfConfig));
+
+ for(i = 0; i<stMQConfig.numThreads; i++)
+ {
+ stMQConfig.pThrConfig[i].thread_num = i;
+ stMQConfig.pThrConfig[i].numMessages = xyz[i].msgCount;
+ stMQConfig.pThrConfig[i].numWaitTime = xyz[i].interval;
+ stMQConfig.pThrConfig[i].payloadSize = xyz[i].msgSize;
+ stMQConfig.pThrConfig[i].procId = xyz[i].procID;
+ stMQConfig.pThrConfig[i].config_param = xyz[i].direction;
+
+ printf("Thread [%d] : direction = %d, msgSize = %d, msgCount = %d, interval = %d, procID = %d\n",
+ stMQConfig.pThrConfig[i].thread_num,
+ stMQConfig.pThrConfig[i].config_param,
+ stMQConfig.pThrConfig[i].payloadSize,
+ stMQConfig.pThrConfig[i].numMessages,
+ stMQConfig.pThrConfig[i].numWaitTime,
+ stMQConfig.pThrConfig[i].procId);
+
+ stMQConfig.totalReqPayloadSize += stMQConfig.pThrConfig[i].payloadSize;
+ }
status = Ipc_start();
if (status < 0) {
}
/* setup rpc connection) */
- status = Mx_initialize(procNum);
-
+ status = Mx_initialize(stMQConfig.procId);
if (status < 0) {
printf("Mx_initialize failed: status = 0x%x\n", status);
+ goto exit;
}
/*Use the MMRPC to get a shared space address*/
- ret = callCompute_Linux(&bufferPtr, &bufferPtrRemoteAddr, &bufferPtrSize);
+ ret = callCompute_Linux(&stMQConfig);
if (ret < 0) {
status = -1;
goto leave;
}
- tempnummsg = (numMessages/numThreads);
- numMessages = tempnummsg;/*Num messages to be exchanged per thread*/
-
- /* handshake with remote to set numThreads, numMessages, Message Size */
- MessageQApp_handshake(numThreads,numMessages,numMsgSize,procNum);
+ /* handshake with remote to set numThreads, Message Size,Waittime */
+ MessageQApp_handshake(stMQConfig);
clock_gettime(CLOCK_REALTIME, &start);
/* Launch multiple threads: */
- for (i = 0; i < numThreads; i++) {
- /* Create the test thread: */
- threads[i].thread_num = i;
- threads[i].boBufPayloadPtr = bufferPtrRemoteAddr + (i * numMsgSize/numThreads);
- threads[i].boBufPayloadSize = (bufferPtrSize/numThreads);
- ret = pthread_create(&threads[i].thread_id, NULL, &pingThreadFxn,
- &(threads[i]));
- if (ret) {
- printf("MessageQZeroCpy: can't spawn thread: %d, %s\n",
- i, strerror(ret));
- }
+ for (i = 0; i < stMQConfig.numThreads; i++) {
+ /* Create the test threads as per directions: */
+ stMQConfig.pThrConfig[i].boBufPayloadPtr = stMQConfig.bufferPtrRemoteAddr + tempOffsetCtr;
+ stMQConfig.pThrConfig[i].boBufPayloadSize = stMQConfig.pThrConfig[i].payloadSize;
+ tempOffsetCtr += stMQConfig.pThrConfig[i].payloadSize;
+
+ if(stMQConfig.pThrConfig[i].config_param == unidirectional_send)
+ {
+ ret = pthread_create(&stMQConfig.pThrConfig[i].thread_id, NULL, &pingThreadFxn_uni_send,
+ &(stMQConfig.pThrConfig[i]));
+ if (ret) {
+ printf("MessageQMulti: can't spawn thread: %d, %s\n",
+ i, strerror(ret));
+ }
+#if PRINT_DEBUG
+ printf("Sender Thread:%d Direction:%d bufferPtr = 0x%x, bufferPtrRemoteAddr = 0x%x bufferPtrSize = %d\n",
+ stMQConfig.pThrConfig[i].thread_num,
+ stMQConfig.pThrConfig[i].config_param,
+ stMQConfig.bufferPtr,
+ stMQConfig.pThrConfig[i].boBufPayloadPtr,
+ stMQConfig.pThrConfig[i].boBufPayloadSize);
+#endif
+ }
+ else if(stMQConfig.pThrConfig[i].config_param == unidirectional_recv)
+ {
+ ret = pthread_create(&stMQConfig.pThrConfig[i].thread_id, NULL, &pingThreadFxn_uni_recv,
+ &(stMQConfig.pThrConfig[i]));
+ if (ret) {
+ printf("MessageQMulti: can't spawn thread: %d, %s\n",
+ i, strerror(ret));
+ }
#if PRINT_DEBUG
- printf("thread:%d bufferPtr = 0x%x, bufferPtrRemoteAddr = 0x%x bufferPtrSize = %d\n",
- i,
- bufferPtr,
- threads[i].boBufPayloadPtr,
- threads[i].boBufPayloadSize);
+ printf("Receiver Thread:%d Direction:%d bufferPtr = 0x%x, bufferPtrRemoteAddr = 0x%x bufferPtrSize = %d\n",
+ stMQConfig.pThrConfig[i].thread_num,
+ stMQConfig.pThrConfig[i].config_param,
+ stMQConfig.bufferPtr,
+ stMQConfig.pThrConfig[i].boBufPayloadPtr,
+ stMQConfig.pThrConfig[i].boBufPayloadSize);
+
#endif
+ }
}
/* Join all threads: */
- for (i = 0; i < numThreads; i++) {
- ret = pthread_join(threads[i].thread_id, NULL);
+ for (i = 0; i < stMQConfig.numThreads; i++) {
+ ret = pthread_join(stMQConfig.pThrConfig[i].thread_id, NULL);
if (ret != 0) {
- printf("MessageQZeroCpy: failed to join thread: %d, %s\n",
+ printf("MessageQMulti: failed to join thread: %d, %s\n",
i, strerror(ret));
}
#if PRINT_DEBUG
- printf("MessageQZeroCpy: Joined with thread %d\n",threads[i].thread_num);
+ printf("MessageQMulti: Joined with thread %d\n",stMQConfig.pThrConfig[i].thread_num);
#endif
}
clock_gettime(CLOCK_REALTIME, &end);
elapsed = diff(start, end);
- printf("This run took a total return time of %ld msecs to transport totally about \n %d Messages each containing %d bytes of data across %d threads\n",
- (elapsed/1000),
- (numMessages*numThreads),
- (numMsgSize/numThreads),
- numThreads);
+ printf("This use-case run took a total time of %ld msecs to transport totally\n",
+ (elapsed/1000));
/*** Data Transaction Prototype Function***/
/* Create the test thread: */
- ret = dataTransactFxn();
+ ret = dataTransactFxn(stMQConfig);
if (ret) {
- printf("MessageQZeroCpy: can't spawn thread: %d, %s\n",
+ printf("MessageQMulti: can't spawn thread: %d, %s\n",
0, strerror(ret));
}
-
+
leave:
+ free(stMQConfig.pThrConfig);
+ stMQConfig.pThrConfig = NULL;
+
status = Mx_compute_Release();
if (status < 0) {
printf("mmrpc_test: Error: MmRpc_release failed\n");