# This module contains the functionality to generate build report after\r
# build all target completes successfully.\r
#\r
-# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
from Common.DataType import TAB_BACK_SLASH\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+import Common.GlobalData as GlobalData\r
\r
## Pattern to extract contents in EDK DXS files\r
gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)\r
#\r
FileWrite(File, gSectionStart)\r
FileWrite(File, "Platform Configuration Database Report")\r
+ FileWrite(File, " *B - PCD override in the build option")\r
FileWrite(File, " *P - Platform scoped PCD override in DSC file")\r
FileWrite(File, " *F - Platform scoped PCD override in FDF file")\r
FileWrite(File, " *M - Module scoped PCD override")\r
InfDefault, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]\r
if InfDefault == "":\r
InfDefault = None\r
+\r
+ BuildOptionMatch = False\r
+ if GlobalData.BuildOptionPcd:\r
+ for pcd in GlobalData.BuildOptionPcd:\r
+ if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) == (pcd[0], pcd[1]):\r
+ PcdValue = pcd[2]\r
+ BuildOptionMatch = True\r
+ break\r
+\r
if First:\r
if ModulePcdSet == None:\r
FileWrite(File, "")\r
#\r
# Report PCD item according to their override relationship\r
#\r
- if DecMatch and InfMatch:\r
+ if BuildOptionMatch:\r
+ FileWrite(File, ' *B %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '(' + Pcd.DatumType + ')', PcdValue.strip()))\r
+ elif DecMatch and InfMatch:\r
FileWrite(File, ' %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '(' + Pcd.DatumType + ')', PcdValue.strip()))\r
else:\r
if DscMatch:\r
FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue.strip()))\r
\r
if ModulePcdSet == None:\r
- ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})\r
- for ModulePath in ModuleOverride:\r
- ModuleDefault = ModuleOverride[ModulePath]\r
- if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):\r
- ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)\r
- Match = (ModulePcdDefaultValueNumber == PcdValueNumber)\r
- else:\r
- Match = (ModuleDefault.strip() == PcdValue.strip())\r
- if Match:\r
- continue\r
- FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))\r
+ if not BuildOptionMatch:\r
+ ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})\r
+ for ModulePath in ModuleOverride:\r
+ ModuleDefault = ModuleOverride[ModulePath]\r
+ if Pcd.DatumType in ('UINT8', 'UINT16', 'UINT32', 'UINT64'):\r
+ ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)\r
+ Match = (ModulePcdDefaultValueNumber == PcdValueNumber)\r
+ else:\r
+ Match = (ModuleDefault.strip() == PcdValue.strip())\r
+ if Match:\r
+ continue\r
+ FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))\r
\r
if ModulePcdSet == None:\r
FileWrite(File, gSectionEnd)\r
# @param Wa Workspace context information\r
#\r
def _DiscoverNestedFvList(self, FvName, Wa):\r
- for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
- for Section in Ffs.SectionList:\r
- try:\r
- for FvSection in Section.SectionList:\r
- if FvSection.FvName in self.FvList:\r
- continue\r
- self._GuidsDb[Ffs.NameGuid.upper()] = FvSection.FvName\r
- self.FvList.append(FvSection.FvName)\r
- self.FvInfo[FvSection.FvName] = ("Nested FV", 0, 0)\r
- self._DiscoverNestedFvList(FvSection.FvName, Wa)\r
- except AttributeError:\r
- pass\r
+ FvDictKey=FvName.upper()\r
+ if FvDictKey in Wa.FdfProfile.FvDict:\r
+ for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
+ for Section in Ffs.SectionList:\r
+ try:\r
+ for FvSection in Section.SectionList:\r
+ if FvSection.FvName in self.FvList:\r
+ continue\r
+ self._GuidsDb[Ffs.NameGuid.upper()] = FvSection.FvName\r
+ self.FvList.append(FvSection.FvName)\r
+ self.FvInfo[FvSection.FvName] = ("Nested FV", 0, 0)\r
+ self._DiscoverNestedFvList(FvSection.FvName, Wa)\r
+ except AttributeError:\r
+ pass\r
\r
##\r
# Constructor function for class FdRegionReport\r
# Collect the GUID map in the FV firmware volume\r
#\r
for FvName in self.FvList:\r
- for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
- try:\r
- #\r
- # collect GUID map for binary EFI file in FDF file.\r
- #\r
- Guid = Ffs.NameGuid.upper()\r
- Match = gPcdGuidPattern.match(Ffs.NameGuid)\r
- if Match:\r
- PcdTokenspace = Match.group(1)\r
- PcdToken = Match.group(2)\r
- if (PcdToken, PcdTokenspace) in PlatformPcds:\r
- GuidValue = PlatformPcds[(PcdToken, PcdTokenspace)]\r
- Guid = GuidStructureByteArrayToGuidString(GuidValue).upper()\r
- for Section in Ffs.SectionList:\r
- try:\r
- ModuleSectFile = mws.join(Wa.WorkspaceDir, Section.SectFileName)\r
- self._GuidsDb[Guid] = ModuleSectFile\r
- except AttributeError:\r
- pass\r
- except AttributeError:\r
- pass\r
+ FvDictKey=FvName.upper()\r
+ if FvDictKey in Wa.FdfProfile.FvDict:\r
+ for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:\r
+ try:\r
+ #\r
+ # collect GUID map for binary EFI file in FDF file.\r
+ #\r
+ Guid = Ffs.NameGuid.upper()\r
+ Match = gPcdGuidPattern.match(Ffs.NameGuid)\r
+ if Match:\r
+ PcdTokenspace = Match.group(1)\r
+ PcdToken = Match.group(2)\r
+ if (PcdToken, PcdTokenspace) in PlatformPcds:\r
+ GuidValue = PlatformPcds[(PcdToken, PcdTokenspace)]\r
+ Guid = GuidStructureByteArrayToGuidString(GuidValue).upper()\r
+ for Section in Ffs.SectionList:\r
+ try:\r
+ ModuleSectFile = mws.join(Wa.WorkspaceDir, Section.SectFileName)\r
+ self._GuidsDb[Guid] = ModuleSectFile\r
+ except AttributeError:\r
+ pass\r
+ except AttributeError:\r
+ pass\r
\r
\r
##\r
self.FdRegionList = [FdRegionReport(FdRegion, Wa) for FdRegion in Fd.RegionList]\r
self.FvPath = os.path.join(Wa.BuildDir, "FV")\r
self.VpdFilePath = os.path.join(self.FvPath, "%s.map" % Wa.Platform.VpdToolGuid)\r
- VpdPcdToken = 'gEfiMdeModulePkgTokenSpaceGuid'\r
- VpdPcdName = 'PcdVpdBaseAddress'\r
+ self.VPDBaseAddress = 0\r
+ self.VPDSize = 0\r
self.VPDInfoList = []\r
for index, FdRegion in enumerate(Fd.RegionList):\r
- if (VpdPcdName, VpdPcdToken) == FdRegion.PcdOffset:\r
+ if str(FdRegion.RegionType) is 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList):\r
self.VPDBaseAddress = self.FdRegionList[index].BaseAddress\r
self.VPDSize = self.FdRegionList[index].Size\r
break\r