Just enough information to program a Blackfin 90% of this course can be done knowing less than 10% of the Blackfin Instruc...
<ul><li>Reminder – Tutorial tomorrow -- Thursday </li></ul><ul><li>This will help to get ahead on the assignments </li></ul>
Tackled today <ul><li>Recipe for  Just in time knowledge    </li></ul><ul><li>Need  a dollop of “C++” code  </li></ul><ul...
VisualDSP++  IDE <ul><li>Analog Devices’ integrated development environment (IDE) has been used in the following courses <...
Just enough to know <ul><li>If time today will do a demo.  </li></ul><ul><li>Build a directory U:/ENCM415/Assignment </li>...
Analog Devices CONFIGURATOR
Run VisualDSP – Add New Project
WRITE  main.cpp , ADD  to Project
Then  BUILD  (which causes a  LOAD) <ul><li>Build and load </li></ul>
Then  Debug | Run  the code
Prepare for Assignment – C++ result
C++ Version of assignment
Assignment talks about “auto-increment”. Here is how to “try” to get compiler to do it
Prepare  main( )  to call assembly code and  CHECK the results
<ul><li>We thought we needed the function </li></ul><ul><li>Assignment1_ASMversion( ) </li></ul><ul><li>However the linker...
Standard Format “Assembly code” stub <ul><li>Header info </li></ul><ul><li>Prologue </li></ul><ul><li>Code to return value...
Result using “Assembly code” stub Exactly the result we expected
Keyword –  R0  – 32-bit Data Register <ul><li>R0 = 7;  // This returns value 7 … </li></ul>Assembly code comment End of li...
Keyword –  P0  – 32-bit pointer Register 32 bit pointer register  -- P0, P1, P2,  P3, P4 Final exam question from last yea...
Keyword 32-bit Frame pointer 32 bit Frame pointer  --  FP As on many processors  LINK  and  UNLINK  instructions involve h...
Keyword – Memory operations 32 bit memory read  [  ] – long-word access  R0 = [FP + 4]; If FP contains the value 0x2000000...
Keyword – Memory operations 16 bit memory read  W[  ] –word access  R1.H = W[FP + 28]; If FP contains the value 0x20000000...
Keyword – Memory operations 8 bit memory reads  are also possible  B[FP + 4];
<ul><li>Perhaps time for a working example </li></ul>
Programmer’s model <ul><li>32 bit data register  </li></ul><ul><ul><li>R0, R1, R2,  R3, R4, R5, R6, R7 </li></ul></ul><ul>...
Memory access MUST be done via a Pointer register <ul><li>32-bit Memory access </li></ul><ul><ul><li>Place value 0x2000 in...
Memory access MUST be done via a Pointer register <ul><li>16-bit Memory access </li></ul><ul><ul><li>Place value 0x4000 in...
Just enough to know <ul><li>If time today will do a demo.  </li></ul><ul><li>Build a directory U:/ENCM415/Assignment </li>...
Upcoming SlideShare
Loading in …5
×

06 Justenough Information

478 views

Published on

Published in: Technology, Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
478
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

06 Justenough Information

  1. 1. Just enough information to program a Blackfin 90% of this course can be done knowing less than 10% of the Blackfin Instructions Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment
  2. 2. <ul><li>Reminder – Tutorial tomorrow -- Thursday </li></ul><ul><li>This will help to get ahead on the assignments </li></ul>
  3. 3. Tackled today <ul><li>Recipe for Just in time knowledge  </li></ul><ul><li>Need a dollop of “C++” code </li></ul><ul><li>A smizzen of knowledge to build the simplest possible Blackfin assembly language for-loop { } and while { } </li></ul><ul><li>A pinch of Window’s Experience </li></ul><ul><li>And a bowl to put the ingredients in (a computer account with password) and somebody else to do all the clean-up (a partner) and a desk in Labs ICT318 and 320. </li></ul>
  4. 4. VisualDSP++ IDE <ul><li>Analog Devices’ integrated development environment (IDE) has been used in the following courses </li></ul><ul><li>Blackfin – ADSP-BF533 </li></ul><ul><ul><li>ENCM415 – Assembly language and interfacing (2004) </li></ul></ul><ul><ul><li>ENCM417 – Switching to Blackfin for 2007 </li></ul></ul><ul><ul><li>ENCM491 – Real Time Systems (2003) </li></ul></ul><ul><ul><li>ENEL619.23 -- High speed embedded system architectures (2004) </li></ul></ul><ul><ul><li>ENEL583/589 – Many 4 th year team projects (2004) </li></ul></ul><ul><li>TigerSHARC – ADSP-TS201 </li></ul><ul><ul><li>ENCM515 – Comparative Processor Architectures for DSP (Since 1999) </li></ul></ul><ul><ul><li>ENEL619.23 -- High speed embedded system architectures (2004) </li></ul></ul>
  5. 5. Just enough to know <ul><li>If time today will do a demo. </li></ul><ul><li>Build a directory U:/ENCM415/Assignment </li></ul><ul><li>Remember to insert the BF533 board power plug (check that lights on board flash) </li></ul><ul><li>Activate VisualDSP -- Log into a station and use Analog devices CONFIGURATOR to set up a “BF533 session” to connect to the hardware </li></ul><ul><li>Use VisualDSP++ and activate a Blackfin BF533 session – lights should pause </li></ul><ul><li>Build a Blackfin Project, add to your directory </li></ul><ul><li>Add your C++ files to the project </li></ul><ul><li>Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc </li></ul><ul><li>Add your assembly ASM files to the Blackfin project </li></ul><ul><li>Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc </li></ul><ul><li>Don’t forget to add some tests so that you know the code is working </li></ul>
  6. 6. Analog Devices CONFIGURATOR
  7. 7. Run VisualDSP – Add New Project
  8. 8. WRITE main.cpp , ADD to Project
  9. 9. Then BUILD (which causes a LOAD) <ul><li>Build and load </li></ul>
  10. 10. Then Debug | Run the code
  11. 11. Prepare for Assignment – C++ result
  12. 12. C++ Version of assignment
  13. 13. Assignment talks about “auto-increment”. Here is how to “try” to get compiler to do it
  14. 14. Prepare main( ) to call assembly code and CHECK the results
  15. 15. <ul><li>We thought we needed the function </li></ul><ul><li>Assignment1_ASMversion( ) </li></ul><ul><li>However the linker is worried about not finding </li></ul><ul><li>_Assignment1_ASMversion__Fv </li></ul>Build WITHOUT ADDING assembly code file Error message is VERY SPECIAL
  16. 16. Standard Format “Assembly code” stub <ul><li>Header info </li></ul><ul><li>Prologue </li></ul><ul><li>Code to return value </li></ul><ul><li>Epilogue </li></ul>
  17. 17. Result using “Assembly code” stub Exactly the result we expected
  18. 18. Keyword – R0 – 32-bit Data Register <ul><li>R0 = 7; // This returns value 7 … </li></ul>Assembly code comment End of line marker 32 bit data register -- R0, R1, R2, R3, R4, R5, R6, R7
  19. 19. Keyword – P0 – 32-bit pointer Register 32 bit pointer register -- P0, P1, P2, P3, P4 Final exam question from last year Careful – when not in the assembler, the linker may give errors which mention p0 which stands for processor 0. The blackfin hardware can come in multi-core version (p0 and p1 for BF561) or multi-processor version.
  20. 20. Keyword 32-bit Frame pointer 32 bit Frame pointer -- FP As on many processors LINK and UNLINK instructions involve hidden operations on FP and SP (stack pointer) More on that in a later class
  21. 21. Keyword – Memory operations 32 bit memory read [ ] – long-word access R0 = [FP + 4]; If FP contains the value 0x20000000 then fetch the 32-bit value starting at memory location 0x20000004 and place in data register R0
  22. 22. Keyword – Memory operations 16 bit memory read W[ ] –word access R1.H = W[FP + 28]; If FP contains the value 0x20000000 then fetch the 16-bit value starting at memory location 0x20000028 and place in data register R1.H which is the UPPER part of the register R1 (R1.H and R1.L)
  23. 23. Keyword – Memory operations 8 bit memory reads are also possible B[FP + 4];
  24. 24. <ul><li>Perhaps time for a working example </li></ul>
  25. 25. Programmer’s model <ul><li>32 bit data register </li></ul><ul><ul><li>R0, R1, R2, R3, R4, R5, R6, R7 </li></ul></ul><ul><li>16 bit data register </li></ul><ul><ul><li>R0.H, R1.H, R2.H, R3.H ……. R7.H </li></ul></ul><ul><ul><li>R0.L, R1.L, R2.L, R3.L ………. R7.L </li></ul></ul><ul><li>32 bit Pointer register </li></ul><ul><ul><li>P0, P1, P2, P3, P4 </li></ul></ul><ul><li>NO 16 bit Pointer registers </li></ul><ul><li>32 bit Frame Pointer -- FP </li></ul><ul><li>32 bit Stack Pointer -- SP </li></ul>
  26. 26. Memory access MUST be done via a Pointer register <ul><li>32-bit Memory access </li></ul><ul><ul><li>Place value 0x2000 into register P1 THEN </li></ul></ul><ul><ul><li>R0 = [P1] accesses (reads) the 32-bit value at 0x2000 and leaves P1 unchanged (P1 still equals 0x2000) </li></ul></ul><ul><ul><li>R0 = [P1 + 4] accesses (reads) the 32-bit value at 0x2004 and leaves P1 unchanged (P1 still equals 0x2000) </li></ul></ul><ul><ul><li>R0 = [P1++] accesses (reads) the 32-bit value at 0x2000 and autoincrements P1 by the size of a long word (4 bytes) (P1 NOW equals 0x2004) </li></ul></ul>
  27. 27. Memory access MUST be done via a Pointer register <ul><li>16-bit Memory access </li></ul><ul><ul><li>Place value 0x4000 into register P2 THEN </li></ul></ul><ul><ul><li>R0 = W[P2] accesses (reads) the 16-bit value at 0x4000 and leaves P2 unchanged (P2 still equals 0x4000) </li></ul></ul><ul><ul><li>R0 = W[P2 + 4] accesses (reads) the 16-bit value at 0x4004 and leaves P2 unchanged (P2 still equals 0x4000) </li></ul></ul><ul><ul><li>R0 = W[P2++] accesses (reads) the 16-bit value at 0x4000 and autoincrements P2 by the size of a word (2 bytes) (P2 NOW equals 0x2002) </li></ul></ul>
  28. 28. Just enough to know <ul><li>If time today will do a demo. </li></ul><ul><li>Build a directory U:/ENCM415/Assignment </li></ul><ul><li>Remember to insert the BF533 board power plug (check that lights on board flash) </li></ul><ul><li>Activate VisualDSP Log into a station and use Analog devices CONFIGURATOR to set up a “BF533 session” to connect to the hardware </li></ul><ul><li>Use VisualDSP++ and activate a Blackfin BF533 session – lights should pause </li></ul><ul><li>Build a Blackfin Project, add to your directory </li></ul><ul><li>Add your C++ files to the project </li></ul><ul><li>Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc </li></ul><ul><li>Add your ASM files to the project </li></ul><ul><li>Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc </li></ul><ul><li>Don’t forget to add some tests so that you know the code is working </li></ul>

×