diff options
author | Eric Ruei | 2014-05-06 17:00:13 -0500 |
---|---|---|
committer | Eric Ruei | 2014-05-06 17:00:13 -0500 |
commit | 75a2d15f7d1269707477803e026710f18421f812 (patch) | |
tree | c3573b7449d79981e26305fe9b395864480405ae | |
parent | 5f54567f40809c2c634191401981ce7641f3c982 (diff) | |
download | pcie-lld-75a2d15f7d1269707477803e026710f18421f812.tar.gz pcie-lld-75a2d15f7d1269707477803e026710f18421f812.tar.xz pcie-lld-75a2d15f7d1269707477803e026710f18421f812.zip |
build device-specific librariesDEV.PCIE_LLD.02.01.00.01
-rwxr-xr-x | Settings.xdc.xdt | 17 | ||||
-rwxr-xr-x | build/buildlib.xs | 53 | ||||
-rwxr-xr-x | config.bld | 13 | ||||
-rwxr-xr-x | docs/ReleaseNotes_PCIE_LLD.doc | bin | 210944 -> 210432 bytes | |||
-rwxr-xr-x | docs/ReleaseNotes_PCIE_LLD.pdf | bin | 286761 -> 308985 bytes | |||
-rwxr-xr-x | package.xdc | 4 | ||||
-rwxr-xr-x | package.xs | 19 | ||||
-rwxr-xr-x | src/Module.xs | 29 |
8 files changed, 101 insertions, 34 deletions
diff --git a/Settings.xdc.xdt b/Settings.xdc.xdt index f7816f9..8f13c29 100755 --- a/Settings.xdc.xdt +++ b/Settings.xdc.xdt | |||
@@ -19,6 +19,23 @@ | |||
19 | 19 | ||
20 | module Settings | 20 | module Settings |
21 | { | 21 | { |
22 | /*! This is the PCIE Version */ | ||
22 | config string pcielldVersionString = `packageVersion`; | 23 | config string pcielldVersionString = `packageVersion`; |
24 | |||
25 | /*! This variable is to control the device type selection. | ||
26 | * By default this variable is set to NULL. | ||
27 | * | ||
28 | * To use PCIE for the selected device, add the following lines to config | ||
29 | * file and set the deviceType correctly: | ||
30 | * | ||
31 | * var pcie = xdc.useModule ('ti.drv.pcie.Settings'); | ||
32 | * pcie.deviceType = "k2k"; | ||
33 | * | ||
34 | * If this is not set, then hyperlink will use device independent | ||
35 | * library where user must supply compiled pcie_device.obj | ||
36 | */ | ||
37 | metaonly config string deviceType = ""; | ||
23 | } | 38 | } |
24 | 39 | ||
40 | |||
41 | |||
diff --git a/build/buildlib.xs b/build/buildlib.xs index 8125706..bd1c085 100755 --- a/build/buildlib.xs +++ b/build/buildlib.xs | |||
@@ -4,10 +4,10 @@ | |||
4 | * FILE NAME: buildlib.xs | 4 | * FILE NAME: buildlib.xs |
5 | * | 5 | * |
6 | * DESCRIPTION: | 6 | * DESCRIPTION: |
7 | * This file contains common routines that are used by the various QMSS | 7 | * This file contains common routines that are used by the various PCIE |
8 | * components. | 8 | * components. |
9 | * | 9 | * |
10 | * Copyright (C) 2011, Texas Instruments, Inc. | 10 | * Copyright (C) 2011-2014, Texas Instruments, Inc. |
11 | *****************************************************************************/ | 11 | *****************************************************************************/ |
12 | 12 | ||
13 | /************************************************************************** | 13 | /************************************************************************** |
@@ -194,7 +194,11 @@ function createMake(makefile) | |||
194 | makefile.writeLine("\n# Clean Rule"); | 194 | makefile.writeLine("\n# Clean Rule"); |
195 | makefile.writeLine("clean:: clean_package"); | 195 | makefile.writeLine("clean:: clean_package"); |
196 | makefile.writeLine("# Clean Top Level Object Directory "); | 196 | makefile.writeLine("# Clean Top Level Object Directory "); |
197 | makefile.writeLine("clean_package :\n\t$(RMDIR) $(LIBDIR)/*/"); | 197 | makefile.writeLine("clean_package:") |
198 | for each (var libdir in devices) | ||
199 | { | ||
200 | makefile.writeLine("\t$(RMDIR) $(LIBDIR)/"+libdir.toString()+"/*/"); | ||
201 | } | ||
198 | makefile.writeLine("\t$(RMDIR) package/cfg"); | 202 | makefile.writeLine("\t$(RMDIR) package/cfg"); |
199 | } | 203 | } |
200 | else | 204 | else |
@@ -212,7 +216,7 @@ function createMake(makefile) | |||
212 | return makefile; | 216 | return makefile; |
213 | } | 217 | } |
214 | 218 | ||
215 | function createLibMake(makelibname,targetname, objectPath) | 219 | function createLibMake(device, makelibname,targetname, objectPath) |
216 | { | 220 | { |
217 | var tooldir; | 221 | var tooldir; |
218 | var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)",""); | 222 | var stringname=String(targetname).replace("(xdc.bld.ITarget.Module)",""); |
@@ -261,7 +265,7 @@ function createLibMake(makelibname,targetname, objectPath) | |||
261 | libmakefile.writeLine("#"); | 265 | libmakefile.writeLine("#"); |
262 | libmakefile.writeLine("empty ="); | 266 | libmakefile.writeLine("empty ="); |
263 | libmakefile.writeLine("space =$(empty) $(empty)"); | 267 | libmakefile.writeLine("space =$(empty) $(empty)"); |
264 | 268 | ||
265 | if(stringname.match("ti.targets")) | 269 | if(stringname.match("ti.targets")) |
266 | { | 270 | { |
267 | 271 | ||
@@ -287,20 +291,21 @@ function createLibMake(makelibname,targetname, objectPath) | |||
287 | java.lang.System.exit(1); | 291 | java.lang.System.exit(1); |
288 | 292 | ||
289 | } | 293 | } |
290 | 294 | ||
291 | libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR))))"); | 295 | libmakefile.writeLine("INCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\\$(space),$(INCDIR))))"); |
292 | libmakefile.writeLine("OBJEXT = o"+targetname.suffix); | 296 | libmakefile.writeLine("OBJEXT = o"+targetname.suffix); |
293 | libmakefile.writeLine("AOBJEXT = s"+targetname.suffix); | 297 | libmakefile.writeLine("AOBJEXT = s"+targetname.suffix); |
294 | /* 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");*/ | 298 | /* 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");*/ |
295 | libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep"); | 299 | libmakefile.writeLine("INTERNALDEFS = -D"+stringname.replace(/\./g,"_")+" -DMAKEFILE_BUILD -eo.$(OBJEXT) -ea.$(AOBJEXT) -fr=$(@D) -fs=$(@D) -ppa -ppd=$@.dep"); |
296 | libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map"); | 300 | libmakefile.writeLine("INTERNALLINKDEFS = -o $@ -m $@.map"); |
297 | libmakefile.writeLine("OBJDIR = $(LIBDIR)/obj"); | 301 | libmakefile.writeLine("OBJDIR = $(LIBDIR)/" + device.toString() + "/obj"); |
302 | libmakefile.writeLine("DEVOBJDIR = $(LIBDIR)/" + device.toString() + "/obj"); | ||
298 | 303 | ||
299 | return libmakefile; | 304 | return libmakefile; |
300 | 305 | ||
301 | } | 306 | } |
302 | 307 | ||
303 | function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName) | 308 | function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, targetName, objDir) |
304 | { | 309 | { |
305 | var sourcestring = (srcString + fileExt).toString().toUpperCase(); | 310 | var sourcestring = (srcString + fileExt).toString().toUpperCase(); |
306 | var compileflagstring = sourcestring + "FLAGS"; | 311 | var compileflagstring = sourcestring + "FLAGS"; |
@@ -335,8 +340,8 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target | |||
335 | makefilename.writeLine(compileflagstring+" = "+compileflags +" \n"); | 340 | makefilename.writeLine(compileflagstring+" = "+compileflags +" \n"); |
336 | makefilename.writeLine("# Make Rule for the "+srcString+" Files"); | 341 | makefilename.writeLine("# Make Rule for the "+srcString+" Files"); |
337 | 342 | ||
338 | makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", $(OBJDIR)/%.$(OBJEXT), $(" + sourcestring + "))"); | 343 | makefilename.writeLine(objectliststring +" = $(patsubst %."+fileExt+", "+objDir+"/%.$(OBJEXT), $(" + sourcestring + "))"); |
339 | makefilename.writeLine("\n$("+objectliststring+"): $(OBJDIR)/%.$(OBJEXT): %."+fileExt); | 344 | makefilename.writeLine("\n$("+objectliststring+"): "+objDir+"/%.$(OBJEXT): %."+fileExt); |
340 | if(fileExt == "c") | 345 | if(fileExt == "c") |
341 | { | 346 | { |
342 | makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ..."); | 347 | makefilename.writeLine("\t-@echo cl"+targetName.suffix +" $< ..."); |
@@ -381,11 +386,11 @@ function makeAddObjects(srcString, makefilename, srcfiles, flags,fileExt, target | |||
381 | * Utility function which will build a specific library | 386 | * Utility function which will build a specific library |
382 | **************************************************************************/ | 387 | **************************************************************************/ |
383 | var makefilelocal; | 388 | var makefilelocal; |
384 | function buildLibrary (libOptions, libName, target, libFiles) | 389 | function buildLibrary (device, libOptions, libName, target, libFiles) |
385 | { | 390 | { |
386 | var lldFullLibraryPath = "./lib/c66/" + libName; | 391 | var lldFullLibraryPath = "./lib/" + device.toString() + "/" + libName; |
387 | var lldFullBuildPath = "./build/c66/" + libName; | 392 | var lldFullBuildPath = "./build/" + device.toString() + "/" + libName; |
388 | var lldFullLibraryPathMake = "$(LIBDIR)/" + "c66/" + libName; | 393 | var lldFullLibraryPathMake = "$(LIBDIR)/" + device.toString() + "/" + libName; |
389 | 394 | ||
390 | /* Create Main make file in the root of package folder */ | 395 | /* Create Main make file in the root of package folder */ |
391 | makefilelocal = createMake(makefilelocal); | 396 | makefilelocal = createMake(makefilelocal); |
@@ -399,7 +404,7 @@ function buildLibrary (libOptions, libName, target, libFiles) | |||
399 | makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@"); | 404 | makefilelocal.writeLine(libMake+": FORCE\n\t$(MAKE) -f "+lib+".mk $@"); |
400 | 405 | ||
401 | /* Create Library make file in the lib folder */ | 406 | /* Create Library make file in the lib folder */ |
402 | var makefilelib= createLibMake(lib+".mk",target,objectPath); | 407 | var makefilelib= createLibMake(device, lib+".mk",target,objectPath); |
403 | 408 | ||
404 | /* Rule to clean library in main makefile */ | 409 | /* Rule to clean library in main makefile */ |
405 | makefilelocal.writeLine("# Rule to clean "+libMake+" library"); | 410 | makefilelocal.writeLine("# Rule to clean "+libMake+" library"); |
@@ -436,31 +441,31 @@ function buildLibrary (libOptions, libName, target, libFiles) | |||
436 | } | 441 | } |
437 | if(cfiles.length > 0) | 442 | if(cfiles.length > 0) |
438 | { | 443 | { |
439 | makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target); | 444 | makeAddObjects("COMMONSRC",makefilelib,cfiles,libOptions,"c",target, "$(OBJDIR)"); |
440 | librule += " $(COMMONSRCCOBJS)"; | 445 | librule += " $(COMMONSRCCOBJS)"; |
441 | } | 446 | } |
442 | if(afiles.length > 0) | 447 | if(afiles.length > 0) |
443 | { | 448 | { |
444 | makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target); | 449 | makeAddObjects("COMMONSRC",makefilelib,afiles,libOptions,"asm",target, "$(OBJDIR)"); |
445 | librule += " $(COMMONSRCASMOBJS)"; | 450 | librule += " $(COMMONSRCASMOBJS)"; |
446 | } | 451 | } |
447 | if(safiles.length > 0) | 452 | if(safiles.length > 0) |
448 | { | 453 | { |
449 | makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target); | 454 | makeAddObjects("COMMONSRC",makefilelib,safiles,libOptions,"sa",target, "$(OBJDIR)"); |
450 | librule += " $(COMMONSRCSAOBJS)"; | 455 | librule += " $(COMMONSRCSAOBJS)"; |
451 | } | 456 | } |
452 | 457 | ||
453 | makefilelib.writeLine(librule); | 458 | makefilelib.writeLine(librule); |
454 | makefilelib.writeLine("\t@echo archiving $? into $@ ..."); | 459 | makefilelib.writeLine("\t@echo archiving $? into $@ ..."); |
455 | makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/c66 ]; then $(MKDIR) $(LIBDIR)/c66 ; fi;"); | 460 | makefilelib.writeLine("\tif [ ! -d $(LIBDIR)/" + device.toString() + " ]; then $(MKDIR) $(LIBDIR)/" + device.toString() + " ; fi;"); |
456 | makefilelib.writeLine("\t$(ARIN) $@ $?"); | 461 | makefilelib.writeLine("\t$(ARIN) $@ $?"); |
457 | makefilelib.close(); | 462 | makefilelib.close(); |
458 | 463 | ||
459 | /* Create the Epilogue; which executes after all the builds are completed. | 464 | /* Create the Epilogue; which executes after all the builds are completed. |
460 | * This is used to generate the benchmark information for the built library. | 465 | * This is used to generate the benchmark information for the built library. |
461 | * Also add the benchmarking information file to the package. */ | 466 | * Also add the benchmarking information file to the package. */ |
462 | Pkg.makeEpilogue += ".libraries: benchmarking_" + target.suffix + "\n"; | 467 | Pkg.makeEpilogue += ".libraries: benchmarking_" + device + "_" + target.suffix + "\n"; |
463 | Pkg.makeEpilogue += "benchmarking_" + target.suffix + ":"; | 468 | Pkg.makeEpilogue += "benchmarking_" + device + "_" + target.suffix + ":"; |
464 | Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml"; | 469 | Pkg.makeEpilogue += "\n\t ofd6x.exe -x " + lldFullLibraryPath + ".a" + target.suffix + " > tmp.xml"; |
465 | Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt"; | 470 | Pkg.makeEpilogue += "\n\t sectti.exe tmp.xml > " + lldFullLibraryPath + ".a" + target.suffix + "_size.txt"; |
466 | Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n"; | 471 | Pkg.makeEpilogue += "\n\t $(RM) tmp.xml\n\n"; |
@@ -471,7 +476,7 @@ function buildLibrary (libOptions, libName, target, libFiles) | |||
471 | /* We need to clean after ourselves; extend the 'clean' target to take care of this. */ | 476 | /* We need to clean after ourselves; extend the 'clean' target to take care of this. */ |
472 | Pkg.makeEpilogue += "clean::\n"; | 477 | Pkg.makeEpilogue += "clean::\n"; |
473 | Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; | 478 | Pkg.makeEpilogue += "\t$(RM) " + lldFullBuildPath + ".a" + target.suffix + "_size.txt\n"; |
474 | Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + "c66/ \n\n"; | 479 | Pkg.makeEpilogue += "\t$(RMDIR) " + "$(LIBDIR)/" + device.toString() + " \n\n"; |
475 | 480 | ||
476 | return lib; | 481 | return lib; |
477 | } | 482 | } |
@@ -106,3 +106,16 @@ if (miniBuild == "ON") | |||
106 | /* List all the build targets here. */ | 106 | /* List all the build targets here. */ |
107 | Build.targets = [ C66LE, C66BE ]; | 107 | Build.targets = [ C66LE, C66BE ]; |
108 | 108 | ||
109 | /* List of all devices that combine to make the hyplnk library. | ||
110 | */ | ||
111 | var devices = [ "c66", "k2k/c66", "k2h/c66", | ||
112 | "k2l/c66", "k2e/c66" ]; | ||
113 | |||
114 | /* order must exactly match list in "var devices" */ | ||
115 | var devicesCCOpt = [ "", " -DDEVICE_K2K", " -DDEVICE_K2H", | ||
116 | " -DDEVICE_K2L", " -DDEVICE_K2E" ]; | ||
117 | |||
118 | /* device name (k2?) is inserted between first an second element of this | ||
119 | list to construct device file name for each device */ | ||
120 | var deviceConstruct = [ "device/", "/src/pcie_device.c" ]; | ||
121 | |||
diff --git a/docs/ReleaseNotes_PCIE_LLD.doc b/docs/ReleaseNotes_PCIE_LLD.doc index 4344861..16edd38 100755 --- a/docs/ReleaseNotes_PCIE_LLD.doc +++ b/docs/ReleaseNotes_PCIE_LLD.doc | |||
Binary files differ | |||
diff --git a/docs/ReleaseNotes_PCIE_LLD.pdf b/docs/ReleaseNotes_PCIE_LLD.pdf index aaa1f77..dab9079 100755 --- a/docs/ReleaseNotes_PCIE_LLD.pdf +++ b/docs/ReleaseNotes_PCIE_LLD.pdf | |||
Binary files differ | |||
diff --git a/package.xdc b/package.xdc index d9d372c..7577b2b 100755 --- a/package.xdc +++ b/package.xdc | |||
@@ -6,10 +6,10 @@ | |||
6 | * DESCRIPTION: | 6 | * DESCRIPTION: |
7 | * This file contains the package specification for the PCIE LLD library | 7 | * This file contains the package specification for the PCIE LLD library |
8 | * | 8 | * |
9 | * Copyright (C) 2012-2013, Texas Instruments, Inc. | 9 | * Copyright (C) 2012-2014, Texas Instruments, Inc. |
10 | *****************************************************************************/ | 10 | *****************************************************************************/ |
11 | 11 | ||
12 | package ti.drv.pcie[02, 01, 00, 00] { | 12 | package ti.drv.pcie[02, 01, 00, 01] { |
13 | module Settings; | 13 | module Settings; |
14 | } | 14 | } |
15 | 15 | ||
@@ -28,6 +28,24 @@ function getLibs(prog) | |||
28 | print ("\tSystem environment LIBDIR variable defined : " + lib); | 28 | print ("\tSystem environment LIBDIR variable defined : " + lib); |
29 | } | 29 | } |
30 | 30 | ||
31 | /* Device types supported */ | ||
32 | var deviceTypes = [ | ||
33 | 'k2k', | ||
34 | 'k2h', | ||
35 | 'k2l', | ||
36 | 'k2e', | ||
37 | ]; | ||
38 | |||
39 | /* Search for the supported devices (defined in config.bld) */ | ||
40 | for each(var device in deviceTypes) | ||
41 | { | ||
42 | if (this.Settings.deviceType.equals(device)) | ||
43 | { | ||
44 | lib = lib + "/" + device; | ||
45 | break; | ||
46 | } | ||
47 | } | ||
48 | |||
31 | /* Get target folder, if applicable */ | 49 | /* Get target folder, if applicable */ |
32 | if ( java.lang.String(suffix).contains('66') ) | 50 | if ( java.lang.String(suffix).contains('66') ) |
33 | lib = lib + "/c66"; | 51 | lib = lib + "/c66"; |
@@ -35,6 +53,7 @@ function getLibs(prog) | |||
35 | /* Get library name with path */ | 53 | /* Get library name with path */ |
36 | lib = lib + "/" + name; | 54 | lib = lib + "/" + name; |
37 | if (java.io.File(this.packageBase + lib).exists()) { | 55 | if (java.io.File(this.packageBase + lib).exists()) { |
56 | print ("\tLinking with library " + this.$name + ":" + lib); | ||
38 | return lib; | 57 | return lib; |
39 | } | 58 | } |
40 | 59 | ||
diff --git a/src/Module.xs b/src/Module.xs index 19f0fa8..abedd60 100755 --- a/src/Module.xs +++ b/src/Module.xs | |||
@@ -6,7 +6,7 @@ | |||
6 | * DESCRIPTION: | 6 | * DESCRIPTION: |
7 | * This file contains the module specification for the PCIE source directory. | 7 | * This file contains the module specification for the PCIE source directory. |
8 | * | 8 | * |
9 | * Copyright (C) 2009, Texas Instruments, Inc. | 9 | * Copyright (C) 2009-2014, Texas Instruments, Inc. |
10 | *****************************************************************************/ | 10 | *****************************************************************************/ |
11 | 11 | ||
12 | /* Load the library utility. */ | 12 | /* Load the library utility. */ |
@@ -28,14 +28,27 @@ var pcielldFile = [ | |||
28 | **************************************************************************/ | 28 | **************************************************************************/ |
29 | function modBuild() | 29 | function modBuild() |
30 | { | 30 | { |
31 | /* Build the libraries for all the targets specified. */ | 31 | for (var device=0; device < devices.length; device++) |
32 | for (var targets=0; targets < Build.targets.length; targets++) | ||
33 | { | 32 | { |
34 | var libOptions = { | 33 | var targetFiles = pcielldFile.slice(); /* make copy */ |
35 | incs: pcielldIncPath, | 34 | if (device != 0) |
36 | }; | 35 | { |
37 | 36 | /* extract device without c66 suffix */ | |
38 | libUtility.buildLibrary (libOptions, "ti.drv.pcie", Build.targets[targets], pcielldFile); | 37 | var dev=devices[device]; |
38 | var idx = dev.indexOf("/"); | ||
39 | dev = dev.substr(0,idx); | ||
40 | targetFiles.push (deviceConstruct[0]+dev+deviceConstruct[1]); | ||
41 | } | ||
42 | /* Build the libraries for all the targets specified. */ | ||
43 | for (var targets=0; targets < Build.targets.length; targets++) | ||
44 | { | ||
45 | var libOptions = { | ||
46 | copts: devicesCCOpt[device], | ||
47 | incs: pcielldIncPath, | ||
48 | }; | ||
49 | |||
50 | libUtility.buildLibrary (devices[device], libOptions, "ti.drv.pcie", Build.targets[targets], targetFiles); | ||
51 | } | ||
39 | } | 52 | } |
40 | 53 | ||
41 | /* Add all the .c files to the release package. */ | 54 | /* Add all the .c files to the release package. */ |