Top Banner
More Example Blackfin Code Using the E-UNITTest Framework
30

More Example Blackfin Code Using the E-UNITTest Framework.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: More Example Blackfin Code Using the E-UNITTest Framework.

More Example Blackfin Code

Using the E-UNITTest Framework

Page 2: More Example Blackfin Code Using the E-UNITTest Framework.

Using E-TDD environment

• Build the tests you want to pass

• Build the code

• Test the code

Page 3: More Example Blackfin Code Using the E-UNITTest Framework.
Page 4: More Example Blackfin Code Using the E-UNITTest Framework.
Page 5: More Example Blackfin Code Using the E-UNITTest Framework.
Page 6: More Example Blackfin Code Using the E-UNITTest Framework.

Using E-TDD environment

• Using the C++ tests, build the ASM tests (cut and paste is all that is needed)

• Build the ASM stubs (Makes sure that you can load the load into the processor

• Test the code stub – program will run but fail the tests as only stubs

• Build the code

• Test the code

Page 7: More Example Blackfin Code Using the E-UNITTest Framework.
Page 8: More Example Blackfin Code Using the E-UNITTest Framework.
Page 9: More Example Blackfin Code Using the E-UNITTest Framework.

Build the stub 1Find the name mangling needed

• Just build the code

• VDSP will tell you the necessary name-mangled names

• Cut and paste the names

Page 10: More Example Blackfin Code Using the E-UNITTest Framework.

Build the stub 2

• These examples use an alternate approach to returning to C++, not RTS

• This approach using LINK and UNLINK is required when assembly code subroutine call assembly language subroutines

Page 11: More Example Blackfin Code Using the E-UNITTest Framework.
Page 12: More Example Blackfin Code Using the E-UNITTest Framework.
Page 13: More Example Blackfin Code Using the E-UNITTest Framework.

Expect error messagesBut not these ones

Code reviewMissing a ; at end of line

Page 14: More Example Blackfin Code Using the E-UNITTest Framework.

Need to learn to READAnd listen to assembler

That semicolon is notthe one that was missing

There is one semicolon too manyin the define statement

Page 15: More Example Blackfin Code Using the E-UNITTest Framework.

Less errors

But I am still notlistening to the assembler

Page 16: More Example Blackfin Code Using the E-UNITTest Framework.

Look on reference sheet

R0 *= R1;

Page 2, column 3

Page 17: More Example Blackfin Code Using the E-UNITTest Framework.
Page 18: More Example Blackfin Code Using the E-UNITTest Framework.
Page 19: More Example Blackfin Code Using the E-UNITTest Framework.

AssembledBut failed tests

What of GS is happening

Page 20: More Example Blackfin Code Using the E-UNITTest Framework.
Page 21: More Example Blackfin Code Using the E-UNITTest Framework.
Page 22: More Example Blackfin Code Using the E-UNITTest Framework.
Page 23: More Example Blackfin Code Using the E-UNITTest Framework.

Build the ASM test by cut-and-paste

Page 24: More Example Blackfin Code Using the E-UNITTest Framework.

Stubs assemble

But unexpected messages

Page 25: More Example Blackfin Code Using the E-UNITTest Framework.

Build the ASM test by cut-and-paste CORRECTLY

Page 26: More Example Blackfin Code Using the E-UNITTest Framework.
Page 27: More Example Blackfin Code Using the E-UNITTest Framework.

Wrong method

Incoming parameters – come in R0Outgoing parameters – go in R0

Return values – go in R0

Same problem on the MIPS

Page 28: More Example Blackfin Code Using the E-UNITTest Framework.
Page 29: More Example Blackfin Code Using the E-UNITTest Framework.
Page 30: More Example Blackfin Code Using the E-UNITTest Framework.