#!/usr/bin/perl ######################################################## # This file creates the CPU Graveyard's website # # Feel free to used it for your site, in whole or any pieces, # in acordance with GPL. IE give me credit. See below. If you do # use the entire code for ur collections page, please use a # different color scheme and title so it will be distiguishable # from 'the CPU Graveyard'. Much of the text has been moved # to 'chip_html_include.pl', so the file isn't as large, easier # to work with. # # Copyright 2008-2012, Jeff Israel, http://www.happytrees.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # see # my $URL = "https://happytrees.org/chips/"; print "Status: 301 Moved\nLocation: $URL\n\n"; exit; use File::stat; use Time::localtime; use Switch; use Archive::Zip; # use Spreadsheet::Read; print "Content-type:text/html\n\n"; ############################# # Config # $version = 'v2.10'; $scriptName = $ENV{'SCRIPT_NAME'}; $serverName = $ENV{'SERVER_NAME'}; $spreadsheetFileName = "chipCollection-v1.03.ods"; $extended_code_include_file = 'chip_html_include-v2.pl'; $familyErasOrderedFileName = 'familyErasOrdered.txt'; $imageLoc = 'main-images'; $photoLoc = 'main-images/chip-v2'; $thumbLoc = 'main-images/chip-v2/sm'; $board_loc = 'main-images/boards-v1'; $board_thumb_loc= 'main-images/boards-v1/sm'; $code_loc = 'http://www.happytrees.org/cgi-bin/chipParse-source.pl'; $logoLoc = 'main-images/ic-manuf-logos'; $datasheet_loc = 'main-files/datasheets'; $skipLines = 1; $chip_page_number = 0; $manuf_page_number = 1; $family_page_number = 2; $board_page_number = 3; $varient_page_number = 4; @manuf_others_list_global = ('2WIRE','ATI','Alcatel','Broadcom','Conexant','Microsoft','Virata','Zarlink','Zoran','nVIDIA','General Instruments','Nintendo','Sega','GPS','ELAN','ADMtek','Sanyo','STC','Temic','Novatek','Matsushita'); ###################################################### ############## Coding ################################ ###################################################### sub check_script_location { my @scriptParts = split(/\//,$scriptName); $relativeLoc = '.'; if($scriptName =~ /\//) { @scriptParts = split(/\//,$scriptName); # print "$#scriptParts $scriptParts[$#scriptParts]
\n"; $scriptName = $scriptParts[$#scriptParts]; if($#scriptParts > 1) { $relativeLoc = '..'; } } } ################## Import ARGS ############## sub read_input { local ($buffer, @pairs, $pair, $name, $value, %FORM); # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } # $buffer = 'page=manufacturer&manufacturer=AMD&family=AM29000'; # Split information into name/value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%(..)/pack("C", hex($1))/eg; $FORM{$name} = $value; } %FORM; } ###############Inport ARGS (end) ################## ################################################## ############### Reading Files #################### #open file sub openFile { my $fileName = $_[0]; open(FILEVARIABLE, "< $fileName"); @fileLines= ; close(FILEVARIABLE); return @fileLines; } sub bbl_sort { # my (@a, @b) = @_; my @array = @_; # print_2d(@array); my $row_sort = 0; # my $array2 = @{$_[1]}; my $not_complete = 1; my $index; my $len = ($#{$array[$row_sort]} - 2); # print "|sub=" . scalar @array . " -- " . scalar @array2 . "|"; while ($not_complete) { $not_complete = 0; foreach $index (0 .. $len) { if ($array[$row_sort][$index] > $array[$row_sort][$index + 1]) { my $temp = $array[0][$index + 1]; my $temp2 = $array[1][$index + 1]; $array[0][$index + 1] = $array[0][$index]; $array[1][$index + 1] = $array[1][$index]; $array[0][$index] = $temp; $array[1][$index] = $temp2; $not_complete = 1; # print @array2[$index]; } } } return (@array); } sub parse_ods { my $file = $_[0]; my @sheets = (); my @data = (); my $sheet_num=0; my $row_num=0; my $col_num=0; my $col_repeated=0; my $zip = Archive::Zip->new($file); my $content=$zip->contents('content.xml'); $content =~ s/<\?xml .*\?>\n//; $content =~ s/^.*//; $content =~ s/<\/office:spreadsheet>.*$//; $content =~ s/.*<\/table:named-expressions>//; $content =~ s/.*<\/table:database-ranges>//; #keep greedy? $content =~ s/<\/table:table-cell>//; #maybe not neeeded $content =~ s/<\/table:table-row>//; #maybe not neeeded # $content =~ s///; @sheets = split(//,$content); shift(@sheets); #skips the first _blank_ element foreach $sheet (@sheets) { $row_num=-1; foreach $row (split(//,$sheet)) { if ($row_num != -1) { #skips first element $col_num=-1; foreach $cell ( split(// ) { $cell_content =~ s/.*//; $cell_content =~ s/<\/text:p>.*//; } else { # no content in cell $cell_content = ''; } if ($cell =~ /number-columns-repeated/) { # repeat cells contents n-times $col_repeated = $cell; $col_repeated =~ s/table:number-columns-repeated="//; $col_repeated =~ s/".*//; for (my $x=1;$x<=$col_repeated;$x++) { # removes trailling whitespace/new line # $data[$sheet_num][$row_num][$col_num]= ( $cell_content =~ s/[\s\n]*$//); # $col_num++; # print "<<<$cell_content $data[$sheet_num][$row_num][$col_num]>>> || \n"; $data[$sheet_num][$row_num][$col_num]=$cell_content; $data[$sheet_num][$row_num][$col_num] =~ s/[\s\n]*$//g; $col_num++; } } else { # no repeated cols # removes trailling whitespace/new line # $data[$sheet_num][$row_num][$col_num]= ( $cell_content =~ s/[\s\n]*$//); $data[$sheet_num][$row_num][$col_num]=$cell_content; $data[$sheet_num][$row_num][$col_num] =~ s/[\s\n]*$//g; $col_num++; # print "<<<$cell_content $data[$sheet_num][$row_num][$col_num]>>> || \n"; } } } } $row_num++ } $sheet_num++; } return @data; } ############# Reading Files (end) ################## #################################################### ######################################################## ################# Processing Data ###################### sub getColLabels { my $col=0; while ( &chipData2(0,$col) ) { print "(((" . &chipData2(0,$col) . ")))"; switch (&chipData2(0,$col)) { case "My Label" {$colJeffLable=$col} case "#" {$colTotal =$col} case "Trade" {$colTrade =$col} case "Manufacturer" {$colManuf =$col} case "Part #" {$colPart =$col} case "Type" {$colType =$col} case "Family" {$colFamily =$col} case "Core" {$colCore =$col} case "Architecture" {$colArch =$col} case "Bus Width" {$colDataBus=$col} case "Address Width" {$colAddBus=$col} case "Speed" {$colSpeed =$col} case "blank" {$colBlank =$col} case "FPU" {$colFPU =$col} case "L1 cache" {$colL1 =$col} case "L2 cache" {$colL2 =$col} case "L3 cache" {$colL3 =$col} case "Package" {$colPack =$col} case "Transistors" {$colTrans =$col} case "Process Size" {$colProc =$col} case "Technology" {$colTech =$col} case "Die Size" {$colDie =$col} case "Vcc" {$colVcc =$col} case "Vcc (I/O)" {$col_volt_io =$col} case "Power Max" {$col_power =$col} case "Date Introduced" {$colDate=$col} case "Condition" {$colCond =$col} case "Variants" {$colVar =$col} case "Description" {$colDesc =$col} case "Photo 1" {$colPhoto1 =$col} case "Photo 2" {$colPhoto2 =$col} case "Photo 3" {$colPhoto3 =$col} case "Photo 4" {$colPhoto4 =$col} case "Photo 5" {$colPhoto5 =$col} case "Datasheet" {$col_datasheet =$col} case "Label ID" {$col_label_id =$col} case "Alt ID" {$col_alt_id =$col} case "ROM Int" {$col_rom_int =$col} case "ROM type" {$col_rom_type =$col} case "RAM Int" {$col_ram_int =$col} case "RAM Max" {$col_ram_max =$col} case "RAM type" {$col_ram_type =$col} case "Socket" {$col_socket =$col} case "Features" {$col_features =$col} case "# Cores" {$col_num_cores =$col} case "Designer of Core" {$col_designer =$col} case "Bus speed" {$col_bus_speed =$col} case "Applications" {$col_applications = $col} case "Instruction set" {$col_instruction_set = $col} case "Instruction link" {$col_instruction_link = $col} case "Computer architecture"{$col_computer_architecture = $col} case "Microarchitecture" {$col_microarchitecture = $col} case "ISA" {$col_isa = $col} # case "" {$col_ = $col} # case "" {$col_ = $col} # case "" {$col_ = $col} # case "" {$col_ = $col} else {} } $col++; } $col=1; while ( &manufData2(0,$col) ) { # print &chipData2(1,$col) . ", "; switch (&manufData2(0,$col)) { case "Short name" {$colManufName =$col} case "Abrev" {$colManufAbrev =$col} case "Full name" {$colManufFullName =$col} case "Date" {$colManufDate =$col} case "Homepage" {$colManufHomepage =$col} case "Wiki" {$colManufWiki =$col} case "Traditional" {$colManufTrad =$col} case "Current" {$colManufCurrent =$col} case "Status" {$colManufStatus =$col} case "Description" {$colManufDesc =$col} case "Wide logo" {$colManufWideLogo =$col} case "Logo1" {$colManufLogo1 =$col} case "Logo2" {$colManufLogo2 =$col} case "Logo3" {$colManufLogo3 =$col} case "Logo4" {$colManufLogo4 =$col} case "Logo5" {$colManufLogo5 =$col} else {} } $col++; } $col=1; while ( &familyData2(0,$col) ) { # print &chipData2(1,$col) . ", "; switch (&familyData2(0,$col)) { case "Var" {$colFamilyName =$col} case "Full name" {$colFamilyFullName =$col} case "Manuf" {$colFamilyManuf =$col} case "Date" {$colFamilyDate =$col} case "Chip" {$colFamilyChip =$col} #maybe dont use case "Arch" {$colFamilyArch =$col} case "Freq range" {$colFamilyFreq =$col} case "Technology" {$colFamilyTech =$col} case "# Intructions" {$colFamilyIntrucNum =$col} case "Int Set Name" {$colFamilyInstrucName =$col} case "Intruction link" {$colFamilyInstrucLink =$col} case "Description" {$colFamilyDesc =$col} case "Core arch" {$colFamilyCoreArch =$col} case "Wiki" {$colFamilyWiki =$col} case "Homepage" {$colFamilyHomepage =$col} case "Logo" {$colFamilyLogo =$col} else {} } $col++; } $col=1; while ( &wanted_data(0,$col) ) { # print &chipData2(1,$col) . ", "; switch (&wanted_data(0,$col)) { case "Manufacture" {$col_wanted_man =$col} case "Part #" {$col_wanted_part =$col} else {} } $col++; } $col=1; while ( &board_data(0,$col) ) { # print &chipData2(1,$col) . ", "; switch (&board_data(0,$col)) { case "Board type" {$col_board_type =$col} case "Type" {$col_board_type =$col} case "Manuf" {$col_board_manuf =$col} case "Name" {$col_board_name =$col} case "Chip manuf" {$col_board_chip_manuf=$col} case "Chip part" {$col_board_chip_part =$col} case "Chip type" {$col_board_chip_type =$col} case "Speed" {$col_board_speed =$col} case "Arch width" {$col_board_arch_width=$col} case "Socket" {$col_board_socket =$col} case "Ports" {$col_board_ports =$col} case "Computers" {$col_board_computers =$col} case "Features" {$col_board_features =$col} case "Description" {$col_board_desc =$col} case "Photo front" {$col_board_photo_front=$col} case "Photo back" {$col_board_photo_back=$col} case "Manuf p1" {$col_board_manuf_p1 =$col} case "Part p1" {$col_board_part_p1 =$col} case "Func p1" {$col_board_func_p1 =$col} case "Manuf p2" {$col_board_manuf_p2 =$col} case "Part p2" {$col_board_part_p2 =$col} case "Func p2" {$col_board_func_p2 =$col} case "Manuf p3" {$col_board_manuf_p3 =$col} case "Part p3" {$col_board_part_p3 =$col} case "Func p3" {$col_board_func_p3 =$col} case "Manuf p4" {$col_board_manuf_p4 =$col} case "Part p4" {$col_board_part_p4 =$col} case "Func p4" {$col_board_func_p4 =$col} case "Manuf p5" {$col_board_manuf_p5 =$col} case "Part p5" {$col_board_part_p5 =$col} case "Func p5" {$col_board_func_p5 =$col} case "Manuf p6" {$col_board_manuf_p6 =$col} case "Part p6" {$col_board_part_p6 =$col} case "Func p6" {$col_board_func_p6 =$col} case "Manuf p7" {$col_board_manuf_p7 =$col} case "Part p7" {$col_board_part_p7 =$col} case "Func p7" {$col_board_func_p7 =$col} case "Manuf p8" {$col_board_manuf_p8 =$col} case "Part p8" {$col_board_part_p8 =$col} case "Func p8" {$col_board_func_p8 =$col} case "Manuf p9" {$col_board_manuf_p9 =$col} case "Part p9" {$col_board_part_p9 =$col} case "Func p9" {$col_board_func_p9 =$col} case "Datasheet" {$col_board_datasheet =$col} else {} } $col++; } } sub getColChipData { my $row=$skipLines; my @manufList = (); my @familyList = (); @manufListGlobal = (); @familyListGlobal = (); print "<<< $colPart >>> &chipData2(4,$colPart) |||||"; while (&chipData2($row,$colPart) ne '') { #Makes a list of manuf and fams $manufList[$row-1]=&chipData2($row,$colManuf); $familyList[$row-1]=&chipData2($row,$colFamily); # This makes a list and count of manuf if ($manufListCountGlobal{&chipData2($row,$colManuf)} eq '') { $manufListCountGlobal{&chipData2($row,$colManuf)} =1; } else { $manufListCountGlobal{&chipData2($row,$colManuf)}++; } # Count families for this manufacturer if ( &chipData2($row,$colManuf) eq $data{'manufacturer'} ) { if (&chipData2($row,$colFamily) eq '') { $fam='Other'; } else {$fam=&chipData2($row,$colFamily);} if ( $manufFamilyCountGlobal{$fam} eq '' ) { $manufFamilyCountGlobal{$fam} = 1; } else { $manufFamilyCountGlobal{$fam}++; } } $row++; } $totalChipCountGlobal=$row; undef %saw; @saw{@manufList} = (); @manufListGlobal = sort keys %saw; undef %saw; @saw{@familyList} = (); @familyListGlobal = sort keys %saw; $totalManufCountGlobal=$#manufListGlobal+1; $totalFamilyCountGlobal=$#familyListGlobal+1; @manufFamilies = keys %manufFamilyCountGlobal; &sortManufFamilies(%manufFamilyCountGlobal); } sub sortManufFamilies { #this creating two ordered arrays, organized by era to print prettylike # @manufFamilyListGlobal # @manufFamilyListCountGlobal my %manufFamilyCount = %manufFamilyCountGlobal; # $_[0]??? my $x=0; my $hasOther=0; my $isInList=0; foreach $famEra (@chipErasGlobal) { #sorts the families included in chipEras list if ($manufFamilyCount{$famEra} ne '' ) { $manufFamilyListGlobal[$x]=$famEra; $manufFamilyListCountGlobal[$x]=$manufFamilyCount{$famEra}; $x++; } } foreach $manufFamily (keys %manufFamilyCount) { $isInList=0; if ($manufFamily eq 'Other') { $hasOther=1; $isInList=1; #a bypass } else { foreach $famEra (@chipErasGlobal) { if ( $manufFamily eq $famEra){ $isInList=1; } } } if ($isInList == 0){ #is its not in the list, add it $manufFamilyListGlobal[$x]=$manufFamily; $manufFamilyListCountGlobal[$x]=$manufFamilyCount{$manufFamily}; $x++; } } if ($hasOther == 1) { #Adds Other to list $manufFamilyListGlobal[$x]='Other'; $manufFamilyListCountGlobal[$x]=$manufFamilyCount{'Other'}; $x++ } if ($x >= 2) { unshift(@manufFamilyListGlobal, "All"); unshift(@manufFamilyListCountGlobal, "null"); } } # not currently used sub sort_family_by { my $sort_element = $_[0]; my %families_sort = (); my $row = $skipLines; my $col = ''; switch ($sort_element) { case "data-width" { $col = $colArch; } case "arch" { $col = $col_computer_architecture; } case "tech" { $col = $colTech; } # case "family" { $col = $colFamily; } case "app" { $col = $col_applications; } case "microarch" { $col = $col_microarchitecture; } # case "" { $col = $; } # case "" { $col = $; } # case "" { $col = $; } # case "" { $col = $; } else { $col = 'X'; } } print "$sort_element:$col"; if ( $col eq 'X' ) { print "Error: invalid sort elements.
\n"; } else { while (&chipData2($row,$colPart) ne '') { if ( (&chipData2($row,$col) ne '' || &chipData2($row,$col) ne '?' || &chipData2($row,$col) ne 'Other') && (&chipData2($row,$colFamily) ne '' || &chipData2($row,$colFamily) ne '?' || &chipData2($row,$colFamily) ne 'Other') ) { # print "."; if ( $families_sort{&chipData2($row,$col)} eq '' ) { $families_sort{&chipData2($row,$col)} = &chipData2($row,$colFamily); } elsif ( $families_sort{&chipData2($row,$col)} !~ /&chipData2($row,$colFamily)/ ) { $families_sort{&chipData2($row,$col)} .= '=' . &chipData2($row,$colFamily); # print "-"; } # print $families_sort{&chipData2($row,$col)}; $row++; } } } # for my $key ( keys %families_sort ) { # my $value = $families_sort{$key}; # print "
$key => $value\n"; # } return(%families_sort); } ############### Process Data (end) ###################### ######################################################### # # sub chipData2 { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; # print "[[[ $chip_page_number ]]] $spreadsheetData[$chip_page_number][2][4];"; return $spreadsheetData[$chip_page_number][$row][$col]; # return $chipListSpreadsheet->[1]{cr2cell($col,$row)}; } sub manufData2 { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; return $spreadsheetData[$manuf_page_number][$row][$col]; # return $chipListSpreadsheet->[2]{cr2cell($col,$row)}; } sub familyData2 { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; return $spreadsheetData[$family_page_number][$row][$col]; # return $chipListSpreadsheet->[3]{cr2cell($col,$row)}; } sub wanted_data { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; return $spreadsheetData[3][$row][$col]; # return $chipListSpreadsheet->[3]{cr2cell($col,$row)}; } sub board_data { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; return $spreadsheetData[$board_page_number][$row][$col]; } sub computer_data { # Format: $cellContents = &chipData2($row,$col) my $col = $_[1]; my $row = $_[0]; return $spreadsheetData[5][$row][$col]; } ######### Process list (end) ############################ sub grapGlobals { # $totalChipCountGlobal=1; $pageTypeGlobal = $data{'page'}; # manufacturer # fullList # tradeList $selectedManufglobal = $data{'manufacturer'}; $selectedFamilyGlobal = $data{'family'}; } sub wikify { # makes wikipedia links my $text=$_[0]; my $url='http://en.wikipedia.org/wiki/'; @linkables = qw(CMOS NMOS PMOS CHMOS HMOS PSoC EPROM BIOS I2C); foreach $link (@linkables) { $text =~ s/ $link / $link<\/a> /; } # PLD prigrammable logic device # flash Flash memory # PAL Programmable Array Logic # ASIC Application-specific integrated circuit # DRAM Dynamic random access memory # SRAM Static random access memory # SPI Serial Peripheral Interface # SCI Serial Communication Interface # GPIO General Purpose Input/Output # CAN Controller-area network # ADC Analog-to-digital converter # DAC digital-to-analog converter } sub does_page_exist { $page_DNE_global = 'FALSE'; # Is it a false page type? if($data{'page'} ne "fullList" && $data{'page'} ne "tradeList" && $data{'page'} ne "family" && $data{'page'} ne "manufacturer" && $data{'page'} ne "chip" && $data{'page'} ne "sneezmale" && $data{'page'} ne "site_map" && $data{'page'} ne "cat" && $data{'page'} ne "glossary" && $data{'page'} ne "board" && $data{'page'} ne ""){ $page_DNE_global = 'TRUE'; $page_DNE_title_global = "404: Page Type Not Found"; } # $data{'page'} = 'manufacturer'; # $data{'manufacturer'} = '2WIRE'; # $data{'family'} = ''; # print "$data{'page'} $data{'manufacturer'} $data{'family'}\n"; my $x=$skipLines; my $page_found = 0; while(&chipData2($x,$colPart) ne "") { my $manuf=&chipData2($x,$colManuf); my $family=&chipData2($x,$colFamily); my $part=&chipData2($x,$colPart); # print "$page_found -> $manuf <> $family <> $part \n"; # Does the chip exist ? if($data{'page'} eq "chip" && $data{'manufacturer'} eq $manuf && $data{'part'} eq $part){ $page_found = 1; #print "A\n"; } # Does the Manufacturer exist? if($data{'page'} eq "manufacturer" && $data{'family'} eq "" && $data{'manufacturer'} eq $manuf){ $page_found = 1; #print "B\n"; } # If the Manufacturer is others its ok if($data{'page'} eq "manufacturer" && $data{'manufacturer'} eq 'Others'){ $page_found = 1; #print "B\n"; } # Does the Manufacturer's Family exist? if($data{'page'} eq "manufacturer" && $data{'family'} eq $family && $data{'manufacturer'} eq $manuf){ $page_found = 1; #print "C\n"; } # Does the Family exist? if($data{'page'} eq "family" && $data{'family'} eq $family){ $page_found = 1; #print "D\n"; } $x++; } if($page_found == 0){ $page_DNE_global = 'TRUE'; #print "Pow\n"; if($data{'page'} eq "chip"){ $page_DNE_title_global = "404: Chip Not Found"; } elsif($data{'page'} eq "manufacturer" && $data{'family'} eq ""){# Does the Manufacturer exist? $page_DNE_title_global = "404: Chip Manufacturer Not Found"; } elsif($data{'page'} eq "manufacturer" && $data{'family'} ne ""){ # Does the Manufacturer's Family exist? $page_DNE_title_global = "404: Chip manufacturer's Family Not Found"; } elsif($data{'page'} eq "family"){ # Does the Family exist? $page_DNE_title_global = "404: Family Not Found"; } } } ################################################### ####### Coding (End) ############################## ################################################### ############################################################ ###################### HTML ################################ ############################################################ ###################################### ############## Tables ################ ###################################### sub displayTableData2 { # displays table from multichip list my $row = $_[0], $flipColor=$_[1], $thumb; #&chipData2($row,...) my $sort_element = ''; my $manufTableSub = &chipData2($row,$colManuf); my $type = &chipData2($row,$colType); my $part = &chipData2($row,$colPart); my $photo = "PHOTO
To be added\n"; my $family = ''; my $speed = '?'; my $arch = '?'; my $data = '?'; my $address = '?'; my $package = '?'; my $trans = '?'; my $tech = '?'; my $proc = '?'; my $die = '?'; my $volt = '?'; my $date = '?'; my $L1 = '?'; my $L2 = '?'; my $L3 = '?'; my $max_ram = '?'; my $socket = '?'; my $ram_int = '?'; my $rom_int = '?'; my $fpu = '?'; my $core = '?'; my $datasheet = '?'; my $features = '?'; my $num_cores = '?'; my $core_designer = '?'; my $text = ''; my $chip_link_part_var = $part; $chip_link_part_var =~ s/\W/_/g; my $chip_link = "
"; my $img_alt_text = $manufTableSub . " " . $part; if (&chipData2($row,$colPhoto1) ne ""){ $photoFile = &chipData2($row,$colPhoto1); $thumb = $photoFile . '_sm.jpg'; $photo = "$chip_link\"$img_alt_text\"\n"; if (&chipData2($row,$colPhoto2) ne ""){ $photoFile = &chipData2($row,$colPhoto2); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
\n\t\t\t$chip_link\"$img_alt_text\"\n"; } if (&chipData2($row,$colPhoto3) ne ""){ $photoFile = &chipData2($row,$colPhoto3); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
\n\t\t\t$chip_link\"$img_alt_text\"\n"; } if (&chipData2($row,$colPhoto4) ne ""){ $photoFile = &chipData2($row,$colPhoto4); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
\n\t\t\t$chip_link\"$img_alt_text\"\n"; } if (&chipData2($row,$colPhoto5) ne ""){ $photoFile = &chipData2($row,$colPhoto5); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
\n\t\t\t$chip_link\"$img_alt_text\"\n"; } } if ( &chipData2($row,$colFamily) ne "" && &chipData2($row,$colFamily) ne "Other") { $family = &chipData2($row,$colFamily); } if ( &chipData2($row,$colSpeed) ne '' ) { $speed = &chipData2($row,$colSpeed); } if ( &chipData2($row,$colArch) ne '' ) { # if ( &chipData2($row,$colArch) eq '16/32' ) { # $arch = "16/32-bit"; # } else { # $arch = "" . &chipData2($row,$colArch) . "-bit"; # } $arch = &chipData2($row,$colArch) . "-bit" ; } if ( &chipData2($row,$colDate) ne '' ) { $date = &chipData2($row,$colDate); } if ( &chipData2($row,$colCore) ne '' ) { $core = &chipData2($row,$colCore); } $text .= "\t\n"; $text .= "\t\n"; # if ( $flipColor == 0 ) { # $text .= "\t\n"; # }else{ # $text .= "\t\n"; # } $text .= "\t\t\n\t\t\t$photo\n\t\t\n"; $text .= "\t\t\n"; $text .= "\t\t\t
$chip_link$manufTableSub $part


\n"; # $text .= "\t\t\t
"; # if ($type ne '') { # $text .= "$type"; # } # if ($family ne '') { # $text .= " of the $family Family"; # } # $text .= "
\n"; $text .= < General Specifications: Type: $type Family: $family Speed: $speed Architecture: $arch Introduced: $date
$chip_link Full details... Endhtml $text .= "\t\n"; # if ( $data{'page'} eq 'manufacturer' ) { # getting frequesncy to sort my $freq = $speed; if ( $freq =~ /kHz/ ) { $freq =~ s/kHz//; $freq *= 1000; } elsif ( $freq =~ /MHz/ ) { $freq =~ s/MHz//; $freq *= 1000000; } elsif ( $freq =~ /GHz/ ) { $freq =~ s/GHz//; $freq *= 1000000000; } # print "Vampires ..... $speed = $freq"; $sort_element = $freq; # } elsif ( $data{'page'} eq 'family' ) { # $sort_element = $manufTableSub; # } return ($text, $sort_element, $type); } ########################################### ############ Table ################## ########################################### sub display_board_table_element { # displays table for multi-board list # usage &display_board_table_element($row,$board_type,$flip_color); my $row = $_[0]; #[$skipLines - EOF] my $quality =$_[1]; #(0=compact) my $flipColor =$_[1]; #(0|1) my $text = ''; my $Board_type ='?'; my $Type ='?'; my $Manuf ='?'; my $Name ='?'; my $Chip_manuf ='?'; my $Chip_part ='?'; my $Chip_type ='?'; my $Speed ='?'; my $Arch_width ='?'; my $Ports ='?'; my $Socket ='?'; my $Computers ='?'; my $Features ='?'; my $Description='?'; my $Photo_front ="PHOTO
To be added\n"; my $Photo_back =""; my $Manuf_p1='?'; my $Part_p1 ='?'; my $Func_p1 ='?'; my $Manuf_p2='?'; my $Part_p2 ='?'; my $Func_p2 ='?'; my $Manuf_p3='?'; my $Part_p3 ='?'; my $Func_p3 ='?'; my $Manuf_p4='?'; my $Part_p4 ='?'; my $Func_p4 ='?'; my $Manuf_p5='?'; my $Part_p5 ='?'; my $Func_p5 ='?'; my $Manuf_p6='?'; my $Part_p6 ='?'; my $Func_p6 ='?'; my $Manuf_p7='?'; my $Part_p7 ='?'; my $Func_p7 ='?'; my $Manuf_p8='?'; my $Part_p8 ='?'; my $Func_p8 ='?'; my $Manuf_p9='?'; my $Part_p9 ='?'; my $Func_p9 ='?'; my $Datasheet = '?'; my $title = ''; my $periph = ''; my $img_alt_text = "More details"; my $chip_link = ''; my $chip_link_back = ''; if ( &board_data($row,$col_board_board_type) ne '' ) { if ( &board_data($row,$col_board_board_type) eq 'module' ) { $Board_type = 'CPU module'; } elsif ( &board_data($row,$col_board_board_type) eq 'dev' ) { $Board_type = 'Evaluation board'; } else { $Board_type = &board_data($row,$col_board_board_type); } $board_type_var = &board_data($row,$col_board_board_type); } if ( &board_data($row,$col_board_type) ne '' ) { $Type = &board_data($row,$col_board_type); } if ( &board_data($row,$col_board_manuf) ne '' ) { $Manuf = &board_data($row,$col_board_manuf); } if ( &board_data($row,$col_board_name) ne '' ) { $Name = &board_data($row,$col_board_name); } if ( &board_data($row,$col_board_chip_manuf) ne '' ) { $Chip_manuf = &board_data($row,$col_board_chip_manuf); } if ( &board_data($row,$col_board_chip_type) ne '' ) { $Chip_type = &board_data($row,$col_board_chip_type); } if ( &board_data($row,$col_board_chip_part) ne '' ) { $Chip_part = &board_data($row,$col_board_chip_part); if ( $quality == 1 ) { $Chip_detail_link = "$Chip_type Details..."; $Chip_part = "$Chip_part"; } } if ( &board_data($row,$col_board_speed) ne '' ) { $Speed = &board_data($row,$col_board_speed); } if ( &board_data($row,$col_board_arch_width) ne '' ) { $Arch_width = &board_data($row,$col_board_arch_width); } if ( &board_data($row,$col_board_socket) ne '' ) { $Socket = &board_data($row,$col_board_socket); } if ( &board_data($row,$col_board_ports) ne '' ) { $Ports = &board_data($row,$col_board_ports); } if ( &board_data($row,$col_board_computers) ne '' ) { $Computers = &board_data($row,$col_board_computers); } if ( &board_data($row,$col_board_features) ne '' ) { $Features = &board_data($row,$col_board_features); } if ( &board_data($row,$col_board_description) ne '' ) { $Description = &board_data($row,$col_board_description); } if ( &board_data($row,$col_board_manuf_p1) ne '' ) { $Manuf_p1 = &board_data($row,$col_board_manuf_p1); } if ( &board_data($row,$col_board_part_p1) ne '' ) { $Part_p1 = &board_data($row,$col_board_part_p1); } if ( &board_data($row,$col_board_func_p1) ne '' ) { $Func_p1 = &board_data($row,$col_board_func_p1); } if ( &board_data($row,$col_board_manuf_p2) ne '' ) { $Manuf_p2 = &board_data($row,$col_board_manuf_p2); } if ( &board_data($row,$col_board_part_p2) ne '' ) { $Part_p2 = &board_data($row,$col_board_part_p2); } if ( &board_data($row,$col_board_func_p2) ne '' ) { $Func_p2 = &board_data($row,$col_board_func_p2); } if ( &board_data($row,$col_board_manuf_p3) ne '' ) { $Manuf_p3 = &board_data($row,$col_board_manuf_p3); } if ( &board_data($row,$col_board_part_p3) ne '' ) { $Part_p3 = &board_data($row,$col_board_part_p3); } if ( &board_data($row,$col_board_func_p3) ne '' ) { $Func_p3 = &board_data($row,$col_board_func_p3); } if ( &board_data($row,$col_board_manuf_p4) ne '' ) { $Manuf_p4 = &board_data($row,$col_board_manuf_p4); } if ( &board_data($row,$col_board_part_p4) ne '' ) { $Part_p4 = &board_data($row,$col_board_part_p4); } if ( &board_data($row,$col_board_func_p4) ne '' ) { $Func_p4 = &board_data($row,$col_board_func_p4); } if ( &board_data($row,$col_board_manuf_p5) ne '' ) { $Manuf_p5 = &board_data($row,$col_board_manuf_p5); } if ( &board_data($row,$col_board_part_p5) ne '' ) { $Part_p5 = &board_data($row,$col_board_part_p5); } if ( &board_data($row,$col_board_func_p5) ne '' ) { $Func_p5 = &board_data($row,$col_board_func_p5); } if ( &board_data($row,$col_board_manuf_p6) ne '' ) { $Manuf_p6 = &board_data($row,$col_board_manuf_p6); } if ( &board_data($row,$col_board_part_p6) ne '' ) { $Part_p6 = &board_data($row,$col_board_part_p6); } if ( &board_data($row,$col_board_func_p6) ne '' ) { $Func_p6 = &board_data($row,$col_board_func_p6); } if ( &board_data($row,$col_board_manuf_p7) ne '' ) { $Manuf_p7 = &board_data($row,$col_board_manuf_p7); } if ( &board_data($row,$col_board_part_p7) ne '' ) { $Part_p7 = &board_data($row,$col_board_part_p7); } if ( &board_data($row,$col_board_func_p7) ne '' ) { $Func_p7 = &board_data($row,$col_board_func_p7); } if ( &board_data($row,$col_board_manuf_p8) ne '' ) { $Manuf_p8 = &board_data($row,$col_board_manuf_p8); } if ( &board_data($row,$col_board_part_p8) ne '' ) { $Part_p8 = &board_data($row,$col_board_part_p8); } if ( &board_data($row,$col_board_func_p8) ne '' ) { $Func_p8 = &board_data($row,$col_board_func_p8); } if ( &board_data($row,$col_board_manuf_p9) ne '' ) { $Manuf_p9 = &board_data($row,$col_board_manuf_p9); } if ( &board_data($row,$col_board_part_p9) ne '' ) { $Part_p9 = &board_data($row,$col_board_part_p9); } if ( &board_data($row,$col_board_func_p9) ne '' ) { $Func_p9 = &board_data($row,$col_board_func_p9); } if ( &board_data($row,$col_board_datasheet) ne '' ) { $Datasheet = &board_data($row,$col_board_datasheet); } if ( $quality == 0 ) { $title = 'Board details'; my $Manuf_s = $Manuf; my $Name_s = $Name; $Manuf_s =~ s/[ \W]/_/g; $Name_s =~ s/[ \W]/_/g; $chip_link = "$scriptLoc?page=board&manuf=$Manuf_s&name=$Name_s"; if ( length($Manuf . $Name) > 25 ) { $sub_title = $Manuf . '
' . $Name; } else { $sub_title = $Manuf . ' - ' . $Name; } } else { $title = 'Full quality image'; $chip_link = "$relativeLoc/$board_loc/" . &board_data($row,$col_board_photo_front); $chip_link_back = "$relativeLoc/$board_loc/" . &board_data($row,$col_board_photo_back); if ( length($Manuf . $Name) > 25 ) { $sub_title = $Manuf . '
' . $Name; } else { $sub_title = $Manuf . ' - ' . $Name; } } if (&board_data($row,$col_board_photo_front) ne '') { $Photo_front = &board_data($row,$col_board_photo_front) . '_sm.jpg'; my $res = 250; if (&board_data($row,$col_board_photo_back) eq '' && $quality == 1) { $res = 350; $Photo_front = &board_data($row,$col_board_photo_front) . '_med.jpg'; } else { $res = 250; $Photo_front = &board_data($row,$col_board_photo_front) . '_sm.jpg'; } $Photo_front = "\"$img_alt_text\"\n"; } if ( &board_data($row,$col_board_photo_back) ne '' ) { $Photo_back = &board_data($row,$col_board_photo_back) . '_sm.jpg'; $Photo_back = "\"$img_alt_text\"\n"; } if ( $quality == 1 ) { if ( &board_data($row,$col_board_board_type) ne '' ) { if ( &board_data($row,$col_board_board_type) eq 'module' ) { $Board_type = "CPU module"; } elsif ( &board_data($row,$col_board_board_type) eq 'dev' ) { $Board_type = "Evaluation board"; } else { $Board_type = &board_data($row,$col_board_board_type); } } if ( &board_data($row,$col_board_type) ne '' ) { $Type = "" . &board_data($row,$col_board_type) . ""; } if ( &board_data($row,$col_board_manuf) ne '' ) { $Manuf = &board_data($row,$col_board_manuf); } if ( &board_data($row,$col_board_name) ne '' ) { $Name = &board_data($row,$col_board_name); } if ( &board_data($row,$col_board_chip_manuf) ne '' ) { $Chip_manuf = "" . &board_data($row,$col_board_chip_manuf) . ""; } if ( &board_data($row,$col_board_chip_type) ne '' ) { $Chip_type = &board_data($row,$col_board_chip_type); } if ( &board_data($row,$col_board_chip_part) ne '' ) { my $part = &board_data($row,$col_board_chip_part); my $chip_man = &board_data($row,$col_board_chip_manuf); my $chip_type = &board_data($row,$col_board_chip_type); my $part_link = &board_data($row,$col_board_chip_part); $part_link =~ s/[ \W]/_/g; #tr/\W/_/; $chip_man =~ s/[ \W]/_/g; $Chip_detail_link = "$chip_type Details..."; $Chip_part = "$part"; } } $text .= "\t\n"; # if ( $flipColor == 0 ) { # $text .= "\t\n"; # }else{ # $text .= "\t\n"; # } if ( $quality == 0 ) { $text .= < $Photo_front
$Type

General Information:
Main $Chip_type: $Chip_manuf - $Chip_part
Speed: $Speed

Endhtml $text .= "\t\n"; # print $text; } elsif ( $quality == 1 ) { $text .= <
$sub_title
$Photo_front $Photo_back
Endhtml $text .= "\t\n"; } return $text; } #################################################### ############# Table (end) ########################## #################################################### ########################################################## ############### List methods ############################# ########################################################## ###################################################################### ###################################################################### ###################################################################### ################## Category pages (begin) ################## ###################################################################### ###################################################################### ###################################################################### ###################################################################### ###################################################################### ###################################################################### ################## Category pages (end) #################### ###################################################################### ###################################################################### ###################################################################### ######################################################### ################# List methods (end) #################### ######################################################### ######################################################### ################# Page Organization ##################### ######################################################### ############# Page organization (end) ####################### ############## head ############################# ########## head (end) ##################### ######## body ########## ###### body (end) ####### ######### tail ############################ ########################################################################## ########################################################################## ########################################################################## ############## New Crap ############################### ########################################################################## ########################################################################## ########################################################################## ########################################################### ########################################################### ################# Category Pages (begin) ############## ########################################################### ########################################################### sub create_html_body_main_category_family { my $text = ''; my @col1 = (); my @col2 = (); my $x = 0; my $y = 0; my $max = $#familyListGlobal/2 + 1; # print $max; foreach $fam (@familyListGlobal) { # print "\t\t
  • $fam\n"; if ( $x < $max ) { $col1[$x] = "\t\t
  • $fam\n"; } else { $col2[$y] = "\t\t
  • $fam\n"; $y++; } # if ($NUM % 2 == 1) { # print "
  • "; # } $x++; } $text .= "\t\t
    List of Families

    \n"; $text .= "\t\t
    Endhtml if ( $board_type_var eq 'module' ) { $text .= < Socket: Endhtml } else { $text .= < Ports: Endhtml } $text .= <
    Board Information:
    Board type: $Board_type
    Family: $Type
    Board manuf: $Manuf
    Board ID: $Name
    $Socket
    $Ports
    $Chip_type Information:
    Manuf: $Chip_manuf
    Part: $Chip_part
    Speed: $Speed
    Architecture: $Arch_width
    $Chip_detail_link
    Endhtml if ( $Part_p1 eq '?' ) { $text .= < None Endhtml } else { $text .= < Manuf: Endhtml } if ( $Part_p2 ne '?' ) { $text .= < Endhtml } if ( $Part_p3 ne '?' ) { $text .= < Endhtml } if ( $Part_p4 ne '?' ) { $text .= < Endhtml } if ( $Part_p5 ne '?' ) { $text .= < Endhtml } if ( $Part_p6 ne '?' ) { $text .= < Endhtml } if ( $Part_p7 ne '?' ) { $text .= < Endhtml } if ( $Part_p8 ne '?' ) { $text .= < Endhtml } if ( $Part_p9 ne '?' ) { $text .= < Endhtml } $text .= <
    Periferal Chips:
    $Manuf_p1
    Part: $Part_p1
    Function: $Func_p1
    Manuf: $Manuf_p2
    Part: $Part_p2
    Function: $Func_p2
    Manuf: $Manuf_p3
    Part: $Part_p3
    Function: $Func_p3
    Manuf: $Manuf_p4
    Part: $Part_p4
    Function: $Func_p4
    Manuf: $Manuf_p5
    Part: $Part_p5
    Function: $Func_p5
    Manuf: $Manuf_p6
    Part: $Part_p6
    Function: $Func_p6
    Manuf: $Manuf_p7
    Part: $Part_p7
    Function: $Func_p7
    Manuf: $Manuf_p8
    Part: $Part_p8
    Function: $Func_p8
    Manuf: $Manuf_p9
    Part: $Part_p9
    Function: $Func_p9
    \n\t\t
    \n\t\t
      "; foreach $col (@col1) { $text .= $col; } $text .= "\t\t
      \n"; foreach $col (@col2) { $text .= $col; } $text .= "\t\t
    "; return $text; } sub create_html_body_main_category_manuf { my $text = ''; my @col1 = (); my @col2 = (); my $x = 0; my $y = 0; my $max = $#manufListGlobal/2 + 1; # print $max; foreach $man (@manufListGlobal) { # print "\t\t
  • $fam\n"; if ( $x < $max ) { $col1[$x] = "\t\t
  • $man\n"; } else { $col2[$y] = "\t\t
  • $man\n"; $y++; } # if ($NUM % 2 == 1) { # print ""; # } $x++; } $text .= "\t\t
    List of Manufacturers

    \n"; $text .= "\t\t\n\t\t
    \n\t\t
      "; foreach $col (@col1) { $text .= $col; } $text .= "\t\t
      \n"; foreach $col (@col2) { $text .= $col; } $text .= "\t\t
    "; return $text; } ########################################################### ########################################################### ################# Category Pages (end) ################ ########################################################### ########################################################### ########################################################### ########################################################### ############## Page Extensions (begin) ################ ########################################################### ########################################################### sub create_html_page_addition_support_chips { my $text = ''; # my (@supportChips, @supportChipsMan) = @_; my @supportChips = @{ $_[0] }; my @supportChipsMan = @{ $_[1] }; # my $x=0; $text .= "\t

    \n"; $text .= "\t\n"; $text .= "\t\t\n"; for (my $x=0;$x<=$#supportChips;$x++) { # foreach $chip (@supportChips) { # print "($supportChips[$x], $supportChipsMan[$x])"; my $chip_link_part_var = $supportChips[$x]; $chip_link_part_var =~ s/\W/_/g; my $manuf_local=$supportChipsMan[$x]; # print "\t\t\n"; $text .= "\t\t\n"; # $x++; } $text .= "\t
    Support chips
    $chip
    $supportChips[$x]
    \n"; return $text; } ########################################################### ########################################################### ################ Page Extensions (end) ################ ########################################################### ########################################################### ########################################################### ########################################################### ########### Main Content Pages (begin) ################ ########################################################### ########################################################### sub create_html_body_main_cpu_boards { my $text=''; my $row = $skipLines; if ($data{'type'} eq '' && $data{'manuf'} eq '' ) { $title_ext_global = 'Processor Modules and Evaluation Boards'; $keyword_ext_global = 'processor module, CPU module, evaluation board, demonstation board, programmming board, design kit, educational board'; $text = <Processor and Microcontroller Boards


  • Processor Modules Evaluation Boards
    Endhtml } elsif ( $data{'type'} eq 'module' ) { $title_ext_global = 'Processor Modules'; $keyword_ext_global = 'processor module, CPU module'; $text .= <Processor Modules
    A modular circuit board that contains a CPU chip as well as a few peripherals chips, such as an FPU or cache controller. These often posess power regulation chips

    Endhtml $row = $skipLines; while ( &board_data($row,$col_board_board_type) ne '' ) { # print ', x: ' . &board_data($row,$col_board_board_type); if ( &board_data($row,$col_board_board_type) eq 'module' ) { $text .= &display_board_table_element($row,0,0); # (row,detail,color) # print 'y'; } $row++; } } elsif ( $data{'type'} eq 'eval' ) { $title_ext_global = 'Evaluation Boards'; $keyword_ext_global = 'evaluation board, demonstation board, programmming board, design kit, educational board'; $text .= <Evaluation Boards
    Boards used by engineers to test, making it easyer to evaluate the functionality of a chip. They often contain all the nesesary periferal chips to power it up and preform simple functions. They are sometimes called development boards or demonstration board. Some of the ones are educational boards, like the Motorola MC68000 Educational Computer, designed for teaching in Universities.

    Endhtml $row = $skipLines; while ( &board_data($row,$col_board_board_type) ne '' ) { if ( &board_data($row,$col_board_board_type) eq 'dev' ) { $text .= &display_board_table_element($row,0,0); } $row++; } } elsif ( $data{'manuf'} ne '' ) { # $text .= "$data{'manuf'} : $data{'name'}"; my $Manuf_s = $Manuf; my $Name_s = $Name; $Manuf_s =~ s/[ \W]/_/g; $Name_s =~ s/[ \W]/_/g; $row = $skipLines; while ( &board_data($row,$col_board_board_type) ne '' ) { my $Manuf_s = &board_data($row,$col_board_manuf); my $Name_s = &board_data($row,$col_board_name); $Manuf_s =~ s/[ \W]/_/g; $Name_s =~ s/[ \W]/_/g; # print "$Manuf_s:$Name_s
    \n"; if ($data{'manuf'} eq $Manuf_s && $data{'name'} eq $Name_s) { $text .= "\t\n"; $text .= &display_board_table_element($row,1,0); #detailed $text .= "\t
    \n"; } $row++; } my $Board_type_s = ''; if ( &board_data($row,$col_board_board_type) eq 'module' ) { $Board_type_s = 'CPU Module'; } elsif ( &board_data($row,$col_board_board_type) eq 'dev' ) { $Board_type_s = 'Evaluation board'; } $title_ext_global = "$Manuf_s $Name_s $Board_type_s"; $keyword_ext_global = '$Manuf_s, $Name_s, $Board_type_s'; } return $text; } sub create_html_body_main_category { my $text = ''; if ($data{'type'} eq '') { $title_ext_global = 'Categories'; $keyword_ext_global = 'category'; $text .= < Categories of Chips

    Chips organized by: Endhtml } elsif ($data{'type'} eq 'arch') { $title_ext_global = 'CPU Architectures'; $keyword_ext_global = 'architecture'; $text .= &create_html_body_main_category_arch; #&architecture_page; } elsif ($data{'type'} eq 'family') { $title_ext_global = 'CPU and MCU Families'; $keyword_ext_global = 'family, families'; $text .= &create_html_body_main_category_family; #&family_cat_page; } elsif ($data{'type'} eq 'tech') { $title_ext_global = 'Processor Technology'; $keyword_ext_global = 'technology, CMOS, PMOS, NMOS, Bipolar, HMOS, HCMOS, CHMOS'; $text .= &create_html_body_main_category_tech; #&tech_page; } elsif ($data{'type'} eq 'data_width') { $title_ext_global = 'Processor Data Widths'; $keyword_ext_global = '8-bit, 16-bit, 32-bit, 24-bit, 64-bit, 4-bit, 2-bit'; $text .= &create_html_body_main_category_data_width; #&data_width_page; } elsif ($data{'type'} eq 'type') { $title_ext_global = 'Chip Types'; $keyword_ext_global = 'CPU, MCU, FPU, GPU, PPU, I/O processor, Cache controller'; $text .= &create_html_body_main_category_chip_type; #&type_page; } elsif ($data{'type'} eq 'isa') { $title_ext_global = 'Instruction Set Architectures'; $keyword_ext_global = 'ISA, Instruction set, x86, MIPS, SPARC, ARM'; $text .= &create_html_body_main_category_isa; #&isa_cat_page; } elsif ($data{'type'} eq 'microarch') { $title_ext_global = 'Microarchitectures'; $keyword_ext_global = 'P5, P6, Netburst'; $text .= &create_html_body_main_category_microarch; #µarch_cat_page; } elsif ($data{'type'} eq 'date') { $title_ext_global = 'CPU and MCU Timeline'; $keyword_ext_global = 'timeline'; $text .= &create_html_body_main_category_date; #&date_cat_page; } elsif ($data{'type'} eq 'manuf') { $title_ext_global = 'CPU and MCU Manufacturer List'; $keyword_ext_global = 'manufacturer'; $text .= &create_html_body_main_category_manuf; #&manuf_cat_page; } elsif ($data{'type'} eq 'logo') { $title_ext_global = 'CPU and MCU Manufacturer Logos'; $keyword_ext_global = 'manufacturer, logo'; $text .= &create_html_body_main_category_logo; #&logo_page; } elsif ($data{'type'} eq 'app') { $title_ext_global = 'CPU and MCU Applications'; $keyword_ext_global = 'embedded system, desktop, server'; $text .= &create_html_body_main_category_app; #&app_cat_page; } return $text; } sub create_html_body_main_site_map { my $text=''; $title_ext_global = 'Site Map'; $keyword_ext_global = 'site map'; $text = <Site Map

    Chips in collection
    Chips orgaized by:
    Resources
    Other:
    Endhtml return $text; } sub create_html_body_main_single_chip_table { # display table for single chip my $text = ''; my $row = $_[0], $thumb; #&chipData2($row,...) my $manufTableSub = &chipData2($row,$colManuf); my $manuf_name = &chipData2($row,$colManuf); my $type = '?'; # &chipData2($row,$colType); my $type_name = ''; my $part = &chipData2($row,$colPart); my $photo = "PHOTO
    To be added\n"; my $family = ''; my $speed = '?'; my $arch = '?'; my $data = '?'; my $address = '?'; my $package = '?'; my $trans = '?'; my $tech = '?'; my $proc = '?'; my $die = '?'; my $volt = '?'; my $volt_io = '?'; my $date = '?'; my $L1 = '?'; my $L2 = '?'; my $L3 = '?'; my $ram_max = '?'; my $ram_type= '?'; my $socket = '?'; my $ram_int = '?'; my $rom_int = '?'; my $rom_type= '?'; my $fpu = '?'; my $core = '?'; my $datasheet = '?'; my $features = '?'; my $num_cores = '?'; my $core_designer = '?'; my $text = ''; my $alt_id = ''; my $label_id = ''; my $instruction_set = '?'; my $instruction_link = ''; my $isa = '?'; my $computer_arch = '?'; my $microarch = '?'; my $power = '?'; my $applications = '?'; my $bus_speed = '?'; my $id_html = ''; my $family_short = '?'; $manufTableSub = "$manufTableSub"; if (&chipData2($row,$colPhoto1) ne ""){ # making photos $photoFile = &chipData2($row,$colPhoto1); $thumb = $photoFile . '_sm.jpg'; $photo = "\n"; if (&chipData2($row,$colPhoto2) ne ""){ $photoFile = &chipData2($row,$colPhoto2); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
    \n\t\t\t\"Click\n"; } if (&chipData2($row,$colPhoto3) ne ""){ $photoFile = &chipData2($row,$colPhoto3); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
    \n\t\t\t\"Click\n"; } if (&chipData2($row,$colPhoto4) ne ""){ $photoFile = &chipData2($row,$colPhoto4); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
    \n\t\t\t\"Click\n"; } if (&chipData2($row,$colPhoto5) ne ""){ $photoFile = &chipData2($row,$colPhoto5); $thumb = $photoFile . '_sm.jpg'; $photo = $photo . "\t\t\t
    \n\t\t\t\n"; } } if ( &chipData2($row,$colFamily) ne "" && &chipData2($row,$colFamily) ne "Other") { my $famL = &chipData2($row,$colFamily); $family_short = "$famL"; # $family = "
    " . &chipData2($row,$colFamily) ." Family
    "; } if ( &chipData2($row,$colType) ne '' ) { $type = "" . &chipData2($row,$colType) . ""; $type_name = &chipData2($row,$colType); } if ( &chipData2($row,$colSpeed) ne '' ) { $speed = &chipData2($row,$colSpeed); } if ( &chipData2($row,$colArch) ne '' ) { # if ( &chipData2($row,$colArch) eq '16/32' ) { # $arch = "16/32-bit"; # } else { $arch = "" . &chipData2($row,$colArch) . "-bit"; # } } if ( &chipData2($row,$colDataBus) ne '' ) { $data = &chipData2($row,$colDataBus); } if ( &chipData2($row,$colAddBus) ne '' ) { $address = &chipData2($row,$colAddBus); } if ( &chipData2($row,$colPack) ne '' ) { $package = '' . &chipData2($row,$colPack) . "$wiki_attrib"; } if ( &chipData2($row,$colTech) ne '' ) { $tech = &chipData2($row,$colTech); if ( $tech =~ ' ' ) { @techFirst = split(/ /, $tech); $tech = $techFirst[0]; } $tech="$tech $techFirst[1] $techFirst[2] $techFirst[3]\n"; } if ( &chipData2($row,$colTrans) ne '' ) { $trans = &chipData2($row,$colTrans); } if ( &chipData2($row,$colProc) ne '' ) { $proc = &chipData2($row,$colProc); $proc =~ s/um/\&mu\;m/; $proc =~ s/u/\&mu\;m/; } if ( &chipData2($row,$colDie) ne '' ) { $die = &chipData2($row,$colDie); $die =~ s/mm\^2/mm2<\/sup>/i; } if ( &chipData2($row,$colVcc) ne '' ) { $volt = &chipData2($row,$colVcc); } if ( &chipData2($row,$colDate) ne '' ) { $date = '' . &chipData2($row,$colDate) . ''; } if ( &chipData2($row,$colL1) ne '' ) { $L1 = &chipData2($row,$colL1); } if ( &chipData2($row,$colL2) ne '' ) { $L2 = &chipData2($row,$colL2); } if ( &chipData2($row,$colL3) ne '' ) { $L3 = &chipData2($row,$colL3); } if ( &chipData2($row,$colCore) ne '' ) { $core = &chipData2($row,$colCore); } if ( &chipData2($row,$colFPU) ne '' ) { $fpu = &chipData2($row,$colFPU); } if ( &chipData2($row,$col_ram_int) ne '' ) { $ram_int = &chipData2($row,$col_ram_int); } if ( &chipData2($row,$col_ram_max) ne '' ) { $ram_max = &chipData2($row,$col_ram_max); } if ( &chipData2($row,$col_rom_int) ne '' ) { $rom_int = &chipData2($row,$col_rom_int); } if ( &chipData2($row,$col_socket) ne '' ) { $socket = &chipData2($row,$col_socket); } if ( &chipData2($row,$col_datasheet) ne '' ) { $datasheet = "" . &chipData2($row,$col_datasheet) . ""; } if ( &chipData2($row,$col_features) ne '' ) { $features = &chipData2($row,$col_features); } if ( &chipData2($row,$col_num_cores) ne '' ) { $num_cores = &chipData2($row,$col_num_cores); } if ( &chipData2($row,$col_designer) ne '' ) { $core_designer = &chipData2($row,$col_designer); } if ( &chipData2($row,$col_bus_speed) ne '' ) { $bus_speed = &chipData2($row,$col_bus_speed); } if ( &chipData2($row,$col_applications) ne '' ) { $applications = "" . &chipData2($row,$col_applications) . ''; } if ( &chipData2($row,$col_instruction_set) ne '' ) { $instruction_set = &chipData2($row,$col_instruction_set); if ( &chipData2($row,$col_instruction_link) ne '' ) { $instruction_set = "$instruction_set$wiki_attrib"; } } if ( &chipData2($row,$col_computer_architecture) ne '' ) { $computer_arch = "" . &chipData2($row,$col_computer_architecture) . ""; } if ( &chipData2($row,$col_microarchitecture) ne '' ) { $microarch = &chipData2($row,$col_microarchitecture); } if ( &chipData2($row,$col_power) ne '' ) { $power = &chipData2($row,$col_power); } if ( &chipData2($row,$col_alt_id) ne '' || &chipData2($row,$col_label_id) ne '' ) { $id_html = < Identification: Manufacturer: $manufTableSub Part #: $part Endhtml if ( &chipData2($row,$col_label_id) ne '' ) { $label_id = &chipData2($row,$col_label_id); $id_html .= <Chip label: $label_id Endhtml if ( &chipData2($row,$col_alt_id) ne '' ) { $alt_id = &chipData2($row,$col_alt_id); $id_html .= <Alt ID: $alt_id Endhtml } else { $id_html .= < Endhtml } } else { $alt_id = &chipData2($row,$col_alt_id); $id_html .= <Alt ID: $alt_id Endhtml } $id_html .= "\t\t\t"; } if ( &chipData2($row,$col_rom_type) ne '' ) { $rom_type = &chipData2($row,$col_rom_type); } if ( &chipData2($row,$col_ram_type) ne '' ) { $ram_type = &chipData2($row,$col_ram_type); } if ( &chipData2($row,$col_volt_io) ne '' ) { $volt_io = &chipData2($row,$col_volt_io); } if ( &chipData2($row,$col_isa) ne '' ) { $isa = "" . &chipData2($row,$col_isa) . ""; } # if ( &chipData2($row,$col_) ne '' ) { # $ = &chipData2($row,$col_); # } $text .= "\t\n"; $text .= "\t\n\t\n"; $text .= "\t\n"; $text .= "\t\t\n"; $text .= "\t\t $id_html Endhtml if ( $type =~ /(CPU|MCU|DSP)/ ) { $text .= < Endhtml } if ($type =~ /CPU/) { $text .= < Endhtml } elsif ( $type eq 'MCU' ) { $text .= < Endhtml } $text .= <
      $manufTableSub - $part
    \n\t\t\t$photo\n\t\t\n"; $text .= <
    General Specifications:
    Manufacture: $manufTableSub Family: $family_short
    Chip type: $type Introduced: $date
    Speed: $speed Architecture: $arch
    Application: $applications
    Architecture Specifications:
    CPU arch: $computer_arch ISA: $isa
    Microarch: $microarch
    Processor core: $core # of cores: $num_cores
    Designer: $core_designer FPU: $fpu
    Ext data bus: $data Address bus: $address
    Instruction Set: $instruction_set
    Features: $features
    Memory Specification:
    Max RAM: $ram_max L1 cache: $L1
    RAM type: $ram_type L2 cache: $L2
    L3 cache: $L3
    Memory Specification:
    Max RAM: $ram_max L1 cache: $L1
    Internal RAM: $ram_int L2 cache: $L2
    Internal ROM: $rom_int L3 cache: $L3
    ROM type: $rom_type
    Technology:
    Technology: $tech Process: $proc
    Transistors: $trans Die size: $die
    Vcc: $volt Voltage I/O: $volt_io
    Other:
    Package: $package Socket: $socket
    Datasheet: $datasheet

    Report any problems
    Endhtml $text .= "\t\n"; if($type_name ne ''){ $title_ext_global = "$manuf_name - $part - $type_name"; $keyword_ext_global = "$manuf_name, $part, $type_name"; }else{ $title_ext_global = "$manuf_name - $part"; $keyword_ext_global = "$manuf_name, $part"; } return ($text); } sub create_html_body_main_single_chip { my $text = ''; # $data{'page'} eq chip # ?page=chip&manufacturer=Intel&chipName=A80486SX-33 my $flipColor=0; my $x=$skipLines; my $chip_link_part_var = ''; if( $data{'part'} eq '' || $data{'manufacturer'} eq '' ) { $text .= "No chip selected, invalid state
    \n"; } else { while(&chipData2($x,$colPart) ne ""){ # print "."; $chip_link_part_var = &chipData2($x,$colPart); $chip_link_part_var =~ s/\W/_/g; if ( $chip_link_part_var eq $data{'part'} && &chipData2($x,$colManuf) eq $data{'manufacturer'} ) { # print "-"; $text .= &create_html_body_main_single_chip_table($x); } $x++; } } return $text; } sub create_html_body_main_full_list { my $text = ''; $title_ext_global = 'Full Chip List'; $keyword_ext_global = 'full chip list'; my $x=$skipLines; $text .= "

    Full chip list

    \n\n\n"; $text .= "
    \n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; # print "\n"; while(&chipData2($x,$colPart) ne "") { my $manuf=&chipData2($x,$colManuf); my $family=&chipData2($x,$colFamily); my $part=&chipData2($x,$colPart); my $photo=&chipData2($x,$colPhoto1); $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; # print "\n"; $text .= "\n"; $x++; } $text .= "
    ManufacturerFamilyPart #Photo
    $manuf$family$partPhoto
    \n"; return $text; } sub create_html_body_main_trade_list { my $text = ''; my $x=$skipLines; $text .= "

    Trade List

    \n\n"; &create_html_body_main_contact; $title_ext_global = 'Trade List'; $keyword_ext_global = 'trade, trade list'; $text .= "

    Wanted List

    \n\n"; $text .= < Stuff I really really want..... AMI S6800 (white) AMD Am29005, Am29035, Am29027, Am29101, Am29112, Am29117, Am29501 AMD AM2901DC white ceramic Intergraph Clipper MOS 6500/1 MOS MCS6502 MOS 6503, 6505, 6506, 6507, 6508, 6512, 6513, 6514, 6515 MOS 7501 MOS 850x ASCII R800 Stuff I want......... Manufacture Part # Intel D4040 Intel Any 8008 Intel Any Itanium Intel A80860XR-33 Intel Rapid CAD Intel Any XScale CPU AMD Z8002 Weitek Any CPU DEC PDP-11 F-11 DEC PDP-11 FPA Intel Any i376 ICT Any Loongson ICT Any Godson Monolithic Memories Incorporated 5701/6701 Motorola 68012 NEC V33, V53, V70 National Semi Any PACE National Semi SC/MP National Semi 32032 Nvidia Any Tegra INMOS any T2xx or T9xxx VIA C3 VIA Eden WDC 65816 Western Electric 32100, 32200 Some Antistatic IC tubes 84pin PLCC tube 64pin PLCC tube 52pin PLCC tube 44pin PLCC tubei 0.6in DIP tube 0.9in DIP tubes (Used for Motorola 68000) 0.75in DIP tubes (Used by some Shrink DIPs) EndHTML # print "\n\n\n"; # print "
    \n\n"; # print "\n"; # my $x=$skipLines; # while(&wanted_data($x,$col_wanted_part) ne "") { # my $manuf=&wanted_data($x,$col_wanted_man); # my $part=&wanted_data($x,$col_wanted_part); # print "\n"; # print "\n"; # print "\n"; # print "\n"; # $x++; # } # print "
    ManufacturePart #
    $manuf$part
    \n"; $text .= "

    Trade List

    \n\n"; $text .= "\n\n\n"; $text .= "
    \n\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; # print "\n"; my $x=$skipLines; while(&chipData2($x,$colPart) ne "") { my $trade=&chipData2($x,$colTrade); my $manuf=&chipData2($x,$colManuf); my $family=&chipData2($x,$colFamily); my $part=&chipData2($x,$colPart); my $photo=&chipData2($x,$colPhoto1); if(&chipData2($x,$colTrade) ne "X" && &chipData2($x,$colTrade) ne "x") { $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; $text .= "\n"; # print "\n"; $text .= "\n"; } $x++; } $text .= "
    QuantityManufacturerFamilyPart #Photo
    $trade$manuf$family$partPhoto
    \n"; return $text; } sub create_html_body_main_chip_list { my $text = ''; my $x=$skipLines; # my $flipColor=0; my $supportChipCount=0; my @supportChips=(); my @freq=(); my @chip_text=(); my @chip_text2=(); my @chip_text3=(); my @supportChipsMan=(); my @chip_table_text=(), @sort_elements=(); my $listed_cnt=0; $text .= "\n\t\n\t\n"; while(&chipData2($x,$colManuf) ne "") { if( (&chipData2($x,$colManuf) =~ /^$data{'manufacturer'}$/i) || ($data{'page'} eq 'family') ) { if ( (&chipData2($x,$colFamily) eq $data{'family'} || $data{'family'} eq "All" || (($data{'family'} eq "Other") && (&chipData2($x,$colFamily) eq ''))) && ($data{'family'} ne "") ) { if ( &chipData2($x,$colType) =~ /^Support$/i ) { $supportChips[$supportChipCount] = &chipData2($x,$colPart); $supportChipsMan[$supportChipCount] = &chipData2($x,$colManuf); # need to fix to the send full ship data $supportChipCount++; } else { ($chip_table_text[$listed_cnt], $sort_elements[$listed_cnt], $type[$listed_cnt]) = &displayTableData2($x,$flipColor); $listed_cnt++; if ( $flipColor == 0 ) {$flipColor = 1;} else {$flipColor = 0;} } } } $x++; } # my $row_sort = 0; my $not_complete = 1; my $index; my $len = ($#sort_elements - 1); my $temp = ''; my $temp2 = ''; my $temp3 = ''; while ($not_complete) { $not_complete = 0; foreach $index (0 .. $len) { if ($sort_elements[$index] > $sort_elements[$index + 1]) { $temp = $sort_elements[$index + 1]; $temp2 = $chip_table_text[$index + 1]; $temp3 = $type[$index + 1]; $sort_elements[$index + 1] = $sort_elements[$index]; $chip_table_text[$index + 1] = $chip_table_text[$index]; $type[$index + 1] = $type[$index]; $sort_elements[$index] = $temp; $chip_table_text[$index] = $temp2; $type[$index] = $temp3; $not_complete = 1; } } } if ( $data{'page'} eq 'manufacturer' || $data{'page'} eq 'family' ) { # print "yelp"; $x=0; my $cpus = ''; my $mcus = ''; my $fpus = ''; my $dsps = ''; my $others = ''; while ( $sort_elements[$x] ne '' ) { # print "."; if ( $type[$x] =~ /^cpu$/i || $type[$x] =~ /^bitslice cpu$/i ) { $cpus .= $chip_table_text[$x]; } elsif ( $type[$x] =~ /^mcu$/i ) { $mcus .= $chip_table_text[$x]; } elsif ( $type[$x] =~ /^dsp$/i ) { $dsps .= $chip_table_text[$x]; } elsif ( $type[$x] =~ /^fpu$/i ) { $fpus .= $chip_table_text[$x]; } else { $others .= $chip_table_text[$x]; } $x++; } if ( $cpus ne '' ) { $text .= "\n"; $text .= $cpus; } if ( $mcus ne '' ) { $text .= "\n"; $text .= $mcus; } if ( $dsps ne '' ) { $text .= "\n"; $text .= $dsps; } if ( $fpus ne '' ) { $text .= "\n"; $text .= $fpus; } if ( $others ne '' ) { $text .= "\n"; $text .= $others; } $text .= "\t
      Central Processing Unit (CPU)
      Micro-Controller Unit (MCU)
      Digital Signal Processor (DSP)
      Floating Point Unit (FPU)
      Other components
    \n"; if ( $supportChipCount > 0 ) { $text .= &create_html_page_addition_support_chips(\@supportChips,\@supportChipsMan); } $text .= "\t\n"; } # elsif ( $data{'page'} eq 'family' ) { # foreach $temp ( @chip_table_text ) { # print $temp; # } # } # Create title extensions if ( $data{'page'} eq 'manufacturer' ) { if ($data{'family'} eq '' ) { $title_ext_global = "$data{'manufacturer'} Chips"; $keyword_ext_global = "$data{'manufacturer'}"; } else { $title_ext_global = "$data{'manufacturer'} - $data{'family'} Chips"; $keyword_ext_global = "$data{'manufacturer'}, $data{'family'}"; } }elsif ($data{'page'} eq 'family' ) { $title_ext_global = "$data{'family'} Chips"; $keyword_ext_global = "$data{'family'}"; } return $text; } sub create_html_body_main_contact { my $text = ''; $title_ext_global = 'Contact Page'; $keyword_ext_global = 'contact'; $text .= < Contact Me
    You will have to manually type it in. SPAM is such a miserable thing. Hopefully this will avoid some.

    Endhtml return $text; } ########################################################### ########################################################### ############# Main Content Pages (end) ################ ########################################################### ########################################################### ########################################################### ########################################################### ############## Intro Tables (begin) ################### ########################################################### ########################################################### sub create_html_intro_single_chip { my $text =''; my $x=$skipLines; # my $name = $data{'family'}; my $fullName = ''; my $manufSub = '?'; my $dateSub = '?'; my $chip= '?'; my $arch = '?'; my $coreArch = '?'; my $freq = '?'; my $tech = '?'; my $instrucName = ''; my $instrucCount = '?'; my $instrucLink = '?'; my $homepage = '?'; my $wiki = '?'; my $date = '?'; my $add = '?'; my $desc = '...'; my $logo = ''; my $familyLogo = ''; # my $famSub = $data{'family'}; my $link = ''; my $linkName = ''; my $datasheet = '?'; #print "match => &familyData2($x,$colFamilyName] "; my $chip_link_part_var = ''; if ( $data{'page'} eq 'chip' ) { # my $flipColor=0; $x = $skipLines; while(&chipData2($x,$colPart) ne ""){ $chip_link_part_var = &chipData2($x,$colPart); $chip_link_part_var =~ s/\W/_/g; if ( $chip_link_part_var eq $data{'part'} && &chipData2($x,$colManuf) eq $data{'manufacturer'} ) { # &displayTableData($x,$flipColor); $family = &chipData2($x,$colFamily); $famSub = $family; } $x++; } } # print " --|$family|-- "; $x = $skipLines; while ( &familyData2($x,$colFamilyName) ne '' ) { # print ".
    " . &familyData2($x,$colFamilyName) ; if ( &familyData2($x,$colFamilyName) eq $famSub ) { # print "match => &familyData2($x,$colFamilyName) "; $name = &familyData2($x,$colFamilyName); if ( &familyData2($x,$colFamilyFullName) ne '' ) { $fullName = "of the " . &familyData2($x,$colFamilyFullName) . " Family
    "; } # else { # $fullName = "of the " . $data{'family'} . " Family
    "; # } if ( &familyData2($x,$colFamilyManuf) ne '' ) { $manufSub = &familyData2($x,$colFamilyManuf); } if ( &familyData2($x,$colFamilyDate) ne '' ) { $dateSub = &familyData2($x,$colFamilyDate); } # if ( &familyData2($x,$colFamilyChip) ne '' ) { # $chip = &familyData2($x,$colFamilyChip); # } if ( &familyData2($x,$colFamilyArch) ne '' ) { $arch = &familyData2($x,$colFamilyArch) . '-bit'; } if ( &familyData2($x,$colFamilyInstrucName) ne '' ) { $instrucName = &familyData2($x,$colFamilyInstrucName); } if (&familyData2($x,$colFamilyIntrucNum) ne '' ) { $instrucNum = &familyData2($x,$colFamilyIntrucNum); } if ( &familyData2($x,$colFamilyInstrucLink) ne '' ) { $instrucLink = &familyData2($x,$colFamilyInstrucLink); } if ( &familyData2($x,$colFamilyCoreArch) ne '' ) { $coreArch = &familyData2($x,$colFamilyCoreArch); } if ( &familyData2($x,$colFamilyFreq) ne '' ) { $freq = &familyData2($x,$colFamilyFreq); } if (&familyData2($x,$colFamilyTech) ne '' ) { $tech =&familyData2($x,$colFamilyTech) ; } if ( &familyData2($x,$colFamilyHomepage) ne '' ) { if ( &familyData2($x,$colFamilyHomepage) eq 'none' ) { $homepage = 'none'; } else { ($link,$linkName) = split(/ /,&familyData2($x,$colFamilyHomepage)); if ($linkName eq '') { $linkName = substr($link,0,20) . '...'; } $homepage = "$linkName"; ; } } if ( &familyData2($x,$colFamilyWiki) ne '' ) { $wiki = &familyData2($x,$colFamilyWiki); $wiki =~ s/ /_/; $wiki = "(Wikipedia article)"; } if ( &familyData2($x,$colFamilyLogo) ne '' ) { $familyLogo = &familyData2($x,$colFamilyLogo); } #if ( $logo ne '' ) { #$logo = "\"$name\""; #} ##### EXTRA LOGOs if (&familyData2($x,$colFamilyDesc) ne '') { $desc = &familyData2($x,$colFamilyDesc); } } $x++; } $x = $skipLines; while ( &manufData2($x,$colManufName) ne '' ) { #print &manufData2($x,$colManufFullName); if ( $data{'manufacturer'} eq &manufData2($x,$colManufName) ) { $nameManuf = &manufData2($x,$colManufFullName); $logo = &manufData2($x,$colManufLogo1); #$founded = &manufData2($x,$colManufDate); #$homepage= &manufData2($x,$colManufHomepage); #$wiki = &manufData2($x,$colManufWiki); #$trad = &manufData2($x,$colManufTrad); #$current = &manufData2($x,$colManufCurrent); #$status = &manufData2($x,$colManufStatus); #$desc = &manufData2($x,$colManufDesc); #print "............. &manufData2($x,$colManufName) ................
    \n"; } $x++; } if ( $logo ne '' ) { $logo = "\"$name\""; } if ( $nameManuf eq '' ) { $nameManuf = $data{'manufacturer'}; } $text .= < $logo $nameManuf - $name
    $name Family
    $fullName
    Homepage: $homepage $wiki
    Family description: $desc
    Designer: $manufSub
    Initial release: $dateSub
    Datasheet: $datasheet
    Architecture: $arch
    Frequencies: $freq
    Technology: $tech
    Endhtml return $text; } sub create_html_intro_manuf { #Creates the intro table for manufacturers my $text = ''; my $manufSub = $_[0]; my $name = ''; my $logo1 = ''; my $logo2 = ''; my $logo3 = ''; my $logo4 = ''; my $logo5 = ''; my $founded = ''; my $homepage= ' Unknown?'; my $wiki = ''; my $trad = ''; my $current = ''; my $status = ''; my $desc = ''; my $row = $skipLines; my @board_rows = (); my $does_manuf_exist = 0; $text .= "\t\n"; # print "$manufSub"; my $x=$skipLines; while ( &manufData2($x,$colManufName) ne '' ) { # print &manufData2($x,$colManufName) . ", "; if ( $manufSub eq &manufData2($x,$colManufName) ) { $does_manuf_exist = 1; $name = &manufData2($x,$colManufFullName); $name =~ s/_/ /g; $logo1 = &manufData2($x,$colManufLogo1); $logo2 = &manufData2($x,$colManufLogo2); $logo3 = &manufData2($x,$colManufLogo3); $logo4 = &manufData2($x,$colManufLogo4); $logo5 = &manufData2($x,$colManufLogo5); $founded = &manufData2($x,$colManufDate); $homepage= &manufData2($x,$colManufHomepage); $wiki = &manufData2($x,$colManufWiki); $wiki =~ s/ /_/g; $trad = &manufData2($x,$colManufTrad); $current = &manufData2($x,$colManufCurrent); $status = &manufData2($x,$colManufStatus); $desc = &manufData2($x,$colManufDesc); $abrev = &manufData2($x,$colManufAbrev); #print "............. &manufData2($x,$colManufName) ................
    \n"; } $x++; } if ( $name eq '' ) { $name = $data{'manufacturer'}; } if ( $logo1 ne '' ) { $logo1 = "
    \"$name\"
    "; } if ( $logo2 ne '' ) { $logo2 = "
    \"$name\"

    "; } if ( $logo3 ne '' ) { $logo3 = "
    \"$name\"

    "; } if ( $logo4 ne '' ) { $logo4 = "
    \"$name\"

    "; } if ( $logo5 ne '' ) { $logo5 = "
    \"$name\"
    "; } if ( $founded eq '' ) { $founded = "unknown"; } if ( $homepage ne '' ) { if ( $homepage eq 'Dead' || $homepage eq 'dead' ) { $homepage = 'dead'; } else { $homepage = "$homepage"; } } elsif ( $homepage =~ 'http' ) { $homepage = $homepage; } else { $homepage = "Unknown"; } if ( $wiki ne '' ) { $wiki = " \; (Wikipedia article)"; } if ( $trad eq '' ) { $trad = " - "; } if ( $current eq '' ) { $current = " - "; } if ( $status eq '' ) { $status = ' ? '; } if ( $desc ne '' ) { $desc = "Description: $desc
    \n"; } if ( $abrev ne '' ) { $abrev = '(' . $abrev . ')'; } $text .= < Endhtml if($does_manuf_exist){ $text .= < $logo1 $name $abrev $logo2 $logo3 $logo4 $logo5 Founded: $founded
    \n Homepage: $homepage $wiki
    \n Traditional products: $trad
    \n Current products: $current
    \n Status: $status
    \n $desc Endhtml }elsif($name eq "Others"){ $text .= " Unsorted Manufacturers
    \n"; $text .= " from less significant CPU manufacturers
    \n"; }else{ $text .= " $name
    \n"; $text .= " Manufacturer details unknown
    \n"; } $text .= "\t\n"; $text .= "\t\t
    \n\t\t
    \n"; #table-X1 if($name eq "Others"){ $text .= "\t\tManufacturer List:
    \n"; # Print others list foreach $others_manuf (@manuf_others_list_global){ $text .= <$others_manuf ($manufListCountGlobal{$others_manuf})
    EndHTML } }else{ $text .= "\t\tList of IC families:
    \n"; $text .= "\t\t
      \n"; for ($x=0;$x<=$#manufFamilyListGlobal;$x++) { $text .= "\t\t
    • $manufFamilyListGlobal[$x]"; if ($manufFamilyListGlobal[$x] eq "All") { $text .= "
    • \n"; } else { $text .= " ($manufFamilyListCountGlobal[$x])\n"; } } $text .= "\t\t
    \n"; # Checking to see if there are any boards by/for the manuf $row = $skipLines; $x = 0; my $set_board = 0; while (&board_data($row,$col_board_board_type) ne '') { # print "."; if (&board_data($row,$col_board_manuf) eq $data{'manufacturer'} || &board_data($row,$col_board_chip_manuf) eq $data{'manufacturer'}) { # print "X"; $board_rows[$x] = $row; $set_board = 1; $x++; } $row++; } if ($set_board == 1) { $text .= "\t
    \n"; $text .= "\t\tProcessor Boards:\n"; $text .= "\t\t
    \n";#table-X1(end) $text .= "\t\n"; $text .= "\t\n"; return $text; } sub create_html_intro_family { # Creates the intro table that displays family details my $text = ''; my $x=$skipLines; my $name = $data{'family'}; my $fullName = ''; my $manufSub = '?'; my $dateSub = '?'; my $chip= '?'; my $arch = '?'; my $coreArch = '?'; my $freq = '?'; my $tech = '?'; my $instrucName = ''; my $instrucCount = '?'; my $instrucLink = '?'; my $homepage = 'Unknown ?'; my $wiki = ''; my $date = '?'; my $add = '?'; my $desc = '...'; my $logo = ''; my $familyLogo = ''; my $famSub = $data{'family'}; my $link = ''; my $linkName = ''; my $datasheet = '?'; my $does_family_exist = 0; #print "match => &familyData2($x,$colFamilyName] "; $x = $skipLines; while ( &familyData2($x,$colFamilyName) ne '' ) { if ( &familyData2($x,$colFamilyName) eq $famSub ) { $does_family_exist = 1;# found a family #print "match => &familyData2($x,$colFamilyName) "; $name = &familyData2($x,$colFamilyName); if ( &familyData2($x,$colFamilyFullName) ne '' ) { $fullName = "of the " . &familyData2($x,$colFamilyFullName) . " Family
    "; } # else { # $fullName = "of the " . $data{'family'} . " Family
    "; # } if ( &familyData2($x,$colFamilyManuf) ne '' ) { $manufSub = &familyData2($x,$colFamilyManuf); } if ( &familyData2($x,$colFamilyDate) ne '' ) { $dateSub = &familyData2($x,$colFamilyDate); } # if ( &familyData2($x,$colFamilyChip) ne '' ) { # $chip = &familyData2($x,$colFamilyChip); # } if ( &familyData2($x,$colFamilyArch) ne '' ) { $arch = &familyData2($x,$colFamilyArch) . '-bit'; } if ( &familyData2($x,$colFamilyInstrucName) ne '' ) { $instrucName = &familyData2($x,$colFamilyInstrucName); } if (&familyData2($x,$colFamilyIntrucNum) ne '' ) { $instrucNum = &familyData2($x,$colFamilyIntrucNum); } if ( &familyData2($x,$colFamilyInstrucLink) ne '' ) { $instrucLink = &familyData2($x,$colFamilyInstrucLink); } if ( &familyData2($x,$colFamilyCoreArch) ne '' ) { $coreArch = &familyData2($x,$colFamilyCoreArch); } if ( &familyData2($x,$colFamilyFreq) ne '' ) { $freq = &familyData2($x,$colFamilyFreq); } if (&familyData2($x,$colFamilyTech) ne '' ) { $tech =&familyData2($x,$colFamilyTech) ; } if ( &familyData2($x,$colFamilyHomepage) ne '' ) { if ( &familyData2($x,$colFamilyHomepage) eq 'none' ) { $homepage = 'none'; } else { ($link,$linkName) = split(/ /,&familyData2($x,$colFamilyHomepage)); if ($linkName eq '') { $linkName = substr($link,0,20) . '...'; } $homepage = "$linkName"; ; } } if ( &familyData2($x,$colFamilyWiki) ne '' ) { $wiki = &familyData2($x,$colFamilyWiki); $wiki =~ s/ /_/; $wiki = "(Wikipedia article)"; } if ( &familyData2($x,$colFamilyLogo) ne '' ) { $familyLogo = &familyData2($x,$colFamilyLogo); } #if ( $logo ne '' ) { #$logo = "\"$name\""; #} ##### EXTRA LOGOs if (&familyData2($x,$colFamilyDesc) ne '') { $desc = &familyData2($x,$colFamilyDesc); } } $x++; } $x = $skipLines; while ( &manufData2($x,$colManufName) ne '' ) { #print &manufData2($x,$colManufFullName); if ( $data{'manufacturer'} eq &manufData2($x,$colManufName) ) { $nameManuf = &manufData2($x,$colManufFullName) . ' -'; $logo = &manufData2($x,$colManufLogo1); } $x++; } if ( $logo ne '' ) { $logo = "\"$name\""; } if ( $nameManuf eq '' ) { if ( $data{'manufacturer'} ne '' ) { $nameManuf = $data{'manufacturer'} . ' -'; } else { $nameManuf = ''; } } $text .= < $logo $nameManuf $name
    Endhtml if($does_family_exist){ $text .= < $name Family
    $fullName
    Homepage: $homepage $wiki
    Family description: $desc
    Designer: $manufSub
    Initial release: $dateSub
    Datasheet: $datasheet
    Architecture: $arch
    Frequencies: $freq
    Technology: $tech
    Endhtml }else{ $text .= <$name Family
    family details unknown
    Endhtml } $text .= < Endhtml return $text; } ########################################################### ########################################################### ################ Intro Tables (end) ################### ########################################################### ########################################################### ################################## ####### Main Page (start) ######## ################################## sub create_html_head { my $text=''; # http://www.w3schools.com/css/css_font.asp my $meta_robots=''; if( $scriptName ne 'chips') { $meta_robots=''; } my $title = "CPU Grave Yard"; if ($data{'page'} eq '') { $title = $title . " - Chip Collection"; $meta = "AM2900"; } elsif ($page_DNE_global eq 'TRUE') { $title = $title . " - $page_DNE_title_global"; $meta = ""; } else { $title = $title . " - $title_ext_global"; $meta = "$keyword_ext_global"; } # body {background-image: url(../grave.gif); background-repeat: no-repeat;opacity:0.4;filter:alpha(opacity=40)} $text = < $title $meta_robots
    $totalChipCountGlobal Chips
    updated
    $updateDate

    CPU Grave Yard
    a processor collection


    Home -- Categories -- Trade List -- Glossary -- Processor Boards -- Site Map -- Contact Me

    Endhtml return $text; } sub create_html_body_pre { my $text = ''; $text = < \n
    Endhtml return $text; } sub create_html_sidebar { my $text = ''; my $x=0; $text = <

    Endhtml foreach $manuf (sort keys %manufListCountGlobal) { if ($manuf eq $data{'manufacturer'}) { $text .= "\t\t$manuf ($manufListCountGlobal{$manuf})
    \n"; $text .= "\t
      \n"; # &manufFamilyList; #no longer used for ($x=0;$x<=$#manufFamilyListGlobal;$x++) { $text .= "\t\t
    • $manufFamilyListGlobal[$x]"; if ($manufFamilyListGlobal[$x] eq "All") { $text .= "
    • \n"; } else { $text .= " ($manufFamilyListCountGlobal[$x])\n"; } } $text .= "\t
    \t\n
    \n"; }else{ # Make sure its not an Other if(not(@found = grep(/\b$manuf\b/,@manuf_others_list_global))){ $unselectedCompanies= $unselectedCompanies . "\t
    $manuf ($manufListCountGlobal{$manuf})
    \n"; } } } my $others_count=0; foreach $other_manuf (@manuf_others_list_global){ $others_count += $manufListCountGlobal{"$other_manuf"}; } $unselectedCompanies= $unselectedCompanies . "\t
    Others ($others_count)
    \n"; $text .= $unselectedCompanies; $text .= "\t
    \n"; $text .= "\t\n\n\n"; return $text; } sub create_html_body_mid { my $text = ''; $text = "
    \n"; $text .= "\n"; $text .= "\t \n\t \n\t \n\t \n"; $text .= "\t \n\t \n\t \n
    \n"; return $text; } sub create_html_body_intro { my $text = ''; my $type=$data{'page'}; my $manuf=$data{'manufacturer'}; my $family=$data{'family'}; my $logo='', $desc=''; #print "$type, $manuf, $family"; $text .= "\t\n"; if ( $type eq '' ) { #initial page $text .= <This is my CPU collection.

    I currently have $totalChipCountGlobal chips in my collection, spanning from $totalManufCountGlobal different companies, and $totalFamilyCountGlobal CPU families. They are mostly processors (CPU) and microcontrollers (MCU). I have some rare ones in my collections and some you may not see anywhere else. I have a special affinity for the AMD AM2900 family. A collection of chips, forming Bitslice processors.



    Some of my larger collections
    Advanced Micro Devices AMD Intel Intel
    Motorola Motorola Zilog Zilog
    Endhtml } elsif ( $type eq 'manufacturer' ) { #Manufacturer pages if ( $data{'family'} eq '' ) { $text .= &create_html_intro_manuf($manuf); } elsif ( $data{'family'} eq "All" ) { $text .= "\t

    $manuf

    \n"; $text .= "All families
    \n"; } elsif ( $data{'family'} eq "Other" ) { $text .= "\t

    $manuf

    \n"; $text .= "Other families
    \n"; } else { $text .= &create_html_intro_family; } $text .= "\t
    \n"; } elsif ( $data{'page'} eq 'family' ) { if ( $data{'family'} ne 'Other' ) { $text .= &create_html_intro_family; } } elsif ( $type eq 'trade' ) { $text .= "Trade desc\n"; } elsif ( $type eq 'chip' ) { $text .= &create_html_intro_single_chip; } $text .= "\t\n"; return $text; } sub create_html_body_main_content { my $text =''; $text .= "\t
    \n"; switch ($data{'page'}) { case "fullList" { $text .= &create_html_body_main_full_list; } case "tradeList" { $text .= &create_html_body_main_trade_list; } case "family" { $text .= &create_html_body_main_chip_list; } case "manufacturer" { $text .= &create_html_body_main_chip_list; } case "chip" { $text .= &create_html_body_main_single_chip; } case "sneezmale" { $text .= &create_html_body_main_contact; } case "site_map" { $text .= &create_html_body_main_site_map; } case "cat" { $text .= &create_html_body_main_category; } case "glossary" { $text .= &create_html_body_main_glossary; } case "board" { $text .= &create_html_body_main_cpu_boards; } # case "architecture" { &architecture_page; } case "" {} #{ &defaultContent; } else { $text .= "Script Error: page type unknown"; $page_DNE_global = 'TRUE'; } } # chip lists $text .= "\t
    \n"; $text .= "\n"; return $text; } sub create_html_body_end { my $text = ''; $text = <
    Endhtml return $text; } sub create_html_content_header { my $text=''; # If page Does Not Exist then may it a 404 Error if ($page_DNE_global eq 'TRUE') { $text .= "Status: 404 Not Found\n"; } # Makes sure the URL is the short one /chips? if its not redirect if ( $scriptLoc eq 'cgi-bin/chipParse.pl' ) { my $query = $ENV{'QUERY_STRING'}; if($query ne ''){ $query = '?' . $query; } $text = "Location: http://happytrees.org/chips$query\n\n"; } else { $text = "Content-type:text/html\n\n"; # starting right } return $text; } sub create_html_tail { my $text=''; $text = <
    This page was created by Jeff Israel
    Images and content are under CC-BY-SA 3.0 license, unless otherwise noted. The code for this page is licenced under GPL
    html hit counter Endhtml return $text; } ################################## ####### Main Page (stop) ######### ################################## ######################################### ########## HTML (end) ################### ######################################### ######################################### ########## Page Structure (start) ####### ######################################### sub create_html { $title_ext_global = ''; $keywords_ext_global = ''; # Check to see if the page should exist &does_page_exist; # Header $page_html_content_header_global = &create_html_content_header; # Body # $page_html_body_global = &create_html_body; $page_html_body_pre_global = &create_html_body_pre; $page_html_sidebar_global = &create_html_sidebar; $page_html_body_mid_global = &create_html_body_mid; $page_html_body_intro_global = &create_html_body_intro; # --> create_html_intro_family # --> create_html_intro_manuf # --> create_html_intro_single_chip $page_html_body_main_content_global = &create_html_body_main_content; # --> create_html_body_main_full_list # --> create_html_body_main_trade_list # --> create_html_body_main_chip_list # --> create_html_body_main_single_chip_table # --> create_html_body_main_contact # --> create_html_body_main_site_map # --> create_html_body_main_category # --> create_html_body_main_glossary # --> create_html_body_main_cpu_boards $page_html_body_end_global = &create_html_body_end; # Tail $page_html_tail_global = &create_html_tail; # Form the head last, to form better title and keywords $page_html_head_global = &create_html_head; } sub print_html { # Header print $page_html_content_header_global; #content-type|redrect|404 print $page_html_head_global; #html head #Body #print $page_html_body; print $page_html_body_pre_global; print $page_html_sidebar_global; print $page_html_body_mid_global; print $page_html_body_intro_global; print $page_html_body_main_content_global; print $page_html_body_end_global; # Tail print $page_html_tail_global; } ######################################### ########## Page Structure (end) ######### ######################################### ################################################## ########## Main code ############################# ################################################## #===Global Vars===# # List of Manuf = @manuf (string) # List of families = @family (string) # chip info = &chipData2(chipNum,colNum) (string) # # input manuf = $data{'manufacturer'} (string) # manuf ID # = $selectedManufIDglobal (int) # input family = $data{'family'} (string) # family ID # = # input page type = $data{'page'} (string # # manuf families = @manufFamUnique (string) # manuf chip cnt = $manufCount[$selectedManufIDglobal] (int) # manuf fam chip cnt= $familyCount[$selectedManufIDglobal][family] (int) #===Page organization=== # # Main page # &pageHead # &pagebody # &pageTail # # pageBody -> # &sidebar # &maincontent # # sidebar -> # &manufFamilyList # # maincontent -> # &intro # options-> # &fullList # &tradeList # &familyList # &manuList # # intro -> # &displayTableManuf2 # &displayTableFamily # # manufList -> # foreach(chip) # &displayTableData # # #Initialize %data = (); $updateDate = ''; @updateDateA = (); #Initialize Global Varables $page_DNE_global = ''; $title_ext_global = ''; $keywords_ext_global = ''; $page_html_content_header_global = ''; $page_html_body_global = ''; $page_html_body_pre_global = ''; $page_html_sidebar_global = ''; $page_html_body_mid_global = ''; $page_html_body_intro_global = ''; $page_html_body_main_content_global = ''; $page_html_body_end_global = ''; $page_html_tail_global = ''; $page_html_head_global = ''; $page_DNE_title_global = ''; # Gets input args %data = &read_input; #get input # Gets spreadsheet's last edit date $updateDate = ctime(stat($spreadsheetFileName)->mtime); @updateDateA = split(/ /,$updateDate); if ( $updateDateA[4] =~ /:/ ) { $updateDate = $updateDateA[1] . " " . $updateDateA[3] . ", " . $updateDateA[5]; } else { $updateDate = $updateDateA[1] . " " . $updateDateA[2] . ", " . $updateDateA[4]; } # Gets the scripts location -> $scriptLoc &check_script_location; # foreach (keys %ENV){ print "$_ -> $ENV{$_}
    "; } # Load spreadsheet data @spreadsheetData = &parse_ods($spreadsheetFileName); # Load a file listing the order families should be listed @chipErasGlobal = &openFile($familyErasOrderedFileName); chomp(@chipErasGlobal); # foreach $chipEra (@chipErasGlobal) {print "$chipEra, ";} # Gets the column numbers for each of the chip parameters &getColLabels; &getColChipData; &grapGlobals; $wiki_attrib = ""; # %result = &sort_family_by('data-width'); # I moved large amounts of html/txt 3000+ lines to a seperate file do $extended_code_include_file; # &main_page; # display page # Create the parts of the page &create_html; # Prints out the page &print_html; ######## Main code (end) ############### print "\n";