var mem_descriptor_arr = []; var master_descriptor_arr = []; var periph_descriptor_arr = []; var total_masters = 0; var allocated_masters = 0; var unallocated_masters = 0; var multidomain_masters = 0; var total_peripherals = 0; var allocated_peripherals = 0; var unallocated_peripherals = 0; var shared_peripherals = 0; var total_memories = 0; var allocated_memories = 0; var unallocated_memories = 0; var shared_memories = 0; var filters_active = []; var xrdc_support_enabled = true; var debug = true; var peripheralContextActive = false; var hide_unused_masters = false; var master_dict = []; var master_allocation_dict = []; var master_list = 'Xrdc_0_CM7_0, Xrdc_0_eDMA_AHB, Xrdc_0_CM7_1, Xrdc_0_GMAC_0, Xrdc_0_CM7_2, Xrdc_0_uSDHC_AHB'.split(", "); var peripherals_list = 'Xrdc_0_ERM_1, Xrdc_0_TRGMUX, Xrdc_0_BCTU, Xrdc_0_EMIOS_0, Xrdc_0_EMIOS_1, Xrdc_0_EMIOS_2, Xrdc_0_LCU_0, Xrdc_0_LCU_1, Xrdc_0_ADC_0, Xrdc_0_ADC_1, Xrdc_0_ADC_2, Xrdc_0_PIT_0, Xrdc_0_PIT_1, Xrdc_0_MU_2_MUA, Xrdc_0_MU_2_MUB, Xrdc_0_AXBS, Xrdc_0_System_XBIC, Xrdc_0_Periph_XBIC, Xrdc_0_EDMA, Xrdc_0_EDMA_TCD_0, Xrdc_0_EDMA_TCD_1, Xrdc_0_EDMA_TCD_2, Xrdc_0_EDMA_TCD_3, Xrdc_0_EDMA_TCD_4, Xrdc_0_EDMA_TCD_5, Xrdc_0_EDMA_TCD_6, Xrdc_0_EDMA_TCD_7, Xrdc_0_EDMA_TCD_8, Xrdc_0_EDMA_TCD_9, Xrdc_0_EDMA_TCD_10, Xrdc_0_EDMA_TCD_11, Xrdc_0_Debug_APB_Page0, Xrdc_0_Debug_APB_Page1, Xrdc_0_Debug_APB_Page2, Xrdc_0_Debug_APB_Page3, Xrdc_0_Debug_APB_Paged_Area, Xrdc_0_SDA_AP, Xrdc_0_ERM_0, Xrdc_0_MSCM, Xrdc_0_PRAM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_0_PRAM1_0, Xrdc_0_QuadSPI, Xrdc_0_ITCM_backdoor, Xrdc_0_DTCM_backdoor, Xrdc_0_PRAM2_0'.split(", "); var domainCount = 4; function ConsoleLog(msg) { if(debug) { console.log(msg); } } function create_padded_hex(num, len) { var val = num.toString(16).toUpperCase(); return "0x" + "0".repeat( len / 4 - val.length) + val; } function create_mem_table(tableData, full_memory_list) { var table = document.getElementById('MemoryTable') var row = {}; var cell = {}; header = ["Memory Region", "Descriptor", "Semaphore enable", "Semaphore Number", "Start Address", "End Address"]; header_ids = ["mem_Region", "mem_Descriptor", "mem_semaEnable", "mem_semaNumber", "mem_startAddress", "mem_EndAddress"]; header_percent = [15, 5, 5, 5, 5, 5]; var percentage_used = 0; for(var i = 0; i < header_percent.length; i++) { percentage_used += header_percent[i]; } for(var i = 0; i < domainCount; i++) { header.push("DID" + i + " S"); header.push("DID" + i + " NS"); header_ids.push("mem_DIDS" + i); header_ids.push("mem_DIDNS" + i); header_percent.push((100 - percentage_used)/(2 * domainCount)); header_percent.push((100 - percentage_used)/(2 * domainCount)); } var tableHeader=document.getElementById('MemoryTable-header'); //row = table.insertRow(-1); // [-1] for last position in Safari for(var i = 0; i < header.length; i++){ cell = document.createElement('th'); cell.textContent = header[i]; cell.id = header_ids[i]; cell.style = "width:" + header_percent[i] + "%"; tableHeader.appendChild(cell); } tableData.forEach(function(rowData) { var overlap = false; for (var mem of tableData) { if ((rowData.mrc == mem.mrc) && (rowData.descriptor_number != mem.descriptor_number)) { if (((mem.start_address <= rowData.start_address) && (rowData.start_address <= mem.end_address)) || ((mem.start_address <= rowData.end_address) && (rowData.end_address <= mem.end_address)) || ((rowData.start_address <= mem.start_address) && (rowData.end_address >= mem.end_address))) { overlap = true; } } } row = table.insertRow(-1); // [-1] for last position in Safari cell = row.insertCell(); cell.textContent = rowData.mrc.replace(rowData.instance_prefix + "_", rowData.instance_prefix.toUpperCase() + ":"); cell.style="text-align:left"; cell = row.insertCell(); cell.textContent = rowData.descriptor_number; cell = row.insertCell(); cell.textContent = rowData.sema4_enable; cell = row.insertCell(); cell.textContent = rowData.sema4_number; cell = row.insertCell(); cell.textContent = create_padded_hex(rowData.start_address, 40); if (overlap == true) { cell.style="text-align:center; color:#FFA500; font-weight: bold;"; } cell = row.insertCell(); cell.textContent = create_padded_hex(rowData.end_address, 40); if (overlap == true) { cell.style="text-align:center; color:#FFA500; font-weight: bold;"; } rowData.update_rights(); var domainsAllocated = 0; for(var i = 0; i < domainCount; i++) { var allocated = false; cell = row.insertCell(); cell.textContent = rowData.rights['secure'][i].replace('XRDC_', ''); if(cell.textContent == 'UNALLOCATED') { cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; } else if(cell.textContent.includes("READ_ONLY")) { cell.textContent = "RO"; cell.style.backgroundColor = "orange"; } else if(cell.textContent.includes("FULL_ACCESS")) { cell.textContent = "RW"; cell.style.backgroundColor = "LightGreen"; allocated = true; } else if(cell.textContent.includes("SUPERVISOR_ACCESS_ONLY")) { cell.textContent = "SRW"; cell.style.backgroundColor = "Turquoise"; } else if(cell.textContent.includes("SUPERVISOR_READ_ONLY")) { cell.textContent = "SRO"; cell.style.backgroundColor = "GoldenRod"; } else if(cell.textContent.includes("NO_ACCESS")) { cell.textContent = "D"; cell.style.backgroundColor = "Crimson"; } cell = row.insertCell(); cell.textContent = rowData.rights['non_secure'][i].replace('XRDC_', ''); if(cell.textContent == 'UNALLOCATED') { cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; } else if(cell.textContent.includes("READ_ONLY")) { cell.textContent = "RO"; cell.style.backgroundColor = "orange"; } else if(cell.textContent.includes("FULL_ACCESS")) { cell.textContent = "RW"; cell.style.backgroundColor = "LightGreen"; allocated = true; } else if(cell.textContent.includes("SUPERVISOR_ACCESS_ONLY")) { cell.textContent = "SRW"; cell.style.backgroundColor = "Turquoise"; } else if(cell.textContent.includes("SUPERVISOR_READ_ONLY")) { cell.textContent = "SRO"; cell.style.backgroundColor = "GoldenRod"; } else if(cell.textContent.includes("NO_ACCESS")) { cell.textContent = "D"; cell.style.backgroundColor = "Crimson"; } if(allocated) { domainsAllocated++; } } if(domainsAllocated > 0) { allocated_memories++; } if(domainsAllocated > 1) { row.style.backgroundColor = "orange"; shared_memories++; } }); total_memories = full_memory_list.length; full_memory_list.forEach(function(rowData) { if(rowData.trim().length == 0) { //skip } else { if(tableData.find(x => x.mrc == rowData.trim())) { //skip } else { unallocated_memories++; row = table.insertRow(-1); // [-1] for last position in Safari cell = row.insertCell(); instanceXrdc = rowData.substring(0, rowData.indexOf("_", rowData.indexOf("_")+1)+1); newValue = instanceXrdc.substring(0, instanceXrdc.lastIndexOf("_"))+":"; cell.textContent = rowData.replace(instanceXrdc, newValue); cell.textContent += '*'; cell.title = 'Not allocated in the configurator'; cell = row.insertCell(); cell.textContent = 0; cell = row.insertCell(); cell.textContent = false; cell = row.insertCell(); cell.textContent = 0; cell = row.insertCell(); cell.textContent = create_padded_hex(0, 40); cell = row.insertCell(); cell.textContent = create_padded_hex(0, 40); for(var i = 0; i < domainCount; i++) { cell = row.insertCell(); cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; cell = row.insertCell(); cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; } } } }); } function create_peripheral_table(tableData, full_periph_list) { var table = document.getElementById('PeripheralTable') var row = {}; var cell = {}; header = ["Peripheral Name", "Peripheral Slot", "Semaphore enable", "Semaphore Number"]; header_ids = ["per_name", "per_slot", "per_semaEnable", "per_semaNumber"]; header_percent = [15, 10, 7.5, 7.5]; var percentage_used = 0; for(var i = 0; i < header_percent.length; i++) { percentage_used += header_percent[i]; } for(var i = 0; i < domainCount; i++) { header.push("DID" + i + " S"); header.push("DID" + i + " NS"); header_ids.push("per_DIDS" + i); header_ids.push("per_DIDNS" + i); header_percent.push((100 - percentage_used)/(2 * domainCount)); header_percent.push((100 - percentage_used)/(2 * domainCount)); } var tableHeader=document.getElementById('PeripheralTable-header'); //row = table.insertRow(-1); // [-1] for last position in Safari for(var i = 0; i < header.length; i++) { cell = document.createElement('th'); cell.textContent = header[i]; cell.id = header_ids[i]; cell.style = "width:" + header_percent[i] + "%"; tableHeader.appendChild(cell); } var perNameCell = document.getElementById("per_name"); var memNameCell = document.getElementById("mem_Region"); perNameCell.style.width = memNameCell.style.width; var peripheralIndex = 0; for(var rowCnt = 0; rowCnt < tableData.length; rowCnt++) { var rowData = tableData[rowCnt]; row = table.insertRow(-1); // [-1] for last position in Safari cell = row.insertCell(); cell.textContent = rowData.peripheral_slot.replace(rowData.instance_prefix + "_", rowData.instance_prefix.toUpperCase() + ":"); cell.style="text-align:left"; cell.id = "rowPeriph" + peripheralIndex + "_id" + rowCnt; cell = row.insertCell(); cell.textContent = rowData.pdac_number; cell.id = "rowPeriph" + peripheralIndex + "_pdac"; cell = row.insertCell(); cell.textContent = rowData.sema4_enable; cell.id = "rowPeriph" + peripheralIndex + "_semaEnable"; cell = row.insertCell(); cell.textContent = rowData.sema4_number; cell.id = "rowPeriph" + peripheralIndex + "_semaValue"; rowData.update_rights(); var domainsAllocated = 0; for(var i = 0; i < domainCount; i++) { var allocated = false; cell = row.insertCell(); cell.textContent = rowData.rights['secure'][i].replace('XRDC_', ''); if(cell.textContent == 'UNALLOCATED') { cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; } else if(cell.textContent.includes("SUPERVISOR_ACCESS_ONLY")) { cell.textContent = "SRW"; cell.style.backgroundColor = "Turquoise"; } else if(cell.textContent.includes("SUPERVISOR_READ_ONLY")) { cell.textContent = "SRO"; cell.style.backgroundColor = "GoldenRod"; } else if(cell.textContent.includes("READ_ONLY")) { cell.textContent = "RO"; cell.style.backgroundColor = "orange"; } else if(cell.textContent.includes("FULL_ACCESS")) { cell.textContent = "RW"; cell.style.backgroundColor = "LightGreen"; allocated = true; } else if(cell.textContent.includes("NO_ACCESS")) { cell.textContent = "D"; cell.style.backgroundColor = "Crimson"; } cell.id = "rowPeriph" + peripheralIndex + "_domain" + i + "_S"; cell = row.insertCell(); cell.textContent = rowData.rights['non_secure'][i].replace('XRDC_', ''); if(cell.textContent == 'UNALLOCATED') { cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; } else if(cell.textContent.includes("SUPERVISOR_ACCESS_ONLY")) { cell.textContent = "SRW"; cell.style.backgroundColor = "Turquoise"; } else if(cell.textContent.includes("SUPERVISOR_READ_ONLY")) { cell.textContent = "SRO"; cell.style.backgroundColor = "GoldenRod"; } else if(cell.textContent.includes("READ_ONLY")) { cell.textContent = "RO"; cell.style.backgroundColor = "orange"; } else if(cell.textContent.includes("FULL_ACCESS")) { cell.textContent = "RW"; cell.style.backgroundColor = "LightGreen"; allocated = true; } else if(cell.textContent.includes("NO_ACCESS")) { cell.textContent = "D"; cell.style.backgroundColor = "Crimson"; } cell.id = "rowPeriph" + peripheralIndex + "_domain" + i + "_NS"; if(allocated) { domainsAllocated++; } } if(domainsAllocated > 0) { allocated_peripherals++; } if(domainsAllocated > 1) { row.style.backgroundColor = "orange"; shared_peripherals++; } peripheralIndex++; } total_peripherals = full_periph_list.length; full_periph_list.forEach(function(rowData) { if(tableData.find(x => x.peripheral_slot == rowData.trim())) { //skip } else { unallocated_peripherals++; row = table.insertRow(-1); // [-1] for last position in Safari cell = row.insertCell(); instanceXrdc = rowData.substring(0, rowData.indexOf("_", rowData.indexOf("_")+1)+1); newValue = instanceXrdc.substring(0, instanceXrdc.lastIndexOf("_"))+":"; cell.textContent = rowData.replace(instanceXrdc, newValue); cell.textContent += '*'; cell.title = 'Not allocated in the configurator'; cell.id = "rowPeriph" + peripheralIndex + "_id_undefined"; cell = row.insertCell(); cell.textContent = "0"; // UPDATE with correct PDAC cell.id = "rowPeriph" + peripheralIndex + "_pdac"; cell = row.insertCell(); cell.textContent = false; cell.id = "rowPeriph" + peripheralIndex + "_semaEnable"; cell = row.insertCell(); cell.textContent = 0; cell.id = "rowPeriph" + peripheralIndex + "_semaNumber"; for(var i = 0; i < domainCount; i++) { cell = row.insertCell(); cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; cell.id = "rowPeriph" + peripheralIndex + "_domain" + i + "_S"; cell = row.insertCell(); cell.textContent = "U"; cell.style.backgroundColor = "LightCoral"; cell.id = "rowPeriph" + peripheralIndex + "_domain" + i + "_NS"; } peripheralIndex++; } }); } function filter_memory_table(table, did) { var offset = 6; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { var match = []; for(var i = 0; i < did.length; i++) { var cellSecured = rows[row].getElementsByTagName("td")[offset + 2 * did[i]]; var cellNonSecured = rows[row].getElementsByTagName("td")[offset + 2 * did[i] + 1]; ConsoleLog(cellSecured.textContent); ConsoleLog(cellNonSecured.textContent); if((cellSecured.textContent == 'U') && (cellNonSecured.textContent == 'U')) { } else if((cellSecured.textContent == 'D') && (cellNonSecured.textContent == 'D')) { match.push(did[i]); } else { match.push(did[i]); } } if(match.length == 0) { ConsoleLog("Hiding row : " + row); rows[row].style.display = "none"; } else { ConsoleLog("Showing row : " + row); rows[row].style.display = ""; } } } function filter_peripheral_table(table, did) { var offset = 4; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { var match = []; for(var i = 0; i < did.length; i++) { var cellSecured = rows[row].getElementsByTagName("td")[offset + 2 * did[i]]; var cellNonSecured = rows[row].getElementsByTagName("td")[offset + 2 * did[i] + 1]; ConsoleLog(cellSecured.textContent); ConsoleLog(cellNonSecured.textContent); if((cellSecured.textContent == 'U') && (cellNonSecured.textContent == 'U')) { } else if((cellSecured.textContent == 'D') && (cellNonSecured.textContent == 'D')) { match.push(did[i]); } else { match.push(did[i]); } } if(match.length == 0) { ConsoleLog("Hiding row : " + row); rows[row].style.display = "none"; } else { ConsoleLog("Showing row : " + row); rows[row].style.display = ""; } } } function filter_domain_table(table, did) { var offset = 1; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { var master_name = rows[row].getElementsByTagName("td")[0].textContent; var match = false; for(var i = 0; i < did.length; i++) { var domain = rows[row].getElementsByTagName("td")[offset + did[i]]; if(domain.textContent != '-') { match = true; } } if(hide_unused_masters) { if(master_allocation_dict[master_name] == undefined) { rows[row].style.display = "none"; } } if(!match) { rows[row].style.display = "none"; } else { rows[row].style.display = ""; } } } function reset_domain_table(table) { var offset = 1; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { ConsoleLog("Showing row : " + row); rows[row].style.display = ""; } } function reset_memory_table(table) { var offset = 6; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { ConsoleLog("Showing row : " + row); rows[row].style.display = ""; } } function reset_peripheral_table(table) { var offset = 3; var rows = table.getElementsByTagName("tr"); for(var row = 0; row < rows.length; row++) { ConsoleLog("Showing row : " + row); rows[row].style.display = ""; } } function callback_did(event, item) { var id = event.target.id; ConsoleLog(id); if(peripheralContextActive) { peripheralContextActive = false; var ctx_menu = document.getElementById("peripheralContextMenu"); ctx_menu.style.visibility = "hidden"; } if(id.includes("_DID")) { var did = Number(id.substr(id.lastIndexOf('_DID') + 4, 2)); if(filters_active.includes(did)) { var index = filters_active.indexOf(did); filters_active.splice(index, 1); } else { filters_active.push(did); } filter_memory_table(document.getElementById("MemoryTable"), filters_active); filter_domain_table(document.getElementById("MasterTable"), filters_active); filter_peripheral_table(document.getElementById("PeripheralTable"), filters_active); if(filters_active.length > 0) { banner = document.getElementById('filter-hidden'); var newText = document.getElementById('FilterText'); if(newText != undefined) { banner.removeChild(newText); } var newButton = document.getElementById('clearButton'); if(newButton != undefined) { banner.removeChild(newButton); } newButton = document.createElement('button'); newButton.id = 'clearButton'; newButton.className = "banner-button"; newButton.textContent = "Clear filter"; newButton.addEventListener('click', clearButtonClick); newButton.addEventListener('mouseover', clearButtonOver); newButton.addEventListener('mouseout', clearButtonOut); newText = document.createElement('p'); newText.id = "FilterText"; newText.className = "banner-text"; newText.textContent = 'Filtering resources allocated to domain ID: ' + filters_active; banner.appendChild(newButton); banner.appendChild(newText); banner.className = "banner-parent"; } else { clearButtonClick(); } //document.getElementById('FilterText').style.visibility = 'visible'; } } function rightClick(event, id) { peripheralContextActive = true; //if(id.startsWith("rowPeriph")) //{ // if(id.includes("_domain")) // { // event.preventDefault(); // var ctx_menu = document.getElementById("peripheralContextMenu"); // ctx_menu.style.top = event.pageY - 10; // ctx_menu.style.left = event.pageX - 10; // ctx_menu.style.visibility = ""; // } //} } function clearButtonClick() { filters_active = []; if(hide_unused_masters) { var temp_filtered_list = new Array(domainCount); for(var cnt = 0; cnt < domainCount; cnt++) { temp_filtered_list[cnt] = cnt; } filter_domain_table(document.getElementById("MasterTable"), temp_filtered_list); filter_peripheral_table(document.getElementById("PeripheralTable"), temp_filtered_list); filter_memory_table(document.getElementById("MemoryTable"), temp_filtered_list); } else { reset_domain_table(document.getElementById("MasterTable")); reset_peripheral_table(document.getElementById("PeripheralTable")); reset_memory_table(document.getElementById("MemoryTable")); } banner = document.getElementById('filter-hidden'); banner.removeChild(document.getElementById('clearButton')); banner.removeChild(document.getElementById('FilterText')); } function clearButtonOver() { ConsoleLog("hover"); document.getElementById("clearButton").className="banner-button-hover"; } function clearButtonOut() { ConsoleLog("hover"); document.getElementById("clearButton").className = "banner-button"; } function filterButtonClick() { if(hide_unused_masters) { document.getElementById('filterButton').textContent = "Hide unallocated items"; if(filters_active.length > 0) { filter_domain_table(document.getElementById("MasterTable"), filters_active); filter_peripheral_table(document.getElementById("PeripheralTable"), filters_active); filter_memory_table(document.getElementById("MemoryTable"), filters_active); } else { reset_domain_table(document.getElementById("MasterTable")); reset_peripheral_table(document.getElementById("PeripheralTable")); reset_memory_table(document.getElementById("MemoryTable")); } } else { document.getElementById('filterButton').textContent = "Show unallocated items"; if(filters_active.length > 0) { filter_domain_table(document.getElementById("MasterTable"), filters_active); filter_peripheral_table(document.getElementById("PeripheralTable"), filters_active); filter_memory_table(document.getElementById("MemoryTable"), filters_active); } else { var temp_filtered_list = new Array(domainCount); for(var cnt = 0; cnt < domainCount; cnt++) { temp_filtered_list[cnt] = cnt; } filter_domain_table(document.getElementById("MasterTable"), temp_filtered_list); filter_peripheral_table(document.getElementById("PeripheralTable"), temp_filtered_list); filter_memory_table(document.getElementById("MemoryTable"), temp_filtered_list); } } hide_unused_masters = !hide_unused_masters; } function filterButtonOver() { ConsoleLog("hover"); document.getElementById("filterButton").className="filter-unallocated-button-hover"; } function filterButtonOut() { ConsoleLog("hover"); document.getElementById("filterButton").className = "filter-unallocated-button"; } function callback_mouse_over(item) { var node = document.getElementById(item); if(item.includes("_DID_")) { var did = Number(item.substr(item.lastIndexOf('_') + 1, 2)); var master = item.replace('rowDid_', ''); master = master.substr(0, master.lastIndexOf('_DID_')); var tooltipContents = 'Click me to see resources allocated to domain ' + did + '\n'; node.title = tooltipContents; } } function callback_mouse_out(item) { var id = event.target.id; if(id.includes("_DID_")) { var tip = document.getElementById('tooltip'); event.target.removeChild(tip); } } function create_did_table(descriptor_array) { master_list.forEach(function(elem) { master_dict[elem] = new Array(domainCount); total_masters++; for(var cnt = 0; cnt < domainCount; cnt++) { master_dict[elem][cnt] = new Array(2); master_dict[elem][cnt][0] = '-'; master_dict[elem][cnt][1] = null; } }); for (var iter = 0; iter < descriptor_array.length; iter++) { master_dict[descriptor_array[iter].name][descriptor_array[iter].domain_id][0] = 'x'; master_dict[descriptor_array[iter].name][descriptor_array[iter].domain_id][1] = iter; master_allocation_dict[descriptor_array[iter].name] = master_dict[descriptor_array[iter].name].flatMap(x => x[1]).filter(x => x != null).length; } var table = document.getElementById('MasterTable'); var row = {}; var cell = {}; header = ["Master"]; header_percent = [20]; var percentage_used = 0; for(var i = 0; i < header_percent.length; i++) { percentage_used += header_percent[i]; } for(var i = 0; i < domainCount; i++) { header.push("DID" + i); header_percent.push((100 - percentage_used)/domainCount); } var tableHeader=document.getElementById('MasterTable-header'); //row = table.insertRow(-1); // [-1] for last position in Safari for(var i = 0; i < header.length; i++) { cell = document.createElement('th'); cell.textContent = header[i]; cell.id = "didHead_" + header[i]; cell.style.width = header_percent[i] + "%"; cell.className = "table-head"; tableHeader.appendChild(cell); } var ordered_masters = []; for (var master in master_dict) { ordered_masters.push(master); } ordered_masters.sort(); for(var i = 0; i < ordered_masters.length; i++) { var master = ordered_masters[i]; var allocated_to_domains = false; row = table.insertRow(-1); // [-1] for last position in Safari cell = row.insertCell(); cell.id = "rowMaster_" + master; cell.style="text-align:left"; const regex = /(Xrdc_[A-Za-z0-9]+)_(.*)/; cell.textContent = master.replace(regex, "$1").toUpperCase() + master.replace(regex," : $2"); var domainsAllocated = 0; for(var did = 0; did < domainCount; did++) { cell = row.insertCell(); cell.textContent = master_dict[master][did][0]; cell.id = "rowDid_" + master + "_DID" + did; if(master_dict[master][did][0] == 'x') { cell.style.backgroundColor = "LightGreen"; allocated_to_domains = true; domainsAllocated++; } } if(allocated_to_domains == false) { unallocated_masters++; if(hide_unused_masters) { row.style.visibility="none"; } } else { allocated_masters++; } if(domainsAllocated > 1) { multidomain_masters++; } } } function setCallbacks() { document.body.onmousedown = function (e) { e = e || window.event; var elementId = (e.target || e.srcElement).id; callback_did(e, elementId); } document.body.onmouseover = function (e) { e = e || window.event; var elementId = (e.target || e.srcElement).id; callback_mouse_over(elementId); } document.body.onmouseout = function (e) { e = e || window.event; var elementId = (e.target || e.srcElement).id; //callback_mouse_out(elementId); } document.body.oncontextmenu = function (e) { e = e || window.event; var elementId = (e.target || e.srcElement).id; rightClick(e, elementId); } } window.onload = function() { if(xrdc_support_enabled) { create_mem_table(mem_descriptor_arr, memories_list); create_peripheral_table(periph_descriptor_arr, peripherals_list); create_did_table(master_descriptor_arr); setCallbacks(); document.getElementById('total_masters').textContent = "Total masters: " + total_masters; document.getElementById('configured_masters').textContent = "Configured masters: " + allocated_masters; document.getElementById('multidomain_masters').textContent = "Masters with multiple domains: " + multidomain_masters; document.getElementById('unallocated_masters').textContent = "Unallocated Masters: " + unallocated_masters; document.getElementById('total_memories').textContent = "Total Memories: " + total_memories; document.getElementById('configured_memories').textContent = "Configured Memories: " + allocated_memories; document.getElementById('shared_memories').textContent = "Shared Memories: " + shared_memories; document.getElementById('unallocated_memories').textContent = "Unallocated Memories: " + unallocated_memories; document.getElementById('total_peripherals').textContent = "Total Peripherals: " + total_peripherals; document.getElementById('configured_peripherals').textContent = "Configured Peripherals: " + allocated_peripherals; document.getElementById('shared_peripherals').textContent = "Shared Peripherals: " + shared_peripherals; document.getElementById('unallocated_peripherals').textContent = "Unallocated Peripherals: " + unallocated_peripherals; filter_hidden = document.getElementById('filter-hidden'); banner = document.getElementById('banner-links-parent'); newFilterButton = document.createElement('button'); newFilterButton.id = 'filterButton'; newFilterButton.className = "filter-unallocated-button"; newFilterButton.textContent = "Hide unallocated items"; newFilterButton.addEventListener('click', filterButtonClick); newFilterButton.addEventListener('mouseover', filterButtonOver); newFilterButton.addEventListener('mouseout', filterButtonOut); banner.appendChild(newFilterButton); document.getElementById("back_to_top").addEventListener("click", function(){ window.scrollTo(0,0) }); document.getElementById("back_to_top").addEventListener("mouseover", function(){ document.getElementById("back_to_top").style = "opacity:100%" }); document.getElementById("back_to_top").addEventListener("mouseout", function(){ document.getElementById("back_to_top").style = "opacity:35%" }); } else { document.getElementById('summary_title').textContent = 'XRDC support is disabled. Report is empty'; } }

Resource Manager Allocation Report

Summary of resource allocation:

Legend

Representation | Description
RW | Read Write
RO | Read Only
D | Access Denied
U | Unallocated - Access Denied
SRO | Supervisor read only
SRW | Supervisor read write
Xrdc_0_GTM | Shared peripheral/memory
Xrdc_0_GTM* | Peripheral/Memory is not allocated to any domain
DIDn NS | Domain ID n Non Secure Access
DIDn S | Domain ID n Secure Access
0x34602000 | Overlapped memory

Go to:

Masters Table Memories Table Peripherals Table

Master Allocation

Memory Allocation

Peripheral Allocation