Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 07ff968e49af0bdf…

MALICIOUS

Office (OOXML)

3.47 MB Created: 2013-03-21 21:13:55 UTC Authoring application: Microsoft Excel 15.0300 First seen: 2015-08-19
MD5: 77c7ebcfe7b1fd078810706c625268a6 SHA-1: 8e7cf82f60fd9e9a508aa179f2e8fe4a440944c5 SHA-256: 07ff968e49af0bdfa9a5b0f96a63f796a4e21e163a46931405eef4a916d7bcec
106 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment

This Excel document contains a Workbook_Open macro, which is a common technique for executing malicious code upon opening. The macro attempts to restrict user interaction by setting ScrollArea properties on various worksheets and hides multiple sheets, likely to conceal malicious content or staging data. The presence of obfuscated auto-executing VBA code and hidden sheets strongly suggests a malicious intent, likely as a spearphishing attachment.

Heuristics 6

  • VBA project inside OOXML medium 2 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
    Matched line in script
       Application.Run ("Sheet3.SetSheetDefaults") ' Reset everything to clear existing data
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Private Sub Workbook_Open()
  • External hyperlinks (5) low OOXML_EXTERNAL_HYPERLINKS
    Document contains 5 external hyperlinks — clickable URLs are stored as external relationships. First target: http://www.xilinx.com/support/documentation/user_guides/ug480_7Series_XADC.pdf
  • Hidden worksheet (hidden) low OOXML_HIDDEN_SHEET
    Excel workbook contains 10 hidden sheet(s) — hidden sheets are commonly used to conceal macro code, staging data, or intermediate payload construction
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://www.xilinx.com/support/documentation/user_guides/ug480_7Series_XADC.pdf Document hyperlink
    • http://www.xilinx.com/cgi-bin/docs/rdoc?l=en;v=latest;d=ug440-xilinx-power-estimator.pdfDocument hyperlink
    • http://www.origin.xilinx.com/products/design_resources/power_central/ug440.pdfDocument hyperlink
    • http://www.xilinx.com/training/vivado/using-the-xilinx-power-estimator.htmDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug476_7Series_Transceivers.pdfDocument hyperlink
    • http://www.xilinx.com/products/technology/power/index.htmDocument hyperlink
    • http://www.xilinx.com/support/clearexpress/websupport.htmDocument hyperlink
    • http://www.origin.xilinx.com/products/design_resources/power_central/index.htmDocument hyperlink
    • http://www.xilinx.com/support/documentation/white_papers/wp353.pdfDocument hyperlink
    • http://www.xilinx.com/products/design_resources/power_central/index.htmDocument hyperlink
    • http://www.origin.xilinx.com/csi/training/vivado/using-the-xilinx-power-estimator.htmDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug472_7Series_Clocking.pdfDocument hyperlink
    • http://www.xilinx.com/cgi-bin/docs/rdoc?l=en;v=latest;d=ug440.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/ip_documentation/ug477_7Series_IntBlock_PCIe.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug482_7Series_GTP_Transceivers.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug479_7Series_DSP48E1.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug473_7Series_Memory_Resources.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug474_7Series_CLB.pdfDocument hyperlink
    • http://www.xilinx.com/support/documentation/user_guides/ug471_7Series_SelectIO.pdfDocument hyperlink

Extracted artifacts 32

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 682827 bytes
SHA-256: 055a0fb4bb414862f077db70585ff2748be9f1634c0862c033847afebf356116
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Option Explicit
' This function is called whenever the workbook is opened. It simply prevents the user from selecting
' or scrolling past the edge of the work area. It also displays a welcome sheet if the user does not
' have macros enabled, with instructions on how to enable.
Private Sub Workbook_Open()
  ' If we get an error go ahead and try the next sheet
  On Error Resume Next
  Worksheets("Summary").ScrollArea = "$A$1:$AM$39"
  Worksheets("CLOCK").ScrollArea = "$A$1:$L$200"
  Worksheets("LOGIC").ScrollArea = "$A$1:$M$10000"
  Worksheets("IO").ScrollArea = "$A$1:$AE$500"
  Worksheets("BRAM").ScrollArea = "$A$1:$T$500"
  Worksheets("DSP").ScrollArea = "$A$1:$P$500"
  Worksheets("PLL").ScrollArea = "$A$1:$P$33"
  Worksheets("CLKMGR").ScrollArea = "$A$1:$S$35"
  Worksheets("PHASER").ScrollArea = "$A$1:$L$33"
  Worksheets("GTP").ScrollArea = "$A$1:$T$50"
  Worksheets("GTX").ScrollArea = "$A$1:$X$100"
  Worksheets("GTH").ScrollArea = "$A$1:$X$100"
  Worksheets("GTZ").ScrollArea = "$A$1:$T$20"
  Worksheets("PCIE").ScrollArea = "$A$1:$L$11"
  Worksheets("PS").ScrollArea = "$A$1:$P$52"
  Worksheets("IP_Manager").ScrollArea = "$A$1:$M$45"
  Worksheets("Snapshot").ScrollArea = "$A$1:$AX$50"
  Worksheets("Other").ScrollArea = "$A$1:$L$26"
  Worksheets("Graphs").ScrollArea = "$A$1:$M$40"
  Worksheets("Release").ScrollArea = "$A$1:$M$80"
  ' Hide data and test worksheets. This action prevents them from being unhid, but does not protect them
  Worksheets("Data").Visible = xlVeryHidden
  Worksheets("Test").Visible = xlVeryHidden
End Sub

' Create a text power report and save with name specified as argument
Public Sub GeneratePowerReportFile(FileName As String)
   Sheet3.GeneratePowerReportFile (FileName)
End Sub

' Create a settings file and save with name specified as argument. This file can later be used in XPA
Public Sub GenerateXPAFile(FileName As String)
   Sheet3.GenerateXPAFile (FileName)
End Sub

' Create a .xpe file and save with name specified as argument. This file contains all user settings.
Public Sub GenerateXPEFile(FileName As String)
   Sheet3.GenerateXPEFile (FileName)
End Sub

' Import an existing XPE spreadsheet (.xls* path/file specified as argument)
Public Sub ImportXPEFile(FileName As String)
   Sheet3.ImportXPEFile (FileName)
End Sub

' Import a place and route map report (.mrp path/file specified as argument)
Public Sub ImportMapReportFile(FileName As String)
   Sheet3.ImportMapReportFile (FileName)
End Sub

' Import a implementation results in the .xpe format. Review the Import dialog options for details and format of the different arguments
Public Sub ImportXmlFile(FileName As String, append As Boolean, DevSettings As Boolean, EnvSettings As Boolean, VoltSettings As Boolean, IOSettings As Boolean)
   Sheet3.ImportXmlFile FileName, append, DevSettings, EnvSettings, VoltSettings, IOSettings
End Sub

' Take a snapshot from the named file
Public Sub TakeSnapShot(FileName As String)
   Sheet23.TakeSnapShot (FileName)
End Sub

' SetDefaults
Public Sub setdefaults(Environment As Boolean)
   Sheet3.SetSheetDefaults True
End Sub

' Set the default voltages for all supply voltages. Set argument to False for Nominal voltages and to true for Maximum voltage levels
Public Sub SetDefaultVoltages(Maximum As Boolean)
   Sheet3.SetDefaultVoltages (Maximum)
End Sub

' Set the device field on the summary sheet (will automatically adjust the family field if required)
Public Function SetDevice(Device As String) As Boolean
   Sheet3.ImportPartName Device
End Function
' Set device, package, temp, speed and return true if valid device setting
Public Function SetDeviceInfo(Device As String, Package As String, TempGrade As String, SpeedGrade As String) As Boolean
   Dim ret As Boolean
   SetDeviceInfo = True
   ret = Sheet3.ImportPartName2(Device, True)
   If (ret = False) Then
      SetDeviceInfo = False
   Else
      ret = Sheet3.ImportPackage(Package)
      If (ret = False) Then
         SetDeviceInfo = False
      Else
         ret = SetTemperatureGrade(TempGrade)
      End If
      If (ret = False) Then
         SetDeviceInfo = False
      Else
         ret = SetSpeedGrade(SpeedGrade)
         If (ret = False) Then
            SetDeviceInfo = False
         End If
      End If
   End If
End Function

' Set the package field on the summary sheet
Public Function SetPackage(Package As String) As Boolean
   Sheet3.ImportPackage (Package)
End Function

' Set the manufacturing process field on the summary sheet. Set argument to False for Typical process and True for Maximum process
Public Sub SetProcess(Maximum As Boolean)
   If (Maximum = True And ThisWorkbook.Sheets("Summary").Range("PROCESS").value <> "Maximum") Then
      ThisWorkbook.Sheets("Summary").Range("PROCESS").value = "Maximum"
   ElseIf (Maximum = False And ThisWorkbook.Sheets("Summary").Range("PROCESS").value = "Maximum") Then
      ThisWorkbook.Sheets("Summary").Range("PROCESS").value = "Typical"
   End If
End Sub

' Set the temperature grade field on the summary sheet. "Commercial", "Industrial", "Q-Grade", "Extended"…
Public Function SetTemperatureGrade(grade As String) As Boolean
   Dim ComboList As Variant
   ComboList = ThisWorkbook.Sheets("Data").Range("GRADELIST").value
   If (grade <> ComboList(1, 1) And grade <> ComboList(2, 1) And grade <> ComboList(3, 1)) Then
      SetTemperatureGrade = False
   Else
      SetTemperatureGrade = True
      If (ThisWorkbook.Sheets("Summary").Range("GRADE").value <> grade) Then
         ThisWorkbook.Sheets("Summary").Range("GRADE").value = grade
      End If
   End If
End Function

' Set the speed grade field on the summary sheet. "-1", "-1L"
Public Function SetSpeedGrade(grade As String) As Boolean
   Dim ComboList As Variant
   ComboList = ThisWorkbook.Sheets("Data").Range("SPEEDLIST").value
   If (grade <> ComboList(1, 1) And grade <> ComboList(2, 1) And grade <> ComboList(3, 1) And grade <> ComboList(4, 1)) Then
      SetSpeedGrade = False
   Else
      SetSpeedGrade = True
      If (ThisWorkbook.Sheets("Summary").Range("SPEEDGRADE").value <> grade) Then
         ThisWorkbook.Sheets("Summary").Range("SPEEDGRADE").value = grade
      End If
   End If
End Function

' Set the Heatsink field on the summary sheet. "Custom", "None", "Low Profile"
Public Function SetHeatSink(Heatsink As String) As Boolean
   Dim Sink As String
   Sink = Left(Heatsink, 3) ' Just look at first part of string
   If (Sink = "Cus" Or Sink <> "Non" Or Sink <> "Low" Or Sink <> "Med" Or Sink <> "Hig") Then
      SetHeatSink = True
      If (Sink = "Cus") Then
         ThisWorkbook.Sheets("Summary").Range("HEATSINK").value = "Custom"
      ElseIf (Sink = "Non") Then
         ThisWorkbook.Sheets("Summary").Range("HEATSINK").value = "None"
      ElseIf (Sink = "Low") Then
         ThisWorkbook.Sheets("Summary").Range("HEATSINK").value = "Low Profile"
      ElseIf (Sink = "Med") Then
         ThisWorkbook.Sheets("Summary").Range("HEATSINK").value = "Medium Profile"
      ElseIf (Sink = "Hig") Then
         ThisWorkbook.Sheets("Summary").Range("HEATSINK").value = "High Profile"
      End If
   Else
      SetHeatSink = False
   End If
End Function

' Set the board dimension field on the summary sheet, "Custom", "JEDEC", "Small", "Medium", "Large"
Public Function SetBoard(BoardSize As String, BoardLayers As Integer) As Boolean
   Dim board As String
   board = Left(BoardSize, 5) ' Accept XPE names like "Small (4"x4")" too
   If (board = "Custo" Or board = "JEDEC" Or board = "Small" Or board = "Mediu" Or board = "Large") Then
      SetBoard = True
      If (board = "Custo") Then
         ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "Custom"
      ElseIf (board = "JEDEC") Then
         ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "JEDEC (2S2P)"
      ElseIf (board = "Small") Then
         ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "Small (4""x4"")"
      ElseIf (board = "Mediu") Then
         ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "Medium (10""x10"")"
      ElseIf (board = "Large") Then
         ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "Large (20""x20"")"
      End If
   Else
      SetBoard = False
   End If
   If (BoardLayers < 12) Then
      ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "8 to 11"
   ElseIf (BoardLayers < 16) Then
      ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "12 to 15"
   Else
      ThisWorkbook.Sheets("Summary").Range("LAYERS").value = "16 or more"
   End If
End Function

' Set the Junction Temperature override and value
Public Function SetJunctionTemperature(temperature As Double, OverRide As Boolean) As Boolean
   If (OverRide = True And (temperature < -55 Or temperature > 150)) Then
      SetJunctionTemperature = False
   Else
      SetJunctionTemperature = True
      Dim combo As OLEObject
      Set combo = ThisWorkbook.Sheets("Summary").OLEObjects.Item("UserTJ")
      If (OverRide = True) Then
         If (combo.Object.value <> True) Then combo.Object.value = True
         Sheet3.Range("E18").value = temperature
      Else
         If (combo.Object.value = True) Then combo.Object.value = False
      End If
      Set combo = Nothing
   End If
End Function
' Set the Effective ThetaJA override and value
Public Function SetEffectiveThetaJA(ThetaJA As Double, OverRide As Boolean) As Boolean
   If (OverRide = True And (ThetaJA < 0# Or ThetaJA > 50)) Then
      SetEffectiveThetaJA = False
   Else
      SetEffectiveThetaJA = True
      Dim combo As OLEObject
      Set combo = ThisWorkbook.Sheets("Summary").OLEObjects.Item("UserTJA")
      If (OverRide = True) Then
         If (combo.Object.value <> True) Then combo.Object.value = True
         Sheet3.Range("E20").value = ThetaJA
      Else
         If (combo.Object.value = True) Then combo.Object.value = False
      End If
      Set combo = Nothing
   End If
End Function

Public Function DisableCutCopyPasteDrag()
   Application.OnKey "^x", "XilCut"
   Application.OnKey "^c", "XilCopy"
   Application.OnKey "^v", "XilPaste"
End Function
Public Function EnableCutCopyPasteDrag()
   Application.OnKey "^x"
   Application.OnKey "^c"
   Application.OnKey "^v"
End Function
Public Sub ExportBlockModelUnitTests(path As String)
   Sheet12.GenerateXPEBlockTests (path)
End Sub
Public Sub ExportStaticModelUnitTests(path As String)
   Sheet12.GenerateStaticUnitTests (path)
End Sub
Public Function GetUtilization(ResourceName As String) As Double
   GetUtilization = Sheet3.GetUtilization(ResourceName)
End Function


Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Control = "AddRAM, 1599, 15, MSForms, CommandButton2"
Attribute VB_Control = "Summary, 134, 16, MSForms, CommandButton2"
Private Const firstRow As Integer = 10
Private Const lastRow As Integer = 500
Private Const SECRET As String = "Hi"

' Initialize and post Memory Wizard User Form
Private Sub AddRAM_Click()
   ShowMemoryForm 0 ' BRAM tab
End Sub

Private Sub Summary_Click()
  Sheets("Summary").Select
End Sub
Private Function GetAvailableRAMB36() As Long
   GetAvailableRAMB36 = ThisWorkbook.Sheets("Summary").Range("NUM_BRAMS").value - ThisWorkbook.Sheets("BRAM").Range("BRAM_COUNT").value
End Function
Public Sub setdefaults(internal As Boolean)
   Dim last As Integer, sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   last = sheet.Range("BRAMROWS") + 9 ' Last data entry row
   SetRowDefaults firstRow, last
   'DeleteSheetRows "BRAM", FirstRow, LastRow
   sheet.Range("B" & firstRow).Select
End Sub
Public Sub SetRowDefaults(first As Integer, last As Integer)
   Dim bUpdateScreen As Boolean
   bUpdateScreen = Application.ScreenUpdating
   If (bUpdateScreen) Then Application.ScreenUpdating = False
   
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   Dim allowForm As Boolean
   allowForm = False
   If (sheet.Protection.AllowFormattingColumns) Then allowForm = True
   sheet.Unprotect (SECRET)
   sheet.Range("A" & first & ":A" & last).value = ""
   sheet.Protect Password:=SECRET, AllowFormattingColumns:=allowForm
   sheet.Range("B" & first & ":E" & last).value = ""
   sheet.Range("F" & first & ":F" & last).value = "RAMB18"
   sheet.Range("G" & first & ":G" & last).value = 0.5
   sheet.Range("H" & first & ":H" & last).value = ""
   sheet.Range("I" & first & ":I" & last).value = 0.25
   sheet.Range("J" & first & ":J" & last).value = 1
   sheet.Range("K" & first & ":K" & last).value = "NO_CHANGE"
   sheet.Range("L" & first & ":L" & last).value = 0.5
   sheet.Range("M" & first & ":M" & last).value = ""
   sheet.Range("N" & first & ":N" & last).value = 0.25
   sheet.Range("O" & first & ":O" & last).value = 1
   sheet.Range("P" & first & ":P" & last).value = "NO_CHANGE"
   sheet.Range("Q" & first & ":Q" & last).value = 0.5
   
   If (bUpdateScreen) Then Application.ScreenUpdating = True
End Sub
'Find the first non-empty row to start an append import
Private Function GetAppendRow() As Integer
   Dim row As Integer
   row = lastRow
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   Do While (row >= firstRow)
      If (sheet.Range("B" & row).value <> "" Or sheet.Range("E" & row).value > 0#) Then
         If (row < lastRow) Then row = row + 1
         Exit Do
      Else
         row = row - 1
      End If
   Loop
   If (row < firstRow) Then
      GetAppendRow = firstRow
   Else
      GetAppendRow = row
   End If
End Function

Public Sub AddBRAM(Module As String, count As Long, mode As String, clk As Double, toggle As Double, ENA As Double, widthA As Integer, modeA As String, ENB As Double, widthB As Integer, modeB As String)
   Dim row As Integer, powerFormula As String
   row = GetAppendRow
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   sheet.Range("B" & row).value = Module
   sheet.Range("E" & row).value = count
   sheet.Range("F" & row).value = mode
   sheet.Range("G" & row).value = toggle
   sheet.Range("H" & row).value = clk
   If (widthB > 0) Then sheet.Range("M" & row).value = clk ' Only set when PortB is used
   sheet.Range("I" & row).value = ENA
   sheet.Range("N" & row).value = ENB
   sheet.Range("J" & row).value = widthA
   sheet.Range("O" & row).value = widthB
   sheet.Range("K" & row).value = modeA
   If (widthB > 0) Then sheet.Range("P" & row).value = modeB ' Only set when PortB is used
   If (Len(mode) > 7 And Mid(mode, 7, 3) = "SDP") Then
      sheet.Range("L" & row).value = 0 ' PortA is the read port
      sheet.Range("Q" & row).value = 1 ' PortB is the write port
   End If
   
   powerFormula = "SUM(BRAM!S" & row & ":T" & row & ")"
   Sheet22.AddSheetIP "BRAM", Module, powerFormula, "B" & row
   
End Sub
' Remove a BRAM module
Public Sub DeleteBRAM(startRow As Integer, endRow As Integer)
   Dim row As Integer
   row = GetAppendRow
   If (row <= endRow + 1) Then ' Simple case IP is at the end of the entries
      SetRowDefaults startRow, endRow
   Else
      CopySheetRows "BRAM", "Q", startRow, endRow, row
      SetRowDefaults startRow + (row - endRow - 1), row - 1
   End If
End Sub
' Export a BRAM module to .xpe, if startRow and endRow = 0 then export all rows
Public Sub ExportBRAM(startRow As Integer, endRow As Integer)
   Dim row As Integer, attrs As String, sheet As Worksheet, indent As String, interconnect As Double
   Set sheet = ThisWorkbook.Sheets("BRAM")
   indent = "        "
   If (startRow = 0) Then startRow = firstRow
   If (endRow = 0) Then endRow = GetAppendRow
   If (startRow = endRow And sheet.Range("E" & startRow).value <= 0) Then GoTo EndExportBRAM ' No BRAMs
   Print #1, "      <BLOCKTYPE name=""BRAM"">"
   For row = startRow To endRow
      If (sheet.Range("E" & row).value > 0) Then ' if the count is > 0
         interconnect = (sheet.Range("AC" & row).value + sheet.Range("AH" & row).value) / 1000#
         attrs = " name=""" & EscapeXml(sheet.Range("B" & row).value) & """"
         attrs = attrs & " count=""" & sheet.Range("E" & row).value & """"
         attrs = attrs & " mode=""" & sheet.Range("F" & row).value & """"
         attrs = attrs & " toggleRate=""" & sheet.Range("G" & row).value * 100 & """"
         attrs = attrs & " Vccint=""" & sheet.Range("S" & row).value & """"
         attrs = attrs & " Vccbram=""" & sheet.Range("T" & row).value & """"
         attrs = attrs & " interconnect=""" & interconnect & """"
         Print #1, indent & "<BRAM" & attrs & ">"
         attrs = " name=""A"" clockFreq=""" & sheet.Range("H" & row).value & """"
         attrs = attrs & " enableRate=""" & sheet.Range("I" & row).value & """"
         attrs = attrs & " width=""" & sheet.Range("J" & row).value & """"
         attrs = attrs & " writeMode=""" & sheet.Range("K" & row).value & """"
         attrs = attrs & " writeRate=""" & sheet.Range("L" & row).value & """"
         Print #1, indent & "  <RAMPORT" & attrs & "/>"
         attrs = " name=""B"" clockFreq=""" & sheet.Range("M" & row).value & """"
         attrs = attrs & " enableRate=""" & sheet.Range("N" & row).value & """"
         attrs = attrs & " width=""" & sheet.Range("O" & row).value & """"
         attrs = attrs & " writeMode=""" & sheet.Range("P" & row).value & """"
         attrs = attrs & " writeRate=""" & sheet.Range("Q" & row).value & """"
         Print #1, indent & "  <RAMPORT" & attrs & "/>"
         Print #1, indent & "</BRAM>"
      End If
   Next row
   Print #1, "      </BLOCKTYPE>"
EndExportBRAM:
End Sub
Public Sub ImportBRAMXmlData(Node As IXMLDOMElement, append As Boolean, Module As String, ImportActivity As Boolean, Prompts As Boolean)
   If Node Is Nothing Then GoTo ExitImportBRAMXmlData
   On Error Resume Next
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   
   Dim rowNum As Integer
   rowNum = 0
   
   Dim nRowOffset As Integer, startRow
   If (append = False) Then
      nRowOffset = firstRow
   Else
      nRowOffset = GetAppendRow
   End If
   startRow = rowNum
   
   Dim isNoOpt As Boolean
   isNoOpt = False
   If (Len(XmlDataVersion) > 3) Then
     Dim versionNum As Double
     If (XmlDataVersion Like "2013.*" Or XmlDataVersion Like "2014.*") Then
       isNoOpt = True
     End If
   End If
   Dim bramCount As Integer, j As Integer
   Dim name As String, value As String
   Dim nodeList As IXMLDOMNodeList, attributes As IXMLDOMNamedNodeMap
   'Dim portAttrs As IXMLDOMNamedNodeMap
   Dim isGroup As Boolean, grpCount As Long
   Dim hierName As String, hierNamePrev As String
   hierNamePrev = ""
   Dim addMoreRows As Boolean
   addMoreRows = False
      Dim currentLastRow As Integer
   currentLastRow = lastRow
   rowNum = nRowOffset
   Set nodeList = Node.getElementsByTagName("BRAM")
   For bramCount = 0 To nodeList.length - 1
      Dim elem As IXMLDOMElement
      Set elem = nodeList.Item(bramCount)
      ' check if within GROUPSUMMARY parent element
      isGroup = False
      grpCount = 0
      
      'rowNum = bramCount + nRowOffset
      'If (Len(hierNamePrev) > 0) Then
      '   rowNum = rowNum + 1
         'If (rowNum > lastRow) Then rowNum = lastRow
      'End If
      If ((rowNum) > currentLastRow Or (rowNum + 3) > currentLastRow) Then
         If (addMoreRows = False And Prompts = True) Then
            Dim Config As Integer, Answer As Integer
            Config = vbYesNo + vbQuestion + vbDefaultButton2
            Answer = MsgBox("BRAM sheet does not have enough rows to import all data. Add rows and import remaining BRAM data (this may increase import time)?", Config)
            If Answer = vbYes Then
               addMoreRows = True
            End If
         End If
         If (addMoreRows = True Or Prompts = False) Then
            Dim addRows As Integer
            addRows = (startRow + nodeList.length + 2) - rowNum
            If (Len(hierName) > 0) Then
              addRows = (2 * (startRow + nodeList.length + 2)) - rowNum
            End If
            If (addRows < 6) Then addRows = 6
            AddSheetRows2 "BRAM", firstRow, addRows
           currentLastRow = firstRow + sheet.Range("BRAMROWS").value - 1 ' Last data entry row
           sheet.ScrollArea = "$A$1:$T$" & currentLastRow
         Else
            GoTo ExitImportBRAMXmlData
         End If

         'rowNum = lastRow
      'Else
         'rowNum = bramCount + nRowOffset
      End If
      
      Dim parentElem As IXMLDOMElement
      Set parentElem = elem.parentNode
      If Not (parentElem Is Nothing) Then
         If (parentElem.tagName = "GROUPSUMMARY") Then
            Dim moduleElem As IXMLDOMElement
            Set moduleElem = parentElem.parentNode
            If Not (moduleElem Is Nothing) Then
               isGroup = True
               value = moduleElem.getAttribute("count")
               If (Len(value) > 0) Then grpCount = CLng(value)
            End If
         ElseIf (parentElem.tagName = "CORE" Or parentElem.tagName = "GROUP") Then
            isGroup = True
            value = parentElem.getAttribute("count")
            If (Len(value) > 0) Then grpCount = CLng(value)
         End If
      End If
      
      value = ""
      hierName = ""
      value = elem.getAttribute("hierName")
      If (Len(value) > 0) Then hierName = value
      value = ""
      If (Len(hierName) > 0) Then
         If (hierName <> hierNamePrev) Then
            hierNamePrev = hierName
            sheet.Range("B" & rowNum).value = hierName
            sheet.Range("E" & rowNum).value = ""
            sheet.Range("F" & rowNum).value = ""
            sheet.Range("I" & rowNum).value = ""
            sheet.Range("G" & rowNum).value = ""
            sheet.Range("H" & rowNum).value = ""
            sheet.Range("J" & rowNum).value = ""
            sheet.Range("K" & rowNum).value = ""
            sheet.Range("L" & rowNum).value = ""
            sheet.Range("M" & rowNum).value = ""
            sheet.Range("N" & rowNum).value = ""
            sheet.Range("O" & rowNum).value = ""
            sheet.Range("P" & rowNum).value = ""
            sheet.Range("Q" & rowNum).value = ""
            rowNum = rowNum + 1
         End If
      End If
      value = ""
      
      'If sheet.Range("E" & rowNum).value <> "" Then grpCount = grpCount + sheet.Range("E" & rowNum).value
      sheet.Range("E" & rowNum).value = 0#
      If (isGroup = True) Then
         sheet.Range("E" & rowNum).value = grpCount
      Else
         sheet.Range("E" & rowNum).value = 1
      End If
    
   
      Set attributes = elem.attributes
      For j = 0 To attributes.length - 1
         name = attributes.Item(j).nodeName
         value = attributes.Item(j).nodeValue
         If (value <> "") Then
            If (name = "name") Then
               If (Len(hierName) > 0) Then
                  Dim modName As String
                  modName = value
                  If (Len(modName) > Len(hierName) And Left(modName, Len(hierName)) = hierName) Then
                    modName = Right(modName, Len(modName) - Len(hierName) - 1)
                  End If
                  sheet.Range("B" & rowNum).value = "  " & modName
               Else
                  sheet.Range("B" & rowNum).value = value
               End If
            ElseIf (name = "count") Then
               sheet.Range("E" & rowNum).value = value
            ElseIf (name = "mode") Then
               ' possibly temp fix for Casc not including (pair)
               If (value = "CASC") Then
                  value = "CASC (pair)"
                  sheet.Range("E" & rowNum).value = sheet.Range("E" & rowNum).value / 2
               ElseIf (value = "RAMB9") Then
                  value = "RAMB18"
                  sheet.Range("E" & rowNum).value = sheet.Range("E" & rowNum).value / 2
               End If
               sheet.Range("F" & rowNum).value = value
            ElseIf (name = "toggleRate") Then ' don't think this is right in xml, could use 50% for now
               If (ImportActivity = True) Then
                  If (isISE) Then
                     sheet.Range("G" & rowNum).value = CDbl(value) ' ISE wrongly writes %/100
                  Else
                     sheet.Range("G" & rowNum).value = CDbl(value) / 100
                  End If
               End If
            End If
         End If
      Next j
      
      sheet.Range("H" & rowNum).value = 0#
      sheet.Range("M" & rowNum).value = 0#
      If (isNoOpt = True) Then
        Dim allowForm As Boolean
        allowForm = False
        If (sheet.Protection.AllowFormattingColumns) Then allowForm = True
        sheet.Unprotect (SECRET)
        sheet.Range("A" & rowNum).value = 1
        sheet.Protect Password:=SECRET, AllowFormattingColumns:=allowForm
      End If
      
      Dim portList As IXMLDOMNodeList
      Set portList = elem.getElementsByTagName("RAMPORT")
      Dim rp As Integer
      For rp = 0 To portList.length - 1
         Dim rZynqm As IXMLDOMElement
         Set rZynqm = portList.Item(rp)
         Set attributes = rZynqm.attributes
         Dim port As String
         Dim bitWidth As Long
         bitWidth = 0
         port = "A"
         value = rZynqm.getAttribute("name")
         If value <> "" And value Like "A" Or value Like "B" Then port = value
         For j = 0 To attributes.length - 1
            name = attributes.Item(j).nodeName
            value = attributes.Item(j).nodeValue
            If (value <> "") Then
               If (name = "clockFreq") Then
                  If (port Like "A") Then
                     sheet.Range("H" & rowNum).value = CDbl(value)
                  Else
                     sheet.Range("M" & rowNum).value = CDbl(value)
                  End If
               ElseIf (name = "enableRate") Then ' rates coming through in decimal form
                  If (ImportActivity = True) Then
                     If (port Like "A") Then
                        sheet.Range("I" & rowNum).value = CDbl(value)
                     Else
                        sheet.Range("N" & rowNum).value = CDbl(value)
                     End If
                  End If
               ElseIf (name = "width" Or name = "writeWidth" Or name = "readWidth") Then
                  Dim width As Long
                  width = CLng(value)
                  If (width > bitWidth) Then bitWidth = width
                  If (port Like "A") Then
                     sheet.Range("J" & rowNum).value = bitWidth
                     If (width = 36 And sheet.Range("F" & rowNum).value = "RAMB18") Then
                        sheet.Range("F" & rowNum).value = "RAMB18SDP"
                     ElseIf (bitWidth > 64 And sheet.Range("F" & rowNum).value Like "*36*_ECC") Then
                        sheet.Range("J" & rowNum).value = 64
                     End If
                  Else
                     sheet.Range("O" & rowNum).value = bitWidth
                     If (width = 36 And sheet.Range("F" & rowNum).value = "RAMB18") Then
                        sheet.Range("F" & rowNum).value = "RAMB18SDP"
                     ElseIf (bitWidth > 64 And sheet.Range("F" & rowNum).value Like "*36*_ECC") Then
                        sheet.Range("O" & rowNum).value = 64
                     End If
                  End If
               ElseIf (name = "writeMode" And Left(value, 7) <> "NOT_APP") Then
                  If (port Like "A") Then
                     sheet.Range("K" & rowNum).value = value
                  Else
                     sheet.Range("P" & rowNum).value = value
                  End If
               ElseIf (name = "writeRate") Then
                  If (ImportActivity = True) Then
                     If (port Like "A") Then
                        sheet.Range("L" & rowNum).value = CDbl(value)
                     Else
                        sheet.Range("Q" & rowNum).value = CDbl(value)
                     End If
                  End If
               End If
            End If
         Next j

      Next rp
      rowNum = rowNum + 1
   Next bramCount
   ' If this was from a CORE then add this module to the IP manager
   If (Len(Module) > 0) Then
      Dim powerFormula As String
      If (bramCount = 1) Then
         powerFormula = "SUM(BRAM!S" & startRow & ":T" & startRow & ")"
         Sheet22.AddSheetIP "BRAM", Module, powerFormula, "B" & startRow
      ElseIf (bramCount > 1) Then
         powerFormula = "SUM(BRAM!S" & startRow & ":T" & startRow + bramCount - 1 & ")"
         Sheet22.AddSheetIP "BRAM", Module, powerFormula, "B" & startRow & ":B" & startRow + bramCount - 1
      End If
   End If
ExitImportBRAMXmlData:
End Sub
Public Sub setNoOptFlag(first As Integer, last As Integer)
   Dim bUpdateScreen As Boolean
   bUpdateScreen = Application.ScreenUpdating
   If (bUpdateScreen) Then Application.ScreenUpdating = False
   
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("BRAM")
   Dim allowForm As Boolean
   allowForm = False
   If (sheet.Protection.AllowFormattingColumns) Then allowForm = True
   sheet.Unprotect (SECRET)
   sheet.Range("A" & first & ":A" & last).value = 1
   sheet.Range("A1").value = 1
   sheet.Protect Password:=SECRET, AllowFormattingColumns:=allowForm
   If (bUpdateScreen) Then Application.ScreenUpdating = True
End Sub


Attribute VB_Name = "Sheet17"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Attribute VB_Control = "Summary, 1, 0, MSForms, CommandButton2"
Private Const firstRow As Integer = 10
Private Const lastRow As Integer = 33
Private Sub Summary_Click()
  Sheets("Summary").Select
End Sub
'Find the first empty row to start an append import
Private Function GetAppendRow() As Long
   Dim row As Integer
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   Dim appLastRow As Integer
   appLastRow = firstRow + sheet.Range("CLKMGRROWS").value - 1
   row = appLastRow
   Do While (row >= firstRow)
      If (sheet.Range("B" & row).value <> "" Or sheet.Range("F" & row).value > 0#) Then
         If (row < appLastRow) Then row = row + 1
         Exit Do
      Else
         row = row - 1
      End If
   Loop
   If (row < firstRow) Then
      GetAppendRow = firstRow
   Else
      GetAppendRow = row
   End If
End Function
Public Sub setdefaults(internal As Boolean)
   Dim currentLastRow As Integer, sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   currentLastRow = firstRow + sheet.Range("CLKMGRROWS").value - 1
   SetRowDefaults firstRow, currentLastRow
   
   DeleteSheetRows "CLKMGR", firstRow, lastRow ' Remove any added rows
   sheet.Range("B" & firstRow).Select
End Sub
Public Sub SetRowDefaults(first As Integer, last As Integer)
   Dim bUpdateScreen As Boolean
   bUpdateScreen = Application.ScreenUpdating
   If (bUpdateScreen) Then Application.ScreenUpdating = False
   
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   sheet.Range("B" & first & ":B" & last).value = ""
   sheet.Range("E" & first & ":F" & last).value = ""
   sheet.Range("G" & first & ":G" & last).value = "None"
   sheet.Range("H" & first & ":I" & last).value = 1
   sheet.Range("J" & first & ":P" & last).value = "off"
   sheet.Range("Q" & first & ":Q" & last).value = ""
   Set sheet = ThisWorkbook.Sheets("CLKMGR")

   If (bUpdateScreen) Then Application.ScreenUpdating = True
End Sub
Public Sub ConfigurePLL_MIG(Module As String, mem_clk As Double)
   Dim row As Long
   row = GetAppendRow
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   sheet.Range("B" & row).value = Module
   sheet.Range("E" & row).value = "PLL"
   sheet.Range("F" & row).value = mem_clk
   sheet.Range("H" & row).value = 2
   sheet.Range("I" & row).value = 4
   sheet.Range("J" & row).value = 2
   sheet.Range("K" & row).value = 2
   sheet.Range("L" & row).value = 8
   sheet.Range("M" & row).value = 32
   
   ' Add this module to the IP manager
   Dim powerFormula As String
   powerFormula = "SUM(CLKMGR!R" & row & ":S" & row & ")"
   Sheet22.AddSheetIP "PLL", Module, powerFormula, "B" & row
End Sub
Public Sub ConfigureMMCM_MIG(Module As String, mem_clk As Double)
   Dim row As Long
   row = GetAppendRow
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   sheet.Range("B" & row).value = Module
   sheet.Range("E" & row).value = "MMCM"
   sheet.Range("F" & row).value = mem_clk
   sheet.Range("H" & row).value = 1
   sheet.Range("I" & row).value = 8
   
   ' Add this module to the IP manager
   Dim powerFormula As String
   powerFormula = "SUM(CLKMGR!R" & row & ":S" & row & ")"
   Sheet22.AddSheetIP "MMCM", Module, powerFormula, "B" & row
End Sub
Public Sub ConfigureMMCM_IP(Module As String, mem_clk As Double, d As Integer, m As Integer, c1 As String, c2 As String, c3 As String)
   Dim row As Long
   row = GetAppendRow
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   sheet.Range("B" & row).value = Module
   sheet.Range("E" & row).value = "MMCM"
   sheet.Range("F" & row).value = mem_clk
   sheet.Range("H" & row).value = d
   sheet.Range("I" & row).value = m
   sheet.Range("J" & row).value = c1
   sheet.Range("K" & row).value = c2
   sheet.Range("L" & row).value = c3
   ' Add this module to the IP manager
   Dim powerFormula As String
   powerFormula = "SUM(CLKMGR!R" & row & ":S" & row & ")"
   Sheet22.AddSheetIP "MMCM", Module, powerFormula, "B" & row
End Sub
' Remove a ClkMgr module
Public Sub DeleteClkMgr(startRow As Integer, endRow As Integer)
   Dim row As Integer
   row = GetAppendRow
   If (row <= endRow + 1) Then ' Simple case IP is at the end of the entries
      SetRowDefaults startRow, endRow
   Else
      CopySheetRows "CLKMGR", "P", startRow, endRow, row
      SetRowDefaults startRow + (row - endRow - 1), row - 1
   End If
End Sub
' Export a ClkMgr module to .xpe, if startRow and endRow = 0 then export all clocks
Public Sub ExportClkMgr(startRow As Integer, endRow As Integer)
   Dim row As Integer, attrs As String, sheet As Worksheet, mmcms As Integer, plls As Integer
   Dim interpolators As Integer
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   If (startRow = 0) Then startRow = firstRow
   If (endRow = 0) Then endRow = GetAppendRow
   If (startRow = endRow And sheet.Range("E" & startRow).value <= 0) Then GoTo EndExportClkMgr ' No ClkMgrs
   mmcms = 0
   plls = 0
   For row = startRow To endRow
      If (sheet.Range("F" & row).value > 0) Then
         If (sheet.Range("E" & row).value = "MMCM") Then
            mmcms = mmcms + 1
         Else
            plls = plls + 1
         End If
      End If
   Next row
   If (mmcms > 0) Then
      Print #1, "      <BLOCKTYPE name=""MMCM"">"
      For row = startRow To endRow
         If (sheet.Range("E" & row).value = "MMCM" And sheet.Range("F" & row).value > 0) Then ' don't export any unclocked rows
            If (sheet.Range("G" & row).value = "Dynamic") Then
               interpolators = 5
            ElseIf (sheet.Range("G" & row).value = "Fixed") Then
               interpolators = 2
            Else
               interpolators = 1
            End If
            attrs = " name=""" & EscapeXml(sheet.Range("B" & row).value) & """"
            attrs = attrs & " clockFreq=""" & sheet.Range("F" & row).value & """"
            attrs = attrs & " phaseShift=""" & sheet.Range("G" & row).value & """"
            attrs = attrs & " interpolators=""" & interpolators & """"
            attrs = attrs & " divCounter=""" & sheet.Range("H" & row).value & """"
            attrs = attrs & " multCounter=""" & sheet.Range("I" & row).value & """"
            attrs = attrs & " clock0Div=""" & sheet.Range("J" & row).value & """"
            attrs = attrs & " clock1Div=""" & sheet.Range("K" & row).value & """"
            attrs = attrs & " clock2Div=""" & sheet.Range("L" & row).value & """"
            attrs = attrs & " clock3Div=""" & sheet.Range("M" & row).value & """"
            attrs = attrs & " clock4Div=""" & sheet.Range("N" & row).value & """"
            attrs = attrs & " clock5Div=""" & sheet.Range("O" & row).value & """"
            attrs = attrs & " clock6Div=""" & sheet.Range("P" & row).value & """"
            attrs = attrs & " powerDownRate=""" & sheet.Range("Q" & row).value & """"
            attrs = attrs & " Vccint=""" & sheet.Range("R" & row).value & """"
            attrs = attrs & " Vccaux=""" & sheet.Range("S" & row).value & """"
            Print #1, "        <MMCM" & attrs & "/>"
         End If
      Next row
      Print #1, "      </BLOCKTYPE>"
   End If
   If (plls > 0) Then
      Print #1, "      <BLOCKTYPE name=""PLL"">"
      For row = startRow To endRow
         If (sheet.Range("E" & row).value = "PLL" And sheet.Range("F" & row).value > 0) Then ' don't export any unclocked rows
            attrs = " name=""" & EscapeXml(sheet.Range("B" & row).value) & """"
            attrs = attrs & " clockFreq=""" & sheet.Range("F" & row).value & """"
            attrs = attrs & " divCounter=""" & sheet.Range("H" & row).value & """"
            attrs = attrs & " multCounter=""" & sheet.Range("I" & row).value & """"
            attrs = attrs & " clock0Div=""" & sheet.Range("J" & row).value & """"
            attrs = attrs & " clock1Div=""" & sheet.Range("K" & row).value & """"
            attrs = attrs & " clock2Div=""" & sheet.Range("L" & row).value & """"
            attrs = attrs & " clock3Div=""" & sheet.Range("M" & row).value & """"
            attrs = attrs & " clock4Div=""" & sheet.Range("N" & row).value & """"
            attrs = attrs & " clock5Div=""" & sheet.Range("O" & row).value & """"
            attrs = attrs & " powerDownRate=""" & sheet.Range("Q" & row).value & """"
            attrs = attrs & " Vccint=""" & sheet.Range("R" & row).value & """"
            attrs = attrs & " Vccaux=""" & sheet.Range("S" & row).value & """"
            Print #1, "        <PLL" & attrs & "/>"
         End If
      Next row
      Print #1, "      </BLOCKTYPE>"
   End If
EndExportClkMgr:
End Sub
' Import MMCM, PLL or DCM data
Public Sub ImportClkMgrXmlData(Node As IXMLDOMElement, typeName As String, append As Boolean, Module As String)
   If Node Is Nothing Then GoTo ExitImportClkMgrXmlData
   On Error Resume Next
   Dim sheet As Worksheet
   Set sheet = ThisWorkbook.Sheets("CLKMGR")
   
   Dim rowNum As Integer, startRow As Integer, currentLastRow As Integer
   'If (append = False) Then
   '   rowNum = firstRow
   'Else
      rowNum = GetAppendRow ' Always append as there are both MMCMs and PLLs coming into the same sheet
   'End If
   startRow = rowNum
   currentLastRow = firstRow + sheet.Range("CLKMGRROWS").value - 1 ' Last data entry row
   
   Dim ClkMgrCount As Integer, j As Integer
   Dim name As String, value As String, dval As Double
   Dim nodeList As IXMLDOMNodeList, attributes As IXMLDOMNamedNodeMap
   
   Set nodeList = Node.getElementsByTagName(typeName)
   For ClkMgrCount = 0 To nodeList.length - 1
      If (rowNum + 2 > currentLastRow) Then
         AddSheetRows "CLKMGR", firstRow
         currentLastRow = firstRow + sheet.Range("CLKMGRROWS").value - 1 ' Last data entry row
      End If
      If (typeName = "MMCM") Then
         sheet.Range("E" & rowNum).value = "MMCM"
      Else
         sheet.Range("E" & rowNum).value = "PLL"
      End If
      Dim elem As IXMLDOMElement, interpolators As Integer
      interpolators = 0
      Set elem = nodeList.Item(ClkMgrCount)
      Set attributes = elem.attributes
      For j = 0 To attributes.length - 1
         name = attributes.Item(j).nodeName
         value = attributes.Item(j).nodeValue
         Select Case name
            Case "name"
               sheet.Range("B" & rowNum).value = value
            Case "clockFreq"
               If CDbl(value) = 0# Then value = "0.0001"
               sheet.Range("F" & rowNum).value = CDbl(value)
            Case "phaseShift"
               If (value = "None") Then
                  interpolators = 1
               ElseIf (value = "Fixed") Then
                  interpolators = 2
               ElseIf (value = "Dynamic") Then
                  interpolators = 5
               End If
            Case "divCounter"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("H" & rowNum).value = Int(value + 0.49)
            Case "multCounter"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("I" & rowNum).value = Int(value + 0.49)
            Case "clock0Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("J" & rowNum).value = value
            Case "clock1Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("K" & rowNum).value = value
            Case "clock2Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("L" & rowNum).value = value
            Case "clock3Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("M" & rowNum).value = value
            Case "clock4Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("N" & rowNum).value = value
            Case "clock5Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("O" & rowNum).value = value
            Case "clock6Div"
               If (value = "Off" Or CLng(value) >= 1) Then sheet.Range("P" & rowNum).value = value
            Case "powerDownRate"
               sheet.Range("Q" & rowNum).value = CDbl(value)
            Case "interpolators"
               interpolators = CInt(value)
         End Select
      Next j
      If (interpolators < 2) Then
         sheet.Range("G" & rowNum).value = "None"
      ElseIf (interpolators < 5) Then
         sheet.Range("G" & rowNum).value = "Fixed"
      Else
         sheet.Range("G" & rowNum).value = "Dynamic"
      End If
      rowNum = rowNum + 1
   Next ClkMgrCount
   ' If this was from a CORE then add this module to the IP manager
   If (Len(Module) > 0) Then
      Dim powerFormula As String
      If (ClkMgrCount = 1) Then
         powerFormula = "SUM(CLKMGR!R" & startRow & ":S" & startRow & ")"
         Sheet22.AddSheetIP typeName, Module, powerFormula, "B" & startRow
      ElseIf (ClkMgrCount > 1) Then
…
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 1698304 bytes
SHA-256: ef0a77dea74fd5cf4d99386fa1239a6ec987f1d3a765b1aef74844ff08d6b2d2
emf_00.emf ooxml-emf OOXML EMF part: xl/media/image46.emf 9056 bytes
SHA-256: 9e8853ea3cb0f2e4dd9a3f6f2e62f9bd46f7bae5a3599719cd1ca27acec6e034
emf_01.emf ooxml-emf OOXML EMF part: xl/media/image47.emf 7012 bytes
SHA-256: b2a002ba79b64f1d92c9112d0189ce3ca551cc7063958b31e34ab0e54b78aefd
emf_02.emf ooxml-emf OOXML EMF part: xl/media/image45.emf 9056 bytes
SHA-256: 01d39ea9d91037830fbe3c7ba0929b696cc9d6d1a21ac5ad1777c0f97ed4c708
emf_03.emf ooxml-emf OOXML EMF part: xl/media/image42.emf 6920 bytes
SHA-256: b61044def7abdc9c3213972a20011ea02f997140949ce34108ce3bf45077a2c9
emf_04.emf ooxml-emf OOXML EMF part: xl/media/image43.emf 9056 bytes
SHA-256: dc390c3d315259b338bf0c94f30756b30c7b8cc1fc2e59be4a6c8dc67ed27d96
emf_05.emf ooxml-emf OOXML EMF part: xl/media/image44.emf 9056 bytes
SHA-256: 2e13441e75ed8daf7e72cb7f0fd69a9b1186407b988d721a67392c726d6fe17e
emf_06.emf ooxml-emf OOXML EMF part: xl/media/image48.emf 9056 bytes
SHA-256: d8f9a62af03aa84d3be9539e6cd409fa7c23de67adc990d19b1143da63ec3232
emf_07.emf ooxml-emf OOXML EMF part: xl/media/image53.emf 9056 bytes
SHA-256: 3122fabf9e5d729d0a733f74d301bd6f130ceaf6951e44fa3d7ab1486c556966
emf_08.emf ooxml-emf OOXML EMF part: xl/media/image54.emf 6980 bytes
SHA-256: ac0821a4157192ae2492aa8f50a53a41e69db7a5866d7cf7af8a17e98708a4a8
emf_09.emf ooxml-emf OOXML EMF part: xl/media/image55.emf 9056 bytes
SHA-256: 77e802a8c066c3e2a8249c0c33f9a8c1f8fe49008eef6c354de6f3fcb59fa317
emf_10.emf ooxml-emf OOXML EMF part: xl/media/image52.emf 6980 bytes
SHA-256: 000066f37b2585cd8897aecd95a866e8631bf55d69df397d62347c7b5eb1be8b
emf_11.emf ooxml-emf OOXML EMF part: xl/media/image49.emf 9056 bytes
SHA-256: 599c96f91ca1242044c8092695f21780f67bc96e31403bc7898ff9d3c03134cf
emf_12.emf ooxml-emf OOXML EMF part: xl/media/image50.emf 6980 bytes
SHA-256: d0966c1b4044891cd35d1effabc64fd703b3e073797b4e3a78d00f8653261e3f
emf_13.emf ooxml-emf OOXML EMF part: xl/media/image51.emf 9056 bytes
SHA-256: 89047e35c52720bd5e5a8084042f833d2fd083888d1e156dfcca36d18d1091c5
emf_14.emf ooxml-emf OOXML EMF part: xl/media/image29.emf 4936 bytes
SHA-256: bfa7fb80b4a2e012567a1be8a876a1855f6a7a091494a5d29c20a30252d6b1d3
emf_15.emf ooxml-emf OOXML EMF part: xl/media/image30.emf 9056 bytes
SHA-256: 92e4f526aa6c2558b8c593e53bd7cc3b5cb057051a2309baf1380919b2e5488c
emf_16.emf ooxml-emf OOXML EMF part: xl/media/image26.emf 4944 bytes
SHA-256: 101c69954d577010b1f1d36524b1b7d6a02b6898afcba74c270e4e69589e1199
emf_17.emf ooxml-emf OOXML EMF part: xl/media/image27.emf 9056 bytes
SHA-256: ee1a4e858750783f4de07e17286ab0dfeac1de1de45ff74ebc465a9626bc72ed
emf_18.emf ooxml-emf OOXML EMF part: xl/media/image28.emf 9056 bytes
SHA-256: 235b59022e066532cf2cafc8a9267b5f355adf08c06765f0de3de3977957c3b8
emf_19.emf ooxml-emf OOXML EMF part: xl/media/image31.emf 9056 bytes
SHA-256: 6066810c7f39beee9bbd58ffaddade3360bc238587f6d49253e35aee369ea8eb
emf_20.emf ooxml-emf OOXML EMF part: xl/media/image36.emf 2696 bytes
SHA-256: 65ff4830cffbcc51d977391b2cc178fc80afe634c487cd9a2782a62aaf014177
emf_21.emf ooxml-emf OOXML EMF part: xl/media/image37.emf 2980 bytes
SHA-256: 8635cf5510fc09f636386f62459a38ab616c17868a4c200df5098c7d6a2256fa
emf_22.emf ooxml-emf OOXML EMF part: xl/media/image38.emf 9056 bytes
SHA-256: 892c29ac1954d5715cfdb58ebe661045d765b9b85edf9565aa1cecbaec09d33c
emf_23.emf ooxml-emf OOXML EMF part: xl/media/image35.emf 2724 bytes
SHA-256: 33910169048809a856b00bdf47d21093908a2647f9ddb6b0b8744fe304f41db7
emf_24.emf ooxml-emf OOXML EMF part: xl/media/image34.emf 7012 bytes
SHA-256: dbb7f962fdd6aee68a2c8b8f31ffbb969a3c574cdf335a55395b8b4b91e22adf
emf_25.emf ooxml-emf OOXML EMF part: xl/media/image32.emf 6920 bytes
SHA-256: 32916b6e3bc353d37b1784f675dbe3471cb153b2319e235d50858fe91152dc29
emf_26.emf ooxml-emf OOXML EMF part: xl/media/image33.emf 9056 bytes
SHA-256: 88ac9af6b098b865fb0cb205f617c49b0366112f4c137ac35d943bd40816511c
emf_27.emf ooxml-emf OOXML EMF part: xl/media/image56.emf 9056 bytes
SHA-256: 6793ea0061169af7fd3b81f95bca2eb1a80583bcd49f342a439e076d71bda7d6
emf_28.emf ooxml-emf OOXML EMF part: xl/media/image59.emf 9056 bytes
SHA-256: 00e656892c113fe22b93cf5ed4a6a6680a7df705b3a8cdc47eeab56c0423640a
emf_29.emf ooxml-emf OOXML EMF part: xl/media/image60.emf 9056 bytes
SHA-256: e40f0212d86837ddcf65da86cbbdec0730a32f6278f8a1df019146909dd053b0