memLayout() bank descriptot cleanup

This commit is contained in:
Sebastian Hildebrandt
2022-11-20 00:24:12 +01:00
parent 2cfd24e6e7
commit 6e7e6d5d04
4 changed files with 16 additions and 6 deletions
+6 -2
View File
@@ -323,12 +323,16 @@ function memLayout(callback) {
let lines = device.split('\n');
const sizeString = util.getValue(lines, 'Size');
const size = sizeString.indexOf('GB') >= 0 ? parseInt(sizeString, 10) * 1024 * 1024 * 1024 : parseInt(sizeString, 10) * 1024 * 1024;
let bank = util.getValue(lines, 'Bank Locator');
if (bank.toLowerCase().indexOf('bad') >= 0) {
bank = '';
}
if (parseInt(util.getValue(lines, 'Size'), 10) > 0) {
const totalWidth = util.toInt(util.getValue(lines, 'Total Width'));
const dataWidth = util.toInt(util.getValue(lines, 'Data Width'));
result.push({
size,
bank: util.getValue(lines, 'Bank Locator'),
bank,
type: util.getValue(lines, 'Type:'),
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
clockSpeed: (util.getValue(lines, 'Configured Clock Speed:') ? parseInt(util.getValue(lines, 'Configured Clock Speed:'), 10) : (util.getValue(lines, 'Speed:') ? parseInt(util.getValue(lines, 'Speed:'), 10) : null)),
@@ -343,7 +347,7 @@ function memLayout(callback) {
} else {
result.push({
size: 0,
bank: util.getValue(lines, 'Bank Locator'),
bank,
type: 'Empty',
ecc: null,
clockSpeed: 0,