GitHub PushEvent at 2014-08-12 03:54:27
Repository: ARINC664
Actor: zhangwenbo
Payload: {"shas":[["cda7e8de59cec45cba8c3067ffd0caa73ff34c15","176a149f682076e46c0ac0229d4d53931c2f915b@gmail.com","diff --git a/simics-workspace/modules/afdxES/checksum.dml b/simics-workspace/modules/afdxES/checksum.dml\nindex ca5e4f7..544bc67 100644\n--- a/simics-workspace/modules/afdxES/checksum.dml\n+++ b/simics-workspace/modules/afdxES/checksum.dml\n@@ -3,6 +3,8 @@ dml 1.2;\n import \"constant.dml\";\n import \"port-queue.dml\";\n\n+data uint32 Table[256];\n+\n method udp_check_sum(Item *afdx_frame, Afdx_Frame_Packet* afdx_frame_packet) {\n     local uint32 sum =0;\n     local uint32 i=0;\ndiff --git a/simics-workspace/modules/afdxES/constant.dml b/simics-workspace/modules/afdxES/constant.dml\nindex c7ee005..0549a77 100644\n--- a/simics-workspace/modules/afdxES/constant.dml\n+++ b/simics-workspace/modules/afdxES/constant.dml\n@@ -88,6 +88,3 @@ constant PORT_CACHE_MAXSIZE = 1024 * 1024;\n constant MACA_MIB_CONFIG = 1;\n constant MACB_MIB_CONFIG = 2;\n\n-data uint32 tx_buf_overflow_number[256];\n-data uint32 rx_buf_overflow_number[256];\n-data uint32 Table[256];\ndiff --git a/simics-workspace/modules/afdxES/mib_info.dml b/simics-workspace/modules/afdxES/mib_info.dml\nindex ffc0809..68e1fa8 100755\n--- a/simics-workspace/modules/afdxES/mib_info.dml\n+++ b/simics-workspace/modules/afdxES/mib_info.dml\n@@ -61,6 +61,8 @@ data MAC_MIB macb_mib;\n data RX_MIB rx_mib;\n data TX_MIB tx_mib;\n data uint32 mac_sign;\n+data uint32 tx_buf_overflow_number[256];\n+data uint32 rx_buf_overflow_number[256];\n\n method Clear_Maca_Mib_Info() {\n     memset(&$maca_mib, 0, sizeoftype(MAC_MIB));\ndiff --git a/simics-workspace/modules/afdxES/pci-register.dml b/simics-workspace/modules/afdxES/pci-register.dml\nindex fd9b270..6b3d762 100644\n--- a/simics-workspace/modules/afdxES/pci-register.dml\n+++ b/simics-workspace/modules/afdxES/pci-register.dml\n@@ -814,19 +814,18 @@ bank pciport{\n     register mibs_clear              @0x7000;\n     /////////////////////////// MIB begin ////////////////////////\n\n-    register tx_buf_overflow_port_id {\n-        method after_write(memop) {\n-            $tx_buf_overflow_num = $tx_buf_overflow_number[$this];\n+    register tx_buf_overflow_num {\n+        method read() -> (value) {\n+            value = $tx_buf_overflow_number[$tx_buf_overflow_port_id];\n         }\n     }\n-\n-    register rx_buf_overflow_port_id {\n-        method after_write(memop) {\n-            $rx_buf_overflow_num = $rx_buf_overflow_number[$this];\n+\n+    register rx_buf_overflow_num {\n+        method read() -> (value) {\n+            value = $rx_buf_overflow_number[$rx_buf_overflow_port_id];\n+\n         }\n     }\n-\n-\n     register mibs_clear {\n         field res [31:4] is (reserved);\n         field maca_clear [3:3] \"maca clear bit\";\n@@ -1328,27 +1327,26 @@ bank pciport{\n                 local uint8 *buf;\n                 local uint8 i = 0;\n                 if ($middleware_mode == To429Middleware) {\n-                    buf = dbuffer_append(dbuf, item.size-8);\n-                    for (; i < item.size-8; ++i) {\n+                    item.size -= 8;\n+                    buf = dbuffer_append(dbuf, item.size);\n+                    for (; i < item.size; ++i) {\n                         buf[i] = item.frame[i+8];\n                     }\n\n                     call $pci_data_to_memory(Sim_Addr_Space_Memory,\n                                              buf,\n                                              $pci9056.dmapadr0.padr0,\n-                                             item.size-8) -> (ex);\n+                                             item.size) -> (ex);\n                 } else if ($middleware_mode == To664Middleware) {\n-                    /*\n-                    buf = dbuffer_append(dbuf, item.size-8);\n-                    for (; i < item.size-8; ++i) {\n-                        buf[i] = item.frame[i+8];\n+                    buf = dbuffer_append(dbuf, item.size);\n+                    for (; i < item.size; ++i) {\n+                        buf[i] = item.frame[i];\n                     }\n\n                     call $pci_data_to_memory(Sim_Addr_Space_Memory,\n                                              buf,\n                                              $pci9056.dmapadr0.padr0,\n-                                             item.size-8) -> (ex);\n-                    */\n+                                             item.size) -> (ex);\n                 }\n\n                 dbuffer_free(dbuf);//free dbuf\n@@ -1361,8 +1359,7 @@ bank pciport{\n                 log \"info\": \"set DMA done status\";\n                 $pciport.rx_rec_state = 1;\n\n-                log \"info\" : \"The item size is %d\", item.size-8;\n-                $pciport.rx_frame_len = item.size-8;\n+                $pciport.rx_frame_len = item.size;\n             }\n         }\n     }\ndiff --git a/simics-workspace/modules/afdxES/tomiddleware.dml b/simics-workspace/modules/afdxES/tomiddleware.dml\nindex 0a93bfd..d251d6d 100644\n--- a/simics-workspace/modules/afdxES/tomiddleware.dml\n+++ b/simics-workspace/modules/afdxES/tomiddleware.dml\n@@ -29,15 +29,16 @@ method Handle_664_Data(uint8 *data, int length) {\n     local Cache_Item item;\n     local uint32 port_id;\n\n-    memcpy(item.buffer, data+1, length-1);\n-    item.size = length - 1;\n-    port_id = *cast(&data[5], uint32*);\n+    memcpy(item.buffer, data+2, length-2);\n+    item.size = length - 2;\n+    port_id = *cast(&data[1], uint8*);\n\n     switch(data[0]) {\n     case PACKET_RECV:\n         call $EnPortCache($PortCache[port_id], item) -> (is_cached_ok);\n         if (!is_cached_ok) {\n             log \"error\" : \"Port: %d's cache has full!\\n\", port_id;\n+            ++$rx_buf_overflow_number[port_id];\n         }\n         break;\n     case PACKET_MAC_MIB: case PACKET_RX_MIB: case PACKET_TX_MIB:\ndiff --git a/simics-workspace/modules/afdxES/unpacket_frame.dml b/simics-workspace/modules/afdxES/unpacket_frame.dml\nindex e99eae1..dd531f1 100644\n--- a/simics-workspace/modules/afdxES/unpacket_frame.dml\n+++ b/simics-workspace/modules/afdxES/unpacket_frame.dml\n@@ -98,9 +98,9 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {\n                 $pci9056.recvdmadone = 1;\n                 $pciport.rx_check_valid = 1;\n \t\t\t\t//for test end\n-\t\t\t\tif(result == false)\n-\t\t\t\t{\n+\t\t\t\tif(result == false) {\n \t\t\t\t\tlog \"info\" : \"port queue is full!\";\n+                    ++$rx_buf_overflow_number[port_id];\n \t\t\t\t\treturn;\n \t\t\t\t}","Tyrion Lannister",true]],"size":1,"ref":"refs/heads/add-664-work-mode","head":"cda7e8de59cec45cba8c3067ffd0caa73ff34c15"}