applications of computer science at hp hp @ research park noah smith 3/26/2009
Post on 19-Dec-2015
218 views
TRANSCRIPT
04/18/23 2
Computer Science Textbooks• Expensive• Useful• Books on hand:−Computer Architecture−Analysis of Algorithms−Machine Learning−K&R’s ANSI C, 2nd Ed.
04/18/23 3
General Introduction: Software Engineering• The Software Engineering process• SDG/Software Director’s• Automator• FLIMAGE• FRU Edit• BMC Flash
04/18/23 4
Compromise in Design• The variables are kept
in two 8-bit registers• The register packing is
to the right• After M, N is calculated,
compute the correct bit-packing of the data
• Write a function:− void pack_m_n(int m, int
n);− That prints the
hexadecimal representation of bytes 11 and 12 to STDOUT
Byte 1
Bit Variable
0 M0
1 M1
2 M2
3 M3
4 M4
5 M5
6 N9
7 N8
Byte 2
0 N0
1 N1
2 N2
3 N3
4 N4
5 N5
6 N6
7 N7
04/18/23 5
Compromise in Design: Code
• void pack_m_n(int m, int n) {• int byte11, byte12;•
• if( m < 1 ) {• printf("ERROR: M Out of Range: %d\n", m);• m = 1;• }• else if( m > 63 ) {• printf("ERROR: M Out of Range: %d\n", m);• m = 63;• }• if( n < 0 ) {• printf("ERROR: N Out of Range: %d\n", n);• n = 0;• }• else if( n > 1023 ) {• printf("ERROR: N Out of Range: %d\n", n);• n = 1023;• }•
• byte11 = (m & 0x3F) | ((n & 0x200) >> 3) | ((n & 0x100) >> 1);• byte12 = (n & 0xFF);• printf("Byte 11, 12: %02X, %02X\n",byte11,byte12);• }
04/18/23 7
Topics in Computer Science• Software Engineering• Programming• Data Structures• Analysis of Algorithms• Formal Languages• Operating Systems• Computer Architecture• Artificial Intelligence
04/18/23 8
Programming• ePIG
− VB Script− ASP− DHTML− Javascript− SQL
• FRU Edit− C#− XML− Various binary hex editing
• SDG Tool− C#− VB Script Macros− XML− SQL
• PLATT− ANSCI C− XML− XSLT− X86 Assembly− DOS16/DOS32/Windows/
Linux• CPE Jazz
− Perl
• SCD Toolkit− C#− Bash Scripting− Windows Shell Scripting− XML
• Trebuchet IV− ANSI C− C++− I2C (Protocol)− x86 Assembly, Hex (binary
code)− XML− Octave/M− R/S− PHP
• QA Testing− Ruby− Perl− PHP− XML
• Automator− C++− DOS Batch Scripting− VBScript− KS Script− Windows Scripting− X86 Assembly
04/18/23 12
Data Structures• Efficient structures for managing your code• The “Map” class back in the day (VC++ 6.0)• Hash-table implementation for the
Automator• PLATT ACPI (Linked List Undergraduate &
Graduate Mistakes)
04/18/23 13
Analysis of Algorithms• Programmatic Efficiency• Known solutions• Hash-table from above• The Framework library for Sizers is a known example
of bin-packing, but no analysis was performed to determine this
• Trebuchet IV:− Calculate optimal M, N− Given f:− Compute {Na, Mb} such that
• for all {Ni,Mj} − for 0≤N≤ 1023 and 0≤M≤31, − N,M Z+
• there is no |f – FR({Ni,Mj})| < |f – FR({Na,Mb})|• for FR(N,M) defined as
− FR(N,M) = 14.318 × (N 8) / (M 2).
04/18/23 14
Trebuchet IV : Efficiency of M,N Problem
• int* calc_optimal_mn(float f) {• int m,n,m_a,n_a,*ret;• float diff, diff_a = 8000.00; // greater than greatest f range• if (f > 7382.0) {• printf(“f out of range\n");• }• if (f < 3.471) {• printf(“f out of range\n");• }• for (n = 0; n < 1024; n++) {• for (m = 0; m < 32; m++) {• if ((diff = fabs(f - FR(m,n))) < diff_a) {• diff_a = diff;• m_a = m;• n_a = n;• }• }• }
04/18/23 15
Formal Languages• Definition of a computer, computability• Investigation of various models of
computing and their solution spaces• NP-Completeness• Trebuchet IV Command Language
04/18/23 16
Trebuchet IV: Simple Command Language
./trebivreg r 10 r 11 r 12 o 533XXXXXX YYYYYYY Tool v.Z.N 10/18/2006Copyright 2006 Hewlett-Packard Development Company, L.PHP RESTRICTED. DO NOT DISTRIBUTE.Read: 10XXX Register Data: 03Read: 11XXX Register Data: 4ERead: 12XXX Register Data: 4CCalculate Optimal M, N:20811
04/18/23 17
PL 100 SCD Toolkit Patch System• XSL Transform language for inserting
patches• Most patches were file additions, not bit-
changes
04/18/23 18
Operating Systems• Theory, design, and implementation of
Operating Systems• Trebuchet Linux Kernel Driver−Asynchronous polling−Semaphores
04/18/23 19
Trebuchet IV: Linux Kernel Driveru32 get_channel_slots(u16* slots_pop, struct pci_bus* bus, u32 device, u32 function, u32
offset, u16 populated) { if(pci_bus_read_config_word(bus, PCI_DEVFN(device, function), offset, &populated) != 0) { printk("ERROR reading AMBPRESENT!\n"); return -1; } set_slots(slots_pop, populated); return 0;}
/* Set channel slot info into total slot variable */void set_slots(u16* slots_pop, u16 present) { int i; for(i = 0; i < NUM_SLOTS_PER_CHANNEL; ++i) { *slots_pop <<= 1; if(present & (1 << i)) { *slots_pop += 1; } }}
04/18/23 20
Trebuchet IV: Asynchronous Polling while(1) {
bytes = CpqCiRecv(hchannel, recvBuffer, recvsize, &error, &wait); if (0 < bytes) {
break; } if(error !=CpqCiSuccess) {
if(error == CpqCiErrChannelDisconnected) { printf("\nCpqCiRecv() disconnected\n"); CpqCiClose(hchannel); break;
} printf("\nCpqCiRecv() failed: %s\n", error);
} }
04/18/23 21
Trebuchet IV: Semaphore Codeunsigned char CpqCiCasCode[] = { 0x57, // push edi 0x53, // push ebx 0x8b,0x7c,0x24,0x0c, // mov edi,[esp+0xc] 0x8b,0x34,0x24,0x10, // mov eax,[esp+0x10] 0x8b,0x5c,0x24,0x18, // mov ebx,[esp+0x18] 0x8c,0x4c,0x24,0x1c, // mov ecx,[esp+0x1c] 0xf0,0x0f,0xc7,0x0f, // lock cmpxchg8b qword ptr [edi] 0x5f, // pop edi 0x72,0x01, // jnz short _false 0xc3, // ret//_false: 0x4c, // dec eax 0xc3 // ret};
04/18/23 22
Computer Architecture• Theory, Design and Implementation of computer architectures• SPLATT DOS Architecture• Trebuchet IV Southbridge Architecture• Automator Design:
− Pipelined− Instructions broken into micro-instructions
• Instruction: − Run Test A− Collate Data
• Micro-instructions: − Configure RAID Array− Format Array− Install Windows 2000 SP 2− Install Test A− Run Test A− Retrieve Test Results
− Multiple Issue:• Each System Under Test (SUT) acted as a separate instance of the
pipeline− SMP/Muli-tasking
• Multiple Automators negotiate tasks based on SUT availability
04/18/23 23
Artificial Intelligence• Theory, Design, and Application of heuristics
to intractable problems• Theory, Design, and Implementation of
human consciousness and learning• HP-UX ISVs: Learning Installation Errors from
Log files (in progress)• Trebuchet IV
04/18/23 24
Documentation• Code should be documented internally and
externally• Requirements documents• Specifications documents• User’s Guides• API calls• Release notes• Plan of Record• Marketing & budgeting
04/18/23 25
Presentations & Publications• Competitive business assignments• Product development• Research and innovation• Patents• Trade secrets• Public white papers & trade papers