summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc69352)
raw | patch | inline | side by side (parent: bc69352)
author | Pragat Chaudhari <pragatc@ti.com> | |
Tue, 26 Aug 2014 14:56:30 +0000 (10:56 -0400) | ||
committer | Pragat Chaudhari <pragatc@ti.com> | |
Tue, 26 Aug 2014 14:56:30 +0000 (10:56 -0400) |
K2X builds.
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt
index 56cebdec7ad89a947116f0182ab599781304b7c7..491a1511128378f8f4d9609b4460e5b02f377f7c 100644 (file)
--- a/Settings.xdc.xdt
+++ b/Settings.xdc.xdt
module Settings\r
{\r
config string tcp3dVersionString = `packageVersion`;\r
+ /*! This variable is to control the device type selection.\r
+ * By default this variable is set to NULL.\r
+ * \r
+ * To use TCP3D for the selected device, add the following lines to config\r
+ * file and set the deviceType correctly:\r
+ * \r
+ * var tcp3d = xdc.useModule ('ti.drv.tcp3d.Settings');\r
+ * tcp3d.deviceType = "k2k";\r
+ */\r
+ metaonly config string deviceType = "k2k";\r
}\r
\r
diff --git a/build/buildlib.xs b/build/buildlib.xs
index b90358e3f58861855d9802cbcd60dc8628f83e7c..773eed8514acee259faa6d375dfa782e864d3040 100644 (file)
--- a/build/buildlib.xs
+++ b/build/buildlib.xs
* This file contains common routines that are used by the various TCP3D driver \r
* components.\r
*\r
- * Copyright (C) 2011, Texas Instruments, Inc.\r
+ * Copyright (C) 2011-2014, Texas Instruments, Inc.\r
*****************************************************************************/\r
\r
/**************************************************************************\r
{ \r
var srcFile = [];\r
var d;\r
- \r
+\r
/* If recurse parameter is not specified we default to recursive search. */\r
if (recurse == null)\r
recurse = true;\r
- \r
+\r
if (dir == undefined) \r
d = ".";\r
else \r
d = dir;\r
- \r
+\r
/* Get access to the current directory. */\r
var file = new java.io.File(d);\r
- \r
+\r
/* Check if the file exists and it is a directory. */\r
if (file.exists() && file.isDirectory()) \r
{\r
{\r
/* Generate the directory Name in which we will recurse. */ \r
var directoryName = d + "/" + fileList[i].getName();\r
- \r
+\r
/* Get a list of all files in this directory */\r
var fileListing = listAllFiles (ext, directoryName, recurse);\r
if (fileListing != null)\r
makefile.writeLine("\n# Clean Rule"); \r
makefile.writeLine("clean:: clean_package"); \r
makefile.writeLine("# Clean Top Level Object Directory "); \r
- makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/"); \r
+ makefile.writeLine("clean_package:")\r
+ for each (var libdir in devices)\r
+ { \r
+ makefile.writeLine("\t$(RMDIR) $(LIBDIR)/"+libdir.toString()+"/*/"); \r
+ } \r
makefile.writeLine("\t$(RMDIR) package/cfg"); \r
}\r
else\r
return makefile;\r
}\r
\r
-function createLibMake(makelibname,targetname, objectPath)\r
+function createLibMake(device, makelibname,targetname, objectPath)\r
{\r
var tooldir;\r
var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)","");\r
/* libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -Dxdc_target_types__=ti/targets/std.h -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");*/\r
libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep");\r
libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map");\r
- libmakefile.writeLine("OBJDIR = $(LIBDIR)/obj"); \r
+ libmakefile.writeLine("OBJDIR = $(LIBDIR)/" + device.toString() + "/obj");\r
+ libmakefile.writeLine("DEVOBJDIR = $(LIBDIR)/" + device.toString() + "/obj");\r
\r
return libmakefile;\r
\r
}\r
\r
-function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName)\r
+function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir)\r
{\r
var sourcestring = (srcString + fileExt).toString().toUpperCase();\r
var compileflagstring = sourcestring + "FLAGS";\r
@@ -332,8 +337,8 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
makefilename.writeLine(compileflagstring+" = "+compileflags +" \n"); \r
makefilename.writeLine("# Make Rule for the "+srcString+" Files"); \r
\r
- makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", $(OBJDIR)/%.$(OBJEXT), $(" + sourcestring + "))"); \r
- makefilename.writeLine("\n$("+objectliststring+"): $(OBJDIR)/%.$(OBJEXT): %."+fileExt); \r
+ makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))"); \r
+ makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt); \r
if(fileExt == "c")\r
{ \r
makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ..."); \r
@@ -378,11 +383,11 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target
* Utility function which will build a specific library\r
**************************************************************************/\r
var makefilelocal;\r
-function buildLibrary (libOptions, libName, target, libFiles) \r
+function buildLibrary (device, libOptions, libName, target, libFiles) \r
{\r
- var lldFullLibraryPath = "./lib/c66/" + libName;\r
- var lldFullBuildPath = "./build/c66/" + libName;\r
- var lldFullLibraryPathMake = "$(LIBDIR)/" + "c66/" + libName;\r
+ var lldFullLibraryPath = "./lib/" + device.toString() + "/" + libName;\r
+ var lldFullBuildPath = "./build/" + device.toString() + "/" + libName;\r
+ var lldFullLibraryPathMake = "$(LIBDIR)/" + device.toString() + "/" + libName;\r
\r
/* Create Main make file in the root of package folder */\r
makefilelocal = createMake(makefilelocal);\r
makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@"); \r
\r
/* Create Library make file in the lib folder */\r
- var makefilelib= createLibMake(lib+".mk",target,objectPath); \r
+ var makefilelib= createLibMake(device, lib+".mk",target,objectPath); \r
\r
/* Rule to clean library in main makefile */\r
makefilelocal.writeLine("# Rule to clean "+libMake+" library"); \r
}\r
if(cfiles.length > 0)\r
{ \r
- makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target);\r
+ makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)");\r
librule += " $(COMMONSRCCOBJS)"; \r
}\r
if(afiles.length > 0)\r
{ \r
- makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target);\r
+ makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)");\r
librule += " $(COMMONSRCASMOBJS)"; \r
}\r
if(safiles.length > 0)\r
{ \r
- makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target);\r
+ makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)");\r
librule += " $(COMMONSRCSAOBJS)"; \r
}\r
\r
makefilelib.writeLine(librule);\r
- makefilelib.writeLine("\t@echo archiving $? into $@ ..."); \r
- makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/c66 ]; then $(MKDIR) $(LIBDIR)/c66 ; fi;"); \r
+ makefilelib.writeLine("\t@echo archiving $? into $@ ...");\r
+ makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/" + device.toString() + " ]; then $(MKDIR) $(LIBDIR)/" + device.toString() + " ; fi;"); \r
makefilelib.writeLine("\t$(ARIN) $@ $?");\r
makefilelib.close(); \r
- \r
+\r
/* Create the Epilogue; which executes after all the builds are completed. \r
* This is used to generate the benchmark information for the built library. \r
* Also add the benchmarking information file to the package. */\r
- Pkg.makeEpilogue += ".libraries: benchmarking_" + target.suffix + "\n";\r
- Pkg.makeEpilogue += "benchmarking_" + target.suffix + ":";\r
- Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml";\r
- Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt";\r
- Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n";\r
+\r
+ /* Put the temp file in object directory since javascript doesn't have a built in tmpname, \r
+ * and don't want --jobs=# with # > 1 to result in collisions */\r
+ var tempFile = "$(LIBDIR)/" + device.toString() + "/obj/tmp_" + target.suffix + ".xml";\r
+ Pkg.makeEpilogue += ".libraries: benchmarking_" + device + "_" + target.suffix + "\n";\r
+ Pkg.makeEpilogue += "benchmarking_" + device + "_" + target.suffix + ":";\r
+ Pkg.makeEpilogue += "\n\t ofd6x -x " + lldFullLibraryPath + ".a" + target.suffix + " > " + tempFile;\r
+ Pkg.makeEpilogue += "\n\t sectti " + tempFile + " > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt";\r
+ Pkg.makeEpilogue += "\n\t $(RM) " + tempFile + "\n\n";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix + "_size.txt";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullBuildPath + ".a" + target.suffix + ".mk";\r
Pkg.otherFiles[Pkg.otherFiles.length++] = lldFullLibraryPath + ".a" + target.suffix;\r
/* We need to clean after ourselves; extend the 'clean' target to take care of this. */\r
Pkg.makeEpilogue += "clean::\n";\r
Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; \r
- // Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + ".mk\n";\r
- Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + "c66/ \n\n";\r
+ Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + device.toString() + " \n\n";\r
\r
return lib;\r
}\r
Pkg.makeEpilogue += "clean::\n";\r
Pkg.makeEpilogue += "\t $(RM) packages/" + pkgName + "_mini.tar\n";\r
}\r
+\r
diff --git a/config.bld b/config.bld
index 14346383627a79872a178168dd369f495729d612..9243e0f10a62d05455edaa516f5d34673ec782f7 100755 (executable)
--- a/config.bld
+++ b/config.bld
},\r
];\r
\r
- /* Run the coverity filters on the LE Build only. */\r
+ /* Run the coverity filters on the C66 LE ELF Build only. */\r
C66LE.profiles["release"].filters = coverityFilter;\r
}\r
\r
\r
/* List all the build targets here. */\r
Build.targets = [ C66LE, C66BE ];\r
+\r
+/* List of all devices that combine to make the hyplnk library.\r
+ */\r
+var devices = [ "k2k/c66", "k2h/c66", "k2l/c66" ];\r
+\r
+/* order must exactly match list in "var devices" */\r
+var devicesCCOpt = [ " -DDEVICE_K2K", " -DDEVICE_K2H", " -DDEVICE_K2L" ];\r
+\r
index c026bbef19d4bc31c0ef23c945803674a974b085..e19671f2a02f7d7daf50d2ef33f20cba7fb3b12c 100755 (executable)
\r
/* Load the TCP3D package */\r
var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');\r
+Tcp3d.deviceType = "k2h";\r
\r
/* Load the CSL package */\r
var Csl = xdc.useModule('ti.csl.Settings');\r
index 8db8b7503aeb99c2176c850f51d98683be0f4839..48e2e7b06c2917dab8703a53e84a78e30bf8fde4 100755 (executable)
\r
/* Load the TCP3D package */\r
var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');\r
+Tcp3d.deviceType = "k2k";\r
\r
/* Load the CSL package */\r
var Csl = xdc.useModule('ti.csl.Settings');\r
index 1e135991786d377dca3a7ec7f4f43235c75baf18..e823befa269930fcd2b430d04c8eea30a8b36c5d 100644 (file)
/* Load the TCP3D package */
var Tcp3d = xdc.useModule('ti.drv.tcp3d.Settings');
+Tcp3d.deviceType = "k2l";
/* Load the CSL package */
var Csl = xdc.useModule('ti.csl.Settings');
diff --git a/package.xdc b/package.xdc
index 5b7f308b04f62fffb7c74e8576d5269d3e614f88..713d4ac865028da76e7994745baff0ee0ef4a87e 100755 (executable)
--- a/package.xdc
+++ b/package.xdc
* DESCRIPTION: \r
* This file contains the package specification for the TCP3D Driver\r
*\r
- * Copyright (C) 2012, Texas Instruments, Inc.\r
+ * Copyright (C) 2012, 2014, Texas Instruments, Inc.\r
*****************************************************************************/\r
\r
-package ti.drv.tcp3d[2, 01, 00, 00] {\r
+package ti.drv.tcp3d[2, 01, 00, 01] {\r
module Settings;\r
}\r
\r
diff --git a/package.xs b/package.xs
index 37b1ffcf83c33839055f33b72e9c23a9c7fac7ad..3807f3cead75d02d3644ced434a93cdc66de3464 100644 (file)
--- a/package.xs
+++ b/package.xs
print ("\tSystem environment LIBDIR variable defined : " + lib);\r
}\r
\r
+ /* Device types supported */\r
+ var deviceTypes = [\r
+ 'k2k',\r
+ 'k2h',\r
+ 'k2l',\r
+ ];\r
+ \r
+ /* Search for the supported devices (defined in config.bld) */\r
+ for each(var device in deviceTypes)\r
+ {\r
+ if (this.Settings.deviceType.equals(device))\r
+ {\r
+ lib = lib + "/" + device;\r
+ break;\r
+ }\r
+ }\r
+\r
/* Get target folder, if applicable */\r
if ( java.lang.String(suffix).contains('66') )\r
lib = lib + "/c66";\r
/* Get library name with path */\r
lib = lib + "/" + name;\r
if (java.io.File(this.packageBase + lib).exists()) {\r
+ print ("\tLinking with library " + this.$name + ":" + lib);\r
return lib;\r
}\r
\r
diff --git a/src/Module.xs b/src/Module.xs
index 14fd941206ee0d5dfb95e25d5b55d01fce296aee..d42f0c8bb1575abcc3e119c21d4caa2a904d396f 100755 (executable)
--- a/src/Module.xs
+++ b/src/Module.xs
"src/tcp3d_betaState.c",\r
];\r
\r
-var devicesCCOpt = [ " -DDEVICE_K2K" ];\r
-\r
/* Other files for packaging */\r
var tcp3dOtherFiles = [\r
"src/tcp3d_drv_priv.h",\r
**************************************************************************/\r
function modBuild() \r
{\r
- /* Build the libraries for all the targets specified. */\r
- for (var targets=0; targets < Build.targets.length; targets++)\r
+ for (var device=0; device < devices.length; device++) \r
{\r
- var libOptions = { \r
- incs: tcp3dIncludePath, \r
- copts: devicesCCOpt,\r
- };\r
+ /* Build the libraries for all the targets specified. */\r
+ for (var targets=0; targets < Build.targets.length; targets++)\r
+ {\r
+ var libOptions = { \r
+ incs: tcp3dIncludePath, \r
+ copts: devicesCCOpt[device],\r
+ };\r
\r
- libUtility.buildLibrary (libOptions, Pkg.name, Build.targets[targets], tcp3dLibFiles);\r
+ libUtility.buildLibrary (devices[device], libOptions, Pkg.name, Build.targets[targets], tcp3dLibFiles);\r
+ }\r
}\r
\r
/* Add all the .c files to the release package. */\r
diff --git a/test/Module.xs b/test/Module.xs
index eea6e4d27f7a524df0709932bf56f126faf58ae5..10a17ab889f25606587b461b211c24d61108ade0 100644 (file)
--- a/test/Module.xs
+++ b/test/Module.xs
function modBuild() \r
{\r
/* Add all the .c files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".c", "test");\r
+ var testFiles = libUtility.listAllFiles (".c", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
/* Add all the .h files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".h", "test");\r
+ var testFiles = libUtility.listAllFiles (".h", "test", true);\r
+ for (var k = 0 ; k < testFiles.length; k++)\r
+ Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
+\r
+ /* Add all the make files to the release package. */\r
+ var testFiles = libUtility.listAllFiles ("makefile", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
/* Add all the .cfg files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".cfg", "test");\r
+ var testFiles = libUtility.listAllFiles (".cfg", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
/* Add all the .cmd files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".cmd", "test");\r
+ var testFiles = libUtility.listAllFiles (".cmd", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
/* Add all the .txt files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".txt", "test");\r
+ var testFiles = libUtility.listAllFiles (".txt", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
/* Add all the .ini files to the release package. */\r
- var testFiles = libUtility.listAllFiles (".ini", "test");\r
+ var testFiles = libUtility.listAllFiles (".ini", "test", true);\r
for (var k = 0 ; k < testFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = testFiles[k];\r
\r
for (var k = 0 ; k < otherFiles.length; k++)\r
Pkg.otherFiles[Pkg.otherFiles.length++] = otherFiles[k];\r
}\r
+\r