⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 网络处理器例子程序5
💻 TXT
字号:
//---------------------------------------------------------------------
//                                                                      
//                   I N T E L   P R O P R I E T A R Y                   
//                                                                       
//      COPYRIGHT (c)  2001 BY  INTEL  CORPORATION.  ALL RIGHTS          
//      RESERVED.   NO  PART  OF THIS PROGRAM  OR  PUBLICATION  MAY      
//      BE  REPRODUCED,   TRANSMITTED,   TRANSCRIBED,   STORED  IN  A    
//      RETRIEVAL SYSTEM, OR TRANSLATED INTO ANY LANGUAGE OR COMPUTER    
//      LANGUAGE IN ANY FORM OR BY ANY MEANS, ELECTRONIC, MECHANICAL,    
//      MAGNETIC,  OPTICAL,  CHEMICAL, MANUAL, OR OTHERWISE,  WITHOUT    
//      THE PRIOR WRITTEN PERMISSION OF :                                
//                                                                       
//                         INTEL  CORPORATION                            
//                                                                      
//                      2200 MISSION COLLEGE BLVD                        
//                                                                       
//               SANTA  CLARA,  CALIFORNIA  95052-8119                  
//                                                                       
//---------------------------------------------------------------------


Byte align example code readme.txt

Introduction
============

This example illustrates the use of the byte_align_le instruction. 

It takes as input an ethernet packet in little endian format, strips off
the ethernet header and byte aligns the contained IP packet.

Input : 64 byte ethernet packet from SRAM
Output: Byte aligned 50 byte IP packet into SRAM


Example 
=======

64 byte ethernet packet: 00010203 04050607 08091011 12131415 .... 60616263

Bytes : 0-3       4-7       8-11      12 13 14 15  16-19     ....  48 49 50 51   ....   60-63
------------------------------------------------------------------------------------------------------------
Input : 03020100  07060504  11100908  15 14 13 12  19181716  ....  .. .. .. ..   ....   60616263

Processing - Strip off first 14 bytes and byte align the rest
             of the bytes. Pad last 2 bytes with zeroes.

Output: 17161514  21201918  25242322  .. .. .. ..  ........  ....  00 00 63 62

        <--- Bytes 14-63 (50 bytes) of the ethernet packet ----->        <--->

So using a 2 byte shift, bytes 14-63 are aligned on a 4 byte boundary
when stored in SRAM.


Initialization script
=====================

There is a script file "byte_align_le_init.ind" which is called
to create an ethernet packet at the SRAM location _SRC_SRAM_OFFSET.
If you already have an ethernet packet stored at the this location,
remove this script . Its only purpose is to store predictable
data if it doesn't already exist.


How to run the code and verify the result
=========================================

Open the project in the workbench.

To run the code, assemble and start debugging.

Select Go.

Run for at least 1000 cycles.

Select Stop.

Open the memory watch window.

sram[0:63] should be

	0x03020100
	0x07060504
	0x11100908
	0x15141312
	0x19181716
	0x23222120
	0x27262524
	0x31302928
	0x35343332
	0x39383736
	0x43424140
	0x47464544
	0x51504948
	0x55545352
	0x59585756
	0x63626160

sram[80:131] should be

	0x17161514
	0x21201918
	0x25242322
	0x29282726
	0x33323130
	0x37363534
	0x41403938
	0x45444342
	0x49484746
	0x53525150
	0x57565554
	0x61605958
	0x00006362

End of Readme.txt

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -