fine tuned upgraded cpu arch detections

This commit is contained in:
Harald Hope 2018-09-10 19:30:33 -07:00
parent 7db2ab4dcf
commit 8a61811e82
2 changed files with 37 additions and 24 deletions

59
inxi
View file

@ -6938,7 +6938,7 @@ sub data_cpuinfo {
}
$cpu{'ids'} = (\@ids);
if ( $extra > 0 && !$cpu{'arch'} && $type ne 'short' ){
$cpu{'arch'} = cpu_arch($cpu{'type'},$cpu{'family'},$cpu{'model_id'});
$cpu{'arch'} = cpu_arch($cpu{'type'},$cpu{'family'},$cpu{'model_id'},$cpu{'rev'});
# cpu_arch comes from set_os()
$cpu{'arch'} = $cpu_arch if (!$cpu{'arch'} && $cpu_arch && ($b_mips || $b_arm || $b_ppc));
#print "$cpu{'type'},$cpu{'family'},$cpu{'model_id'},$cpu{'arch'}\n";
@ -7628,9 +7628,10 @@ sub system_cpu_name {
sub cpu_arch {
eval $start if $b_log;
my ($type,$family,$model) = @_;
my ($type,$family,$model,$stepping) = @_;
$stepping = 0 if !main::is_numeric($stepping);
my $arch = '';
# https://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures
# See: docs/inxi-resources.txt
# print "$type;$family;$model\n";
if ( $type eq 'amd'){
if ($family eq '4'){
@ -7687,9 +7688,12 @@ sub cpu_arch {
else {$arch = 'Jaguar'}
}
elsif ($family eq '17'){
if ( $model =~ /^(1)$/ ) {$arch = 'Zen'}
if ( $model =~ /^(1|11)$/ ) {$arch = 'Zen'}
elsif ( $model =~ /^(8)$/ ) {$arch = 'Zen+'}
elsif ( $model =~ /^2[0123456789ABCDEF]$/ ) {$arch = 'Zen 2'}
else {$arch = 'Zen'}
}
# coming: zen 2, zen 3
}
elsif ( $type eq 'arm'){
if ($family ne ''){$arch="ARMv$family";}
@ -7713,7 +7717,6 @@ sub cpu_arch {
elsif ( $model =~ /^(F)$/ ) {$arch = 'Isaiah'}
}
}
# https://software.intel.com/en-us/articles/intel-architecture-and-processor-identification-with-cpuid-model-and-family-numbers
elsif ( $type eq 'intel'){
if ($family eq '4'){
if ( $model =~ /^(0|1|2|3|4|5|6|7|8|9)$/ ) {$arch = '486'}
@ -7725,49 +7728,56 @@ sub cpu_arch {
}
elsif ($family eq '6'){
if ( $model =~ /^(1)$/ ) {$arch = 'P6 Pro'}
elsif ( $model =~ /^(15)$/ ) {$arch = 'Dothan Tolapai'} # pentium M system on chip
elsif ( $model =~ /^(15)$/ ) {$arch = 'M Tolapai'} # pentium M system on chip
elsif ( $model =~ /^(3)$/ ) {$arch = 'P6 II Klamath'}
elsif ( $model =~ /^(5)$/ ) {$arch = 'P6 II Deschutes'}
elsif ( $model =~ /^(6)$/ ) {$arch = 'P6 II Mendocino'}
elsif ( $model =~ /^(7)$/ ) {$arch = 'P6 III Katmai'}
elsif ( $model =~ /^(8)$/ ) {$arch = 'P6 III Coppermine'}
elsif ( $model =~ /^(9)$/ ) {$arch = 'Banias'} # pentium M
elsif ( $model =~ /^(9)$/ ) {$arch = 'M Banias'} # pentium M
elsif ( $model =~ /^(A)$/ ) {$arch = 'P6 III Xeon'}
elsif ( $model =~ /^(B)$/ ) {$arch = 'P6 III Tualitin'}
elsif ( $model =~ /^(D)$/ ) {$arch = 'Dothan'} # Pentium M
elsif ( $model =~ /^(E)$/ ) {$arch = 'Yonah'}
elsif ( $model =~ /^(F|16)$/ ) {$arch = 'Merom'}
elsif ( $model =~ /^(D)$/ ) {$arch = 'M Dothan'} # Pentium M
elsif ( $model =~ /^(E)$/ ) {$arch = 'M Yonah'}
elsif ( $model =~ /^(F|16)$/ ) {$arch = 'Core Merom'}
elsif ( $model =~ /^(17|1D)$/ ) {$arch = 'Penryn'}
elsif ( $model =~ /^(1A|1E|1F|2E|25|2C|2F)$/ ) {$arch = 'Nehalem'}
elsif ( $model =~ /^(1C)$/ ) {$arch = 'Bonnell'} # atom Bonnell? 27?
elsif ( $model =~ /^(27|35)$/ ) {$arch = 'Saltwell'}
elsif ( $model =~ /^(26|1C)$/ ) {$arch = 'Bonnell'} # atom Bonnell? 27?
elsif ( $model =~ /^(27|35|36)$/ ) {$arch = 'Saltwell'}
elsif ( $model =~ /^(25|2C|2F)$/ ) {$arch = 'Westmere'}
elsif ( $model =~ /^(26)$/ ) {$arch = 'Atom Lincroft'}
elsif ( $model =~ /^(2A|2D)$/ ) {$arch = 'Sandy Bridge'}
elsif ( $model =~ /^(36)$/ ) {$arch = 'Atom Cedarview'}
elsif ( $model =~ /^(37|4A|4D|5A)$/ ) {$arch = 'Silvermont'}
elsif ( $model =~ /^(37|4A|4D|5A|5D)$/ ) {$arch = 'Silvermont'}
elsif ( $model =~ /^(3A|3E)$/ ) {$arch = 'Ivy Bridge'}
elsif ( $model =~ /^(3C|3F|45|46)$/ ) {$arch = 'Haswell'}
elsif ( $model =~ /^(3D|47|4F|56)$/ ) {$arch = 'Broadwell'}
elsif ( $model =~ /^(4E|55|9E)$/ ) {$arch = 'Skylake'}
elsif ( $model =~ /^(4E|55)$/ ) {$arch = 'Skylake'} # had 9E
elsif ( $model =~ /^(5C|5F)$/ ) {$arch = 'Goldmont'}
elsif ( $model =~ /^(5E)$/ ) {$arch = 'Skylake-S'}
elsif ( $model =~ /^(4C|5D)$/ ) {$arch = 'Airmont'}
elsif ( $model =~ /^(8E|9E)$/ ) {$arch = 'Kaby Lake'}
elsif ( $model =~ /^(4C)$/ ) {$arch = 'Airmont'}
elsif ( $model =~ /^(7A)$/ ) {$arch = 'Goldmont Plus'}
elsif ( $model =~ /^(7E)$/ ) {$arch = 'Ice Lake'}
elsif ( $model =~ /^(8E|9E)$/ ) {
if ($stepping > 9){$arch = 'Coffee Lake'}
else {$arch = 'Kaby Lake'} }
elsif ( $model =~ /^(9E)$/ ) {$arch = 'Coffee Lake'}
elsif ( $model =~ /^(57)$/ ) {$arch = 'Knights Landing'}
elsif ( $model =~ /^(66)$/ ) {$arch = 'Cannon Lake'}
elsif ( $model =~ /^(85)$/ ) {$arch = 'Knights Mill'}
# product codes: https://en.wikipedia.org/wiki/List_of_Intel_microprocessors
# coming: coffee lake; cannonlake; icelake; tigerlake
elsif ( $model =~ /^(865)$/ ) {$arch = 'Tremont'}
# coming: alder lake; amber lake; cannonlake; cascade lake; coffee lake;
# granite rapids; icelake; meteor lake; saphire rapids; tigerlake,
}
# itanium 1 family 7 all recalled
elsif ($family eq 'B'){
if ( $model =~ /^(1)$/ ) {$arch = 'Knights Corne'}
if ( $model =~ /^(0)$/ ) {$arch = 'Knights Ferry'}
if ( $model =~ /^(1)$/ ) {$arch = 'Knights Corner'}
}
elsif ($family eq 'F'){
if ( $model =~ /^(0|1)$/ ) {$arch = 'Netburst Willamette'}
elsif ( $model =~ /^(2)$/ ) {$arch = 'Netburst Northwood'}
elsif ( $model =~ /^(3)$/ ) {$arch = 'Prescott'} # 6? Nocona
elsif ( $model =~ /^(4)$/ ) {$arch = 'Smithfield'} # 6? Nocona
elsif ( $model =~ /^(6)$/ ) {$arch = 'Presler'}
elsif ( $model =~ /^(3)$/ ) {$arch = 'Netburst Prescott'} # 6? Nocona
elsif ( $model =~ /^(4)$/ ) {$arch = 'Netburst Smithfield'} # 6? Nocona
elsif ( $model =~ /^(6)$/ ) {$arch = 'Netburst Presler'}
else {$arch = 'Netburst'}
}
}
@ -17242,6 +17252,7 @@ sub set_dmidecode_data {
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/dmidecode/pci-freebsd-8.2-2";
# my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/dmidecode/dmidecode-loki-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/dmidecode/dmidecode-t41-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/dmidecode/dmidecode-mint-20180106.txt";
#open my $fh, '<', $file or die "can't open $file: $!";
#chomp(@data = <$fh>);
}

View file

@ -37,6 +37,8 @@ test dmidecode data from text files using debugger switches internally.
cache data from dmidecode and shows it. I didn't realize that data was there, not
sure how I'd missed it all these years, I guess pinxi really is much easier to work
on! This only runs if user has dmidecode permissions from root or sudo.
6. Brought cpu architectures up to date, new intel, new amd. Note there's a slight
confusion about what is coffee lake and what is kaby lake.
-----------------------------------
-- Harald Hope - Mon, 10 Sep 2018 15:00:17 -0700