3Software Design Basics in Embedded Systems - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

3Software Design Basics in Embedded Systems

Description:

3-Software Design Basics in Embedded Systems. 2. Development Environment. Development processor. The processor on which we write and debug our programs. Usually a PC ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 21
Provided by: vah63
Category:

less

Transcript and Presenter's Notes

Title: 3Software Design Basics in Embedded Systems


1
3-Software Design Basics in Embedded Systems
2
Development Environment
  • Development processor
  • The processor on which we write and debug our
    programs
  • Usually a PC
  • Target processor
  • The processor that the program will run on in our
    embedded system
  • Often different from the development processor

Development processor
Target processor
3
Development Environment
  • Compilers
  • Cross compiler
  • Runs on one processor, but generates code for
    another
  • Assemblers
  • Linkers
  • Debuggers
  • Profilers

4
Running a Program
  • If development processor is different than
    target, how can we run our compiled code? Two
    options
  • Download to target processor
  • Simulate
  • Simulation
  • One method Hardware description language
  • But slow, not always available
  • Another method Instruction set simulator (ISS)
  • Runs on development processor, but executes
    instructions of target processor

5
Instruction Set Simulator For A Simple Processor
include ltstdio.hgt typedef struct unsigned
char first_byte, second_byte
instruction instruction program1024
//instruction memory unsigned char memory256
//data memory void run_program(int num_bytes)
int pc -1 unsigned char reg16, fb,
sb while( pc lt (num_bytes / 2) )
fb programpc.first_byte sb
programpc.second_byte switch( fb gtgt 4 )
case 0 regfb 0x0f memorysb
break case 1 memorysb regfb
0x0f break case 2 memoryregfb
0x0f regsb gtgt 4 break
case 3 regfb 0x0f sb break
case 4 regfb 0x0f regsb gtgt 4
break case 5 regfb 0x0f - regsb
gtgt 4 break case 6 pc sb break
default return 1
return 0 int main(int argc, char
argv) FILE ifs If( argc ! 2
(ifs fopen(argv1, rb) NULL )
return 1 if (run_program(fread(pr
ogram, sizeof(program) 0)
print_memory_contents() return(0)
else return(-1)
6
Testing and Debugging
  • ISS
  • Gives us control over time set breakpoints,
    look at register values, set values, step-by-step
    execution, ...
  • But, doesnt interact with real environment
  • Download to board
  • Use device programmer
  • Runs in real environment, but not controllable
  • Compromise emulator
  • Runs in real environment, at speed or near
  • Supports some controllability from the PC

7
Quartus II Development Tool
8
Example of File Menu
9
New Project Wizard
10
Creation of new project
11
Adding files to project
12
Choose device family and specific device
13
Electronic Design Automation Tools
14
Summary of project settings
15
Quartus II display of created project
16
ProcessinggtStart Compilation
17
Assignment gt Pins
For example, SW0,SW1 are connected on FPGA Pins
N25,N26. LEDG0 is pin AE22.
18
Available pins
19
Programming the FPGAToolsgtProgrammer
  • Check the Program/Configure box, then click
    Start.
  • Wait till the progress bar show 100 (done).

20
Chapter Summary
  • General-purpose processors
  • Good performance, low NRE, flexible
  • Controller, data-path, and memory
  • Structured languages prevail
  • But some assembly level programming still
    necessary
  • Many tools available
  • Including instruction-set simulators, and
    in-circuit emulators
  • ASIPs
  • Microcontrollers, DSPs, network processors, more
    customized ASIPs
  • Choosing among processors is an important step
  • Designing a general-purpose processor is
    conceptually the same as designing a
    single-purpose processor
Write a Comment
User Comments (0)
About PowerShow.com