Biology for Computer Engineers Course Handout.pptx
unit 5-ERTS.pptx
1. UNIT V
CASE STUDY
Hardware and software co-design - Data Compressor -
Software Modem – Personal Digital Assistants – Set–
Top–Box. – System-on-Silicon – FOSS Tools for
embedded system development.
2/7/2023 1
2. Co design Definition
and Key Concepts
Co design
The meeting of system-level objectives by exploiting
the trade-offs between hardware and software in a
system through their concurrent design
Key concepts
Concurrent: hardware and software developed at the
same time on parallel paths
Integrated: interaction between hardware and software
developments to produce designs that meet
performance criteria and functional specifications
2/7/2023 2
3. Motivations for Codesign
Factors driving codesign (hardware/software systems):
Instruction Set Processors (ISPs) available as cores in many design
kits (386s, DSPs, microcontrollers,etc.)
Systems on Silicon - many transistors available in typical processes
(> 10 million transistors available in IBM ASIC process, etc.)
Increasing capacity of field programmable devices - some devices
even able to be reprogrammed on-the-fly (FPGAs, CPLDs, etc.)
Efficient C compilers for embedded processors
Hardware synthesis capabilities
2/7/2023 3
4. Motivations for Codesign
The importance of codesign in designing
hardware/software systems:
Improves design quality, design cycle time, and cost
Reduces integration and test time
Supports growing complexity of embedded systems
Takes advantage of advances in tools and technologies
Processor cores
High-level hardware synthesis capabilities
ASIC development
2/7/2023 4
5. Categorizing Hardware/Software
Systems
Application Domain
Embedded systems
Manufacturing control
Consumer electronics
Vehicles
Telecommunications
Defense Systems
Instruction Set Architectures
Reconfigurable Systems
Degree of programmability
Access to programming
Levels of programming
Implementation Features
Discrete vs. integrated components
Fabrication technologies
2/7/2023 5
6. Categories of Codesign Problems
Codesign of embedded systems
Usually consist of sensors, controller, and actuators
Are reactive systems
Usually have real-time constraints
Usually have dependability constraints
Codesign of ISAs
Application-specific instruction set processors (ASIPs)
Compiler and hardware optimization and trade-offs
Codesign of Reconfigurable Systems
Systems that can be personalized after manufacture for a specific
application
Reconfiguration can be accomplished before execution or
concurrent with execution (called evolvable systems)
2/7/2023 6
7. Components of the Codesign
Problem
Specification of the system
Hardware/Software Partitioning
Architectural assumptions - type of processor, interface style between
hardware and software, etc.
Partitioning objectives - maximize speedup, latency requirements,
minimize size, cost, etc.
Partitioning strategies - high level partitioning by hand, automated
partitioning using various techniques, etc.
Scheduling
Operation scheduling in hardware
Instruction scheduling in compilers
Process scheduling in operating systems
Modeling the hardware/software system during the design process
2/7/2023 7
9. Goal:
Compress data transmitted over serial line.
Receives byte-size input symbols.
Produces output symbols packed into bytes.
Will build software module only here.
2/7/2023 9
11. Huffman coding
Early statistical text compression algorithm.
Select non-uniform size codes.
Use shorter codes for more common symbols.
Use longer codes for less common symbols.
To allow decoding, codes must have unique
prefixes.
No code can be a prefix of a longer valid code.
2/7/2023 11
13. Example :Huffman code
Read code from root to leaves:
a 1
b 01
c 0000
d 0001
e 0010
f 0011
2/7/2023 13
14. Huffman coder requirements
table
name data compression module
purpose code module for Huffman
compression
inputs encoding table, uncoded
byte-size inputs
outputs packed compression output
symbols
functions Huffman coding
performance fast
manufacturing cost N/A
power N/A
physical size/weight N/A
2/7/2023 14
15. Building a specification
Collaboration diagram shows only steady-state
input/output.
A real system must:
Accept an encoding table.
Allow a system reset that flushes the compression buffer.
2/7/2023 15
17. data-compressor behaviors
encode: Takes one-byte input, generates packed
encoded symbols and a Boolean indicating whether
the buffer is full.
new-symbol-table: installs new symbol table in object,
throws away old table.
flush: returns current state of buffer, including
number of valid bits in buffer.
2/7/2023 17
19. Auxiliary class roles
data-buffer holds both packed and unpacked symbols.
Longest Huffman code for 8-bit inputs is 256 bits.
symbol-table indexes encoded verison of each symbol.
load() puts data in a new symbol table.
2/7/2023 19
21. Encode behavior
encode
create new buffer
add to buffers
add to buffer
return true
return false
input symbol
buffer filled?
T
F
2/7/2023 21
22. Insert behavior
pack into
this buffer
pack bottom bits
into this buffer,
top bits into
overflow buffer
update
length
input
symbol
fills buffer?
T
F
2/7/2023 22
23. Program design
In an object-oriented language, we can reflect the
UML specification in the code more directly.
In a non-object-oriented language, we must either:
add code to provide object-oriented features;
diverge from the specification structure.
2/7/2023 23
24. C++ classes
Class data_buffer {
char databuf[databuflen];
int len;
int length_in_chars() { return len/bitsperbyte; }
public:
void insert(data_buffer,data_buffer&);
int length() { return len; }
int length_in_bytes() { return (int)ceil(len/8.0); }
int initialize();
...
2/7/2023 24
25. C++ classes, cont’d.
class data_compressor {
data_buffer buffer;
int current_bit;
symbol_table table;
public:
boolean encode(char,data_buffer&);
void new_symbol_table(symbol_table);
int flush(data_buffer&);
data_compressor();
~data_compressor();
}
2/7/2023 25
27. Testing
Test by encoding, then decoding:
input symbols
symbol table
encoder decoder
compare
result
2/7/2023 27
28. Code inspection tests
Look at the code for potential problems:
Can we run past end of symbol table?
What happens when the next symbol does not fill the
buffer? Does fill it?
Do very long encoded symbols work properly? Very
short symbols?
Does flush() work properly?
2/7/2023 28
33. Transmission scheme
Send data in 8-bit bytes. Arbitrary spacing between
bytes.
Byte starts with 0 start bit.
Receiver measures length of start bit to synchronize
itself to remaining 8 bits.
start (0) bit 1 bit 2 bit 3 bit 8
...
2/7/2023 33
34. Requirements
Inputs Analog sound input, reset button.
Outputs Analog sound output, LED bit display.
Functions Transmitter: Sends data from memory
in 8-bit bytes plus start bit.
Receiver: Automatically detects bytes
and reads bits. Displays current bit on
LED.
Performance 1200 baud.
Manufacturing cost Dominated by microprocessor and
analog I/O
Power Powered by AC.
Physical
size/weight
Small desktop object.
2/7/2023 34
38. Receiver
Filters (FIR for simplicity) use circular buffers to hold
data.
Timer measures bit length.
State machine recognizes start bits, data bits.
2/7/2023 38
40. Component design and testing
Easy to test transmitter and receiver on host.
Transmitter can be verified with speaker outputs.
Receiver verification tasks:
start bit recognition;
data bit recognition.
2/7/2023 40
41. System integration and testing
Use loopback mode to test components against each
other.
Loopback in software or by connecting D/A and A/D
converters.
2/7/2023 41
46. What is Free/Open Source
Software?
“Briefly, OSS/FS programs are programs whose licenses give users the
freedomto run the program for any purpose, to study and modify the
program, and toredistribute copies of either the original or modified
program (without having topay royalties to previous developers).” David
Wheeler1
WHY FOSS?
“Open-source software has been called many things: a movement, a fad, a
virus,a Communist conspiracy, even the heart and soul of the Internet. But
one point isoften overlooked: Open-source software is also a highly effective
vehicle for thetransfer of wealth from the industrialized world to developing
countries.”Andrew Leonard13
2/7/2023 46
47. The FOSS development
method
Reduced duplication of effort
Building upon the work of others
Better quality control
Reduced maintenance costs
2/7/2023 47
48. The benefits of using FOSS
Besides the low cost of FOSS, there are many other
reasons
Security
Reliability/Stability
Open standards and vendor independence
Reduced reliance on imports
Developing local software capacity
Piracy, IPR, and WTO
Localization
2/7/2023 48