EMAC LLD BENCHMARK EXAMPLE 
==========================

The files/folders in this directory contain an example that demonstrates the usage of EMAC driver API's.

The benchmark test can be run on one device with multiple cores and multiple ports (core 0 port 0 receiving 
packets on port 0 and core 1 sending packets on port 1). It can also be run on multiple devices (device 0 
receiving packets and device 1 sending packets). 

For multiple cores/ports case, core 0 opens channel 0 on port 0 as the receiving channel, core 1 opens 
channel 0 on port 1 as the sending channel 

For multiple devices case, device 0/core 0 opens channel 0 on port 0 as the receiving channel, device 1/
core 0 opens channel 0 on port 0 as the sending channel.

The benchmark test demonstrates the EMAC driver raw Ethernet packet TX/RX throughput in # of Mbps. Data cache 
is by default enabled.

Note:
The TX/RX ports should be connected via a local Ethernet switch, no other network (LANs or PCs) should be 
connected to the switch.

                  
Example test files:
-------------------

test_main.c  - main loopback test code
test_loc.h   - test code local header 
test_osal.c  - contains OS Abstraction Layer used by the EMAC driver


Global test configurations:
---------------------------

* multi_core_receive  - Only valid for multiple core devices, by default set to TRUE (the core receives the 
                        packets), user can use CCS to manually change it to 0 after loading the program and 
                        set the core to send packets.

* single_core_receive - Only valid for single core devices, by default set to FALSE (the device sends the 
                        packets), user can use CCS to manually change it to 1 after loading the program and 
                        set the device to receive packets.

* copy_data           - copy packet data before sending packets and after receiving packets, 
                        by default set to FALSE (no data copy)

* broadcast           - send and receive broadcast packets, by default set to FALSE (send unitcast packets)

* multicast           - send and receive multicast packets, by default set to FALSE (send unitcast packets)

* pktbuf_extmem       - packet buffer allocated in external memory, by default set to FALSE
                        (packet buffer allocated in local L2 data memory)
  

Tools required to build project:
------------------------------------

* XDC v3.23.2.47 and above
* CCS Code Gen v7.3.1 and above
* BIOS v6.33.4.39 and above
* C6657 CSL v1.0.0.3 and above


To Run the Example in the little endian mode:
---------------------------------------------

1. Import the loopback project in CCSv5. 
   Project is located in pdk_C6657_X_x_x_x/packages/ti/drv/exampleProjects/EMACBenchmark_exampleProject

2. Choose the little endian configuration in the CCS Build setup
   Note: By default, the project is configured in little endian mode.

3. Build the project.

4. Launch your target configuration and connect to core 0. 

5. Load the OUTPUT file.

8. Execute and check the result printed on console.


To Run the Example in the big endian mode:
------------------------------------------

Run the same steps except step 2:

2. Choose the big endian configuration in project properties (in General tab)
   Note: changing the endianness will prompt you to change the RTSC platform.
         Please choose:
	 Target:	ti.targets.elf.C66_big_endian
	 Platform:	ti.platforms.evm6657
