diff --git a/simics-workspace/modules/RDC/RDC.dml b/simics-workspace/modules/RDC/RDC.dml
index ea5d52e..c23c68e 100644
--- a/simics-workspace/modules/RDC/RDC.dml
+++ b/simics-workspace/modules/RDC/RDC.dml
@@ -231,12 +231,20 @@ extern int socket_recv(char *recvbuf, int size);
 extern int socket_send(char *sendbuf, int size);
 */

-extern void set_runtime_header(void *p);
-extern void set_runtime_name(void *p);
-extern void set_runtime_description(void *p, int flag);
-extern void free_runtime_header(void *p);
-extern void free_runtime_name(void *p);
-extern void free_runtime_description(void *p);
+extern void set_429_middleware_runtime_header(void *p);
+extern void set_429_middleware_runtime_name(void *p);
+extern void set_429_middleware_runtime_description(void *p, int flag);
+extern void free_429_middleware_runtime_header(void *p);
+extern void free_429_middleware_runtime_name(void *p);
+extern void free_429_middleware_runtime_description(void *p);
+
+extern void set_rdc_module_runtime_header(void *p);
+extern void set_rdc_module_runtime_name(void *p);
+extern void set_rdc_module_runtime_description(void *p, int flag);
+extern void free_rdc_module_runtime_header(void *p);
+extern void free_rdc_module_runtime_name(void *p);
+extern void free_rdc_module_runtime_description(void *p);
+
 extern int Strlen(char *str);
 extern int netStrlen(char *str);

@@ -972,22 +980,43 @@ method load_afdx_config()
 method init_429_middleware_ok() {
     local Runtime_Info runtime_info;

-    set_runtime_header(&runtime_info.header);
+    set_429_middleware_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_429_middleware_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_429_middleware_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $transmit_runtime_info(&runtime_info);
+
+    free_429_middleware_runtime_header(&runtime_info.header);
+    free_429_middleware_runtime_name(&runtime_info.name);
+    free_429_middleware_runtime_description(&runtime_info.description);
+}
+
+method init_RDC_module_ok() {
+    local Runtime_Info runtime_info;
+
+    set_rdc_module_runtime_header(&runtime_info.header);
     runtime_info.header_length = Strlen(runtime_info.header);
     runtime_info.type = 0;
-    set_runtime_name(&runtime_info.name);
+    set_rdc_module_runtime_header(&runtime_info.name);
     runtime_info.name_length = Strlen(runtime_info.name);
     runtime_info.flag = 0;
-    set_runtime_description(&runtime_info.description, runtime_info.flag);
+    set_rdc_module_runtime_description(&runtime_info.description, runtime_info.flag);
     runtime_info.description_length = Strlen(runtime_info.description);
     runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
         sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);

     call $transmit_runtime_info(&runtime_info);

-    free_runtime_header(&runtime_info.header);
-    free_runtime_name(&runtime_info.name);
-    free_runtime_description(&runtime_info.description);
+    free_rdc_module_runtime_header(&runtime_info.header);
+    free_rdc_module_runtime_name(&runtime_info.name);
+    free_rdc_module_runtime_description(&runtime_info.description);
 }

 method transmit_runtime_info(Runtime_Info *runtime_info) {
@@ -1006,8 +1035,8 @@ method post_init() {
 	call $InitTime();
 	init_429_middleware();
     call $init_429_middleware_ok();
+    call $init_RDC_module_ok();
     call $socket_loop_recv();
-
 }

diff --git a/simics-workspace/modules/RDC/rdc_runtime_info.c b/simics-workspace/modules/RDC/rdc_runtime_info.c
index b5cc35a..6c11f96 100644
--- a/simics-workspace/modules/RDC/rdc_runtime_info.c
+++ b/simics-workspace/modules/RDC/rdc_runtime_info.c
@@ -1,7 +1,7 @@
 #include "rdc_runtime_info.h"
 #include <stdlib.h>

-void set_runtime_header(void *p) {
+void set_429_middleware_runtime_header(void *p) {
     char *header = "Hwa";
     int header_length = strlen(header) + 1;

@@ -9,7 +9,7 @@ void set_runtime_header(void *p) {
     memcpy(*(char **)p, header, header_length);
 }

-void set_runtime_name(void *p) {
+void set_429_middleware_runtime_name(void *p) {
     char *name = "A429Middleware";
     int name_length = strlen(name) + 1;

@@ -17,7 +17,7 @@ void set_runtime_name(void *p) {
     memcpy(*(char **)p, name, name_length);
 }

-void set_runtime_description(void *p, int flag) {
+void set_429_middleware_runtime_description(void *p, int flag) {
     if (flag == 0) {            /* success */
         char *description = "A429中间件初始化成功";
         int description_length = strlen(description) + 1;
@@ -31,17 +31,62 @@ void set_runtime_description(void *p, int flag) {
     }
 }

-void free_runtime_header(void *p) {
+void free_429_middleware_runtime_header(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_runtime_name(void *p) {
+void free_429_middleware_runtime_name(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_runtime_description(void *p) {
+void free_429_middleware_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void set_rdc_module_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_rdc_module_runtime_name(void *p) {
+    char *name = "RDCModel";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_rdc_module_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "RDC模型初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "RDC模型初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_rdc_module_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_rdc_module_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_rdc_module_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
diff --git a/simics-workspace/modules/RDC/rdc_runtime_info.h b/simics-workspace/modules/RDC/rdc_runtime_info.h
index ee91115..1b5e41a 100644
--- a/simics-workspace/modules/RDC/rdc_runtime_info.h
+++ b/simics-workspace/modules/RDC/rdc_runtime_info.h
@@ -1,11 +1,18 @@
 #ifndef RDC_RUNTIME_INFO_H
 #define RDC_RUNTIME_INFO_H

-extern void set_runtime_header(void *p);
-extern void set_runtime_name(void *p);
-extern void set_runtime_description(void *p, int flag);
-extern void free_runtime_header(void *p);
-extern void free_runtime_name(void *p);
-extern void free_runtime_description(void *p);
+extern void set_429_middleware_runtime_header(void *p);
+extern void set_429_middleware_runtime_name(void *p);
+extern void set_429_middleware_runtime_description(void *p, int flag);
+extern void free_429_middleware_runtime_header(void *p);
+extern void free_429_middleware_runtime_name(void *p);
+extern void free_429_middleware_runtime_description(void *p);
+
+extern void set_rdc_module_runtime_header(void *p);
+extern void set_rdc_module_runtime_name(void *p);
+extern void set_rdc_module_runtime_description(void *p, int flag);
+extern void free_rdc_module_runtime_header(void *p);
+extern void free_rdc_module_runtime_name(void *p);
+extern void free_rdc_module_runtime_description(void *p);

 #endif
add RDC Module init info
diff --git a/simics-workspace/modules/afdxES/Makefile b/simics-workspace/modules/afdxES/Makefile
index 9520b85..82d6319 100644
--- a/simics-workspace/modules/afdxES/Makefile
+++ b/simics-workspace/modules/afdxES/Makefile
@@ -5,7 +5,7 @@
 #

 MODULE_CLASSES = afdxES
-SRC_FILES = tomiddleware.c communicate-with-qt.c untils.c
+SRC_FILES = tomiddleware.c communicate-with-qt.c untils.c afdxES_runtime_info.c
 DML_FILES = afdxES.dml
 DMLC_FLAGS = -m -I$(SIMICS_WORKSPACE)/include

diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index f4c925a..bd88abe 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -30,6 +30,13 @@ extern int netStrlen(char *str);
 extern int Ntohl(int data);
 extern int Htonl(int data);

+extern void set_afdxES_module_runtime_header(void *p);
+extern void set_afdxES_module_runtime_name(void *p);
+extern void set_afdxES_module_runtime_description(void *p, int flag);
+extern void free_afdxES_module_runtime_header(void *p);
+extern void free_afdxES_module_runtime_name(void *p);
+extern void free_afdxES_module_runtime_description(void *p);
+
 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
     parameter configuration = "optional";
@@ -97,55 +104,82 @@ implement ieee_802_3_mac {
 	}
 }

+
 implement transmit_runtime_info_between_afdxES_and_afdxES2 {
     method transmit_runtime_info(Runtime_Info *runtime_info) {
-        local int buf_len = runtime_info->header_length + Strlen(runtime_info->header) + sizeof(runtime_info->len) + runtime_info->len;
-        local char *buf = new char [buf_len];
-
-        local int header_length = Htonl(runtime_info->header_length);
-        local int name_length = Htonl(runtime_info->name_length);
-        local int description_length = Htonl(runtime_info->description_length);
-        local int len = Htonl(runtime_info->len);
-        local int type = Htonl(runtime_info->type);
-        local int flag = Htonl(runtime_info->flag);
+        call Transmit_runtime_info(runtime_info);
+    }
+}
+
+method Transmit_runtime_info(Runtime_Info *runtime_info) {
+    local int buf_len = runtime_info->header_length + Strlen(runtime_info->header) + sizeof(runtime_info->len) + runtime_info->len;
+    local char *buf = new char [buf_len];
+
+    local int header_length = Htonl(runtime_info->header_length);
+    local int name_length = Htonl(runtime_info->name_length);
+    local int description_length = Htonl(runtime_info->description_length);
+    local int len = Htonl(runtime_info->len);
+    local int type = Htonl(runtime_info->type);
+    local int flag = Htonl(runtime_info->flag);

-        memcpy(buf,
-               &header_length,
-               sizeof(runtime_info->header_length));
-        memcpy(buf + sizeof(runtime_info->header_length),
-               runtime_info->header,
-               runtime_info->header_length);
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length,
-               &len,
-               sizeof(runtime_info->len));
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len),
-               &type,
-               sizeof(runtime_info->type));
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type),
-               &name_length,
-               sizeof(runtime_info->name_length));
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length),
-               runtime_info->name,
-               runtime_info->name_length);
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
-               runtime_info->name_length,
-               &flag,
-               sizeof(runtime_info->flag));
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
-               runtime_info->name_length + sizeof(runtime_info->flag),
-               &description_length,
-               sizeof(runtime_info->description_length));
-        memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
-               runtime_info->name_length + sizeof(runtime_info->flag) + sizeof(runtime_info->description_length),
-               runtime_info->description,
-               runtime_info->description_length);
+    memcpy(buf,
+           &header_length,
+           sizeof(runtime_info->header_length));
+    memcpy(buf + sizeof(runtime_info->header_length),
+           runtime_info->header,
+           runtime_info->header_length);
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length,
+           &len,
+           sizeof(runtime_info->len));
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len),
+           &type,
+           sizeof(runtime_info->type));
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type),
+           &name_length,
+           sizeof(runtime_info->name_length));
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length),
+           runtime_info->name,
+           runtime_info->name_length);
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
+           runtime_info->name_length,
+           &flag,
+           sizeof(runtime_info->flag));
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
+           runtime_info->name_length + sizeof(runtime_info->flag),
+           &description_length,
+           sizeof(runtime_info->description_length));
+    memcpy(buf + sizeof(runtime_info->header_length) + runtime_info->header_length + sizeof(runtime_info->len) + sizeof(runtime_info->type) + sizeof(runtime_info->name_length) +
+           runtime_info->name_length + sizeof(runtime_info->flag) + sizeof(runtime_info->description_length),
+           runtime_info->description,
+           runtime_info->description_length);

-        qt_socket_send(buf, buf_len);
+    qt_socket_send(buf, buf_len);

-        delete buf;
-    }
+    delete buf;
 }

+method init_A664_module_ok() {
+    local Runtime_Info runtime_info;
+
+    set_afdxES_module_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_afdxES_module_runtime_header(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_afdxES_module_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_afdxES_module_runtime_header(&runtime_info.header);
+    free_afdxES_module_runtime_name(&runtime_info.name);
+    free_afdxES_module_runtime_description(&runtime_info.description);
+}
+
+
 attribute middleware_mode "Used to switch middleware mode" {
     parameter documentation = "Used to switch work mode (to664middleware/to429middleware)";
     parameter allocate_type = "uint32";
@@ -170,4 +204,5 @@ method post_init() {
     call $init_middleware_mode();
     call $init_udp_flag();
     call $init_vl_cfg();
+    call $init_A664_module_ok();
 }
diff --git a/simics-workspace/modules/RDC/RDC.dml b/simics-workspace/modules/RDC/RDC.dml
index c23c68e..29c283b 100644
--- a/simics-workspace/modules/RDC/RDC.dml
+++ b/simics-workspace/modules/RDC/RDC.dml
@@ -1004,7 +1004,7 @@ method init_RDC_module_ok() {
     set_rdc_module_runtime_header(&runtime_info.header);
     runtime_info.header_length = Strlen(runtime_info.header);
     runtime_info.type = 0;
-    set_rdc_module_runtime_header(&runtime_info.name);
+    set_rdc_module_runtime_name(&runtime_info.name);
     runtime_info.name_length = Strlen(runtime_info.name);
     runtime_info.flag = 0;
     set_rdc_module_runtime_description(&runtime_info.description, runtime_info.flag);
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index bd88abe..b82c99a 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -37,6 +37,13 @@ extern void free_afdxES_module_runtime_header(void *p);
 extern void free_afdxES_module_runtime_name(void *p);
 extern void free_afdxES_module_runtime_description(void *p);

+extern void set_main_board_runtime_header(void *p);
+extern void set_main_board_runtime_name(void *p);
+extern void set_main_board_runtime_description(void *p, int flag);
+extern void free_main_board_runtime_header(void *p);
+extern void free_main_board_runtime_name(void *p);
+extern void free_main_board_runtime_description(void *p);
+
 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
     parameter configuration = "optional";
@@ -107,7 +114,7 @@ implement ieee_802_3_mac {

 implement transmit_runtime_info_between_afdxES_and_afdxES2 {
     method transmit_runtime_info(Runtime_Info *runtime_info) {
-        call Transmit_runtime_info(runtime_info);
+        call $Transmit_runtime_info(runtime_info);
     }
 }

@@ -158,13 +165,34 @@ method Transmit_runtime_info(Runtime_Info *runtime_info) {
     delete buf;
 }

+method init_main_board_ok() {
+    local Runtime_Info runtime_info;
+
+    set_main_board_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_main_board_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_main_board_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_main_board_runtime_header(&runtime_info.header);
+    free_main_board_runtime_name(&runtime_info.name);
+    free_main_board_runtime_description(&runtime_info.description);
+}
+
 method init_A664_module_ok() {
     local Runtime_Info runtime_info;

     set_afdxES_module_runtime_header(&runtime_info.header);
     runtime_info.header_length = Strlen(runtime_info.header);
     runtime_info.type = 0;
-    set_afdxES_module_runtime_header(&runtime_info.name);
+    set_afdxES_module_runtime_name(&runtime_info.name);
     runtime_info.name_length = Strlen(runtime_info.name);
     runtime_info.flag = 0;
     set_afdxES_module_runtime_description(&runtime_info.description, runtime_info.flag);
@@ -198,6 +226,7 @@ attribute is_cfg_done "If true, don't change cfg table index and write cfg table

 method post_init() {
     qt_socket_init();
+    call $init_main_board_ok();
     call $pci_config.update_all_mappings();
 	call $gen_normal_table($Table);
     call $init_port_queue();
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index 456c3cc..e75df7c 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -46,7 +46,7 @@ void free_afdxES_module_runtime_description(void *p) {
     *(char **)p = NULL;
 }

-void set_rdc_module_runtime_header(void *p) {
+void set_main_board_runtime_header(void *p) {
     char *header = "Hwa";
     int header_length = strlen(header) + 1;

@@ -54,39 +54,39 @@ void set_rdc_module_runtime_header(void *p) {
     memcpy(*(char **)p, header, header_length);
 }

-void set_rdc_module_runtime_name(void *p) {
-    char *name = "RDCModel";
+void set_main_board_runtime_name(void *p) {
+    char *name = "MainBoard";
     int name_length = strlen(name) + 1;

     *(char **)p = (char *)malloc(name_length);
     memcpy(*(char **)p, name, name_length);
 }

-void set_rdc_module_runtime_description(void *p, int flag) {
+void set_main_board_runtime_description(void *p, int flag) {
     if (flag == 0) {            /* success */
-        char *description = "RDC模型初始化成功";
+        char *description = "主机板模型初始化成功";
         int description_length = strlen(description) + 1;
         *(char **)p = (char *)malloc(description_length);
         memcpy(*(char **)p, description, description_length);
     } else {
-        char *description = "RDC模型初始化失败";
+        char *description = "主机板模型初始化失败";
         int description_length = strlen(description) + 1;
         *(char **)p = (char *)malloc(description_length);
         memcpy(*(char **)p, description, description_length);
     }
 }

-void free_rdc_module_runtime_header(void *p) {
+void free_main_board_runtime_header(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_rdc_module_runtime_name(void *p) {
+void free_main_board_runtime_name(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_rdc_module_runtime_description(void *p) {
+void free_main_board_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index b71e756..a2ce5bd 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -8,11 +8,11 @@ extern void free_afdxES_module_runtime_header(void *p);
 extern void free_afdxES_module_runtime_name(void *p);
 extern void free_afdxES_module_runtime_description(void *p);

-extern void set_rdc_module_runtime_header(void *p);
-extern void set_rdc_module_runtime_name(void *p);
-extern void set_rdc_module_runtime_description(void *p, int flag);
-extern void free_rdc_module_runtime_header(void *p);
-extern void free_rdc_module_runtime_name(void *p);
-extern void free_rdc_module_runtime_description(void *p);
+extern void set_main_board_runtime_header(void *p);
+extern void set_main_board_runtime_name(void *p);
+extern void set_main_board_runtime_description(void *p, int flag);
+extern void free_main_board_runtime_header(void *p);
+extern void free_main_board_runtime_name(void *p);
+extern void free_main_board_runtime_description(void *p);

 #endif
diff --git a/simics-workspace/modules/RDC/RDC.dml b/simics-workspace/modules/RDC/RDC.dml
index 29c283b..a4408bb 100644
--- a/simics-workspace/modules/RDC/RDC.dml
+++ b/simics-workspace/modules/RDC/RDC.dml
@@ -245,6 +245,13 @@ extern void free_rdc_module_runtime_header(void *p);
 extern void free_rdc_module_runtime_name(void *p);
 extern void free_rdc_module_runtime_description(void *p);

+extern void set_429_card_runtime_header(void *p);
+extern void set_429_card_runtime_name(void *p);
+extern void set_429_card_runtime_description(void *p, int flag);
+extern void free_429_card_runtime_header(void *p);
+extern void free_429_card_runtime_name(void *p);
+extern void free_429_card_runtime_description(void *p);
+
 extern int Strlen(char *str);
 extern int netStrlen(char *str);

@@ -1019,6 +1026,27 @@ method init_RDC_module_ok() {
     free_rdc_module_runtime_description(&runtime_info.description);
 }

+method init_429_card_ok() {
+    local Runtime_Info runtime_info;
+
+    set_429_card_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_429_card_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_429_card_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $transmit_runtime_info(&runtime_info);
+
+    free_429_card_runtime_header(&runtime_info.header);
+    free_429_card_runtime_name(&runtime_info.name);
+    free_429_card_runtime_description(&runtime_info.description);
+}
+
 method transmit_runtime_info(Runtime_Info *runtime_info) {
     $ARINC664_2.transmit_runtime_info_between_afdxES2_and_RDC.transmit_runtime_info(runtime_info);
 }
@@ -1035,6 +1063,7 @@ method post_init() {
 	call $InitTime();
 	init_429_middleware();
     call $init_429_middleware_ok();
+    call $init_429_card_ok();
     call $init_RDC_module_ok();
     call $socket_loop_recv();
 }
diff --git a/simics-workspace/modules/RDC/rdc_runtime_info.c b/simics-workspace/modules/RDC/rdc_runtime_info.c
index 6c11f96..b1a20fe 100644
--- a/simics-workspace/modules/RDC/rdc_runtime_info.c
+++ b/simics-workspace/modules/RDC/rdc_runtime_info.c
@@ -90,3 +90,48 @@ void free_rdc_module_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
+
+void set_429_card_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_429_card_runtime_name(void *p) {
+    char *name = "A429Card";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_429_card_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "A429板卡初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "A429板卡初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_429_card_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_429_card_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_429_card_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
diff --git a/simics-workspace/modules/RDC/rdc_runtime_info.h b/simics-workspace/modules/RDC/rdc_runtime_info.h
index 1b5e41a..7ce2b88 100644
--- a/simics-workspace/modules/RDC/rdc_runtime_info.h
+++ b/simics-workspace/modules/RDC/rdc_runtime_info.h
@@ -15,4 +15,11 @@ extern void free_rdc_module_runtime_header(void *p);
 extern void free_rdc_module_runtime_name(void *p);
 extern void free_rdc_module_runtime_description(void *p);

+extern void set_429_card_runtime_header(void *p);
+extern void set_429_card_runtime_name(void *p);
+extern void set_429_card_runtime_description(void *p, int flag);
+extern void free_429_card_runtime_header(void *p);
+extern void free_429_card_runtime_name(void *p);
+extern void free_429_card_runtime_description(void *p);
+
 #endif
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index b82c99a..8d9e093 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -37,12 +37,12 @@ extern void free_afdxES_module_runtime_header(void *p);
 extern void free_afdxES_module_runtime_name(void *p);
 extern void free_afdxES_module_runtime_description(void *p);

-extern void set_main_board_runtime_header(void *p);
-extern void set_main_board_runtime_name(void *p);
-extern void set_main_board_runtime_description(void *p, int flag);
-extern void free_main_board_runtime_header(void *p);
-extern void free_main_board_runtime_name(void *p);
-extern void free_main_board_runtime_description(void *p);
+extern void set_main_board_module_runtime_header(void *p);
+extern void set_main_board_module_runtime_name(void *p);
+extern void set_main_board_module_runtime_description(void *p, int flag);
+extern void free_main_board_module_runtime_header(void *p);
+extern void free_main_board_module_runtime_name(void *p);
+extern void free_main_board_module_runtime_description(void *p);

 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
@@ -165,25 +165,25 @@ method Transmit_runtime_info(Runtime_Info *runtime_info) {
     delete buf;
 }

-method init_main_board_ok() {
+method init_main_board_module_ok() {
     local Runtime_Info runtime_info;

-    set_main_board_runtime_header(&runtime_info.header);
+    set_main_board_module_runtime_header(&runtime_info.header);
     runtime_info.header_length = Strlen(runtime_info.header);
     runtime_info.type = 0;
-    set_main_board_runtime_name(&runtime_info.name);
+    set_main_board_module_runtime_name(&runtime_info.name);
     runtime_info.name_length = Strlen(runtime_info.name);
     runtime_info.flag = 0;
-    set_main_board_runtime_description(&runtime_info.description, runtime_info.flag);
+    set_main_board_module_runtime_description(&runtime_info.description, runtime_info.flag);
     runtime_info.description_length = Strlen(runtime_info.description);
     runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
         sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);

     call $Transmit_runtime_info(&runtime_info);

-    free_main_board_runtime_header(&runtime_info.header);
-    free_main_board_runtime_name(&runtime_info.name);
-    free_main_board_runtime_description(&runtime_info.description);
+    free_main_board_module_runtime_header(&runtime_info.header);
+    free_main_board_module_runtime_name(&runtime_info.name);
+    free_main_board_module_runtime_description(&runtime_info.description);
 }

 method init_A664_module_ok() {
@@ -226,7 +226,7 @@ attribute is_cfg_done "If true, don't change cfg table index and write cfg table

 method post_init() {
     qt_socket_init();
-    call $init_main_board_ok();
+    call $init_main_board_module_ok();
     call $pci_config.update_all_mappings();
 	call $gen_normal_table($Table);
     call $init_port_queue();
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index e75df7c..a504925 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -46,7 +46,7 @@ void free_afdxES_module_runtime_description(void *p) {
     *(char **)p = NULL;
 }

-void set_main_board_runtime_header(void *p) {
+void set_main_board_module_runtime_header(void *p) {
     char *header = "Hwa";
     int header_length = strlen(header) + 1;

@@ -54,15 +54,15 @@ void set_main_board_runtime_header(void *p) {
     memcpy(*(char **)p, header, header_length);
 }

-void set_main_board_runtime_name(void *p) {
-    char *name = "MainBoard";
+void set_main_board_module_runtime_name(void *p) {
+    char *name = "MainBoardModule";
     int name_length = strlen(name) + 1;

     *(char **)p = (char *)malloc(name_length);
     memcpy(*(char **)p, name, name_length);
 }

-void set_main_board_runtime_description(void *p, int flag) {
+void set_main_board_module_runtime_description(void *p, int flag) {
     if (flag == 0) {            /* success */
         char *description = "主机板模型初始化成功";
         int description_length = strlen(description) + 1;
@@ -76,17 +76,17 @@ void set_main_board_runtime_description(void *p, int flag) {
     }
 }

-void free_main_board_runtime_header(void *p) {
+void free_main_board_module_runtime_header(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_main_board_runtime_name(void *p) {
+void free_main_board_module_runtime_name(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }

-void free_main_board_runtime_description(void *p) {
+void free_main_board_module_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index a2ce5bd..e80693a 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -8,11 +8,11 @@ extern void free_afdxES_module_runtime_header(void *p);
 extern void free_afdxES_module_runtime_name(void *p);
 extern void free_afdxES_module_runtime_description(void *p);

-extern void set_main_board_runtime_header(void *p);
-extern void set_main_board_runtime_name(void *p);
-extern void set_main_board_runtime_description(void *p, int flag);
-extern void free_main_board_runtime_header(void *p);
-extern void free_main_board_runtime_name(void *p);
-extern void free_main_board_runtime_description(void *p);
+extern void set_main_board_module_runtime_header(void *p);
+extern void set_main_board_module_runtime_name(void *p);
+extern void set_main_board_module_runtime_description(void *p, int flag);
+extern void free_main_board_module_runtime_header(void *p);
+extern void free_main_board_module_runtime_name(void *p);
+extern void free_main_board_module_runtime_description(void *p);

 #endif
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index 8d9e093..1bc31d1 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -44,6 +44,13 @@ extern void free_main_board_module_runtime_header(void *p);
 extern void free_main_board_module_runtime_name(void *p);
 extern void free_main_board_module_runtime_description(void *p);

+extern void set_vxworks_runtime_header(void *p);
+extern void set_vxworks_runtime_name(void *p);
+extern void set_vxworks_runtime_description(void *p, int flag);
+extern void free_vxworks_runtime_header(void *p);
+extern void free_vxworks_runtime_name(void *p);
+extern void free_vxworks_runtime_description(void *p);
+
 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
     parameter configuration = "optional";
@@ -207,6 +214,26 @@ method init_A664_module_ok() {
     free_afdxES_module_runtime_description(&runtime_info.description);
 }

+method init_vxworks_ok() {
+    local Runtime_Info runtime_info;
+
+    set_vxworks_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_vxworks_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_vxworks_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_vxworks_runtime_header(&runtime_info.header);
+    free_vxworks_runtime_name(&runtime_info.name);
+    free_vxworks_runtime_description(&runtime_info.description);
+}

 attribute middleware_mode "Used to switch middleware mode" {
     parameter documentation = "Used to switch work mode (to664middleware/to429middleware)";
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index a504925..473983d 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -55,7 +55,7 @@ void set_main_board_module_runtime_header(void *p) {
 }

 void set_main_board_module_runtime_name(void *p) {
-    char *name = "MainBoardModule";
+    char *name = "MainBoardModel";
     int name_length = strlen(name) + 1;

     *(char **)p = (char *)malloc(name_length);
@@ -90,3 +90,48 @@ void free_main_board_module_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
+
+void set_vxworks_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_vxworks_runtime_name(void *p) {
+    char *name = "VxWorks";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_vxworks_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "VxWorks操作系统加载初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "VxWorks操作系统加载初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_vxworks_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_vxworks_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_vxworks_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index e80693a..57bc7e7 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -15,4 +15,11 @@ extern void free_main_board_module_runtime_header(void *p);
 extern void free_main_board_module_runtime_name(void *p);
 extern void free_main_board_module_runtime_description(void *p);

+extern void set_vxworks_runtime_header(void *p);
+extern void set_vxworks_runtime_name(void *p);
+extern void set_vxworks_runtime_description(void *p, int flag);
+extern void free_vxworks_runtime_header(void *p);
+extern void free_vxworks_runtime_name(void *p);
+extern void free_vxworks_runtime_description(void *p);
+
 #endif
diff --git a/simics-workspace/modules/afdxES/pci-register.dml b/simics-workspace/modules/afdxES/pci-register.dml
index d3e569d..d594d90 100644
--- a/simics-workspace/modules/afdxES/pci-register.dml
+++ b/simics-workspace/modules/afdxES/pci-register.dml
@@ -4,7 +4,9 @@ import "pci-device.dml";          // Generic PCI device
 import "binary-search.dml";
 import "quick-sort.dml";
 import "log.dml";
+
 extern void LoadCfgTo664Middleware();
+
 // Basic bank declaration
 bank pci_config {
     // List of base address registers used by the device
@@ -56,12 +58,14 @@ bank pci9056{
     parameter documentation = "Control and Status Register Mapping";
     parameter function = 0;
     // if the target is 653, make true the byte_order is big-endian
-    // parameter byte_order = "big-endian";
-    parameter byte_order = "little-endian";
+    parameter byte_order = "big-endian";
+    // else
+    // parameter byte_order = "little-endian";
     parameter register_size = 4;
     parameter partial = true;
     // if the target is 653, make true enable overlapping
-    // parameter overlapping = true;
+    parameter overlapping = true;
+
     register lmisc1 @ 0x000d "Local Miscellaneous Control" {
         parameter hard_reset_value = 0x4;
     }
@@ -162,9 +166,11 @@ bank pci9056{
         }
         field res [7:5] is (reserved);
     }
+
     // if the target is 653, make true the size is 4
-    // dmacsr1 size 4 @ 0x00a9 "DMA Channel 1 Command/Status" {
-    register dmacsr1 size 1 @ 0x00a9 "DMA Channel 1 Command/Status" {
+    register dmacsr1 size 4 @ 0x00a9 "DMA Channel 1 Command/Status" {
+    // else
+    // register dmacsr1 size 1 @ 0x00a9 "DMA Channel 1 Command/Status" {
         field dma1e [0:0] "DMA Channel 1 Enable";
         field dma1s [1:1] "DMA Channel 1 Start" {
             method write(value) {
@@ -207,8 +213,9 @@ bank pciport{
     parameter documentation = "Control and Status Register Mapping";
     parameter function = 1;
     // if the target is 653, make true the byte_order is little-endian
-    // parameter byte_order = "little-endian";
-    parameter byte_order = "big-endian";
+    parameter byte_order = "little-endian";
+    // else
+    // parameter byte_order = "big-endian";
     parameter register_size = 4;
     parameter partial = true;

@@ -539,15 +546,16 @@ bank pciport{
 				ret = Init_664_Card();
 				$recv_port_num = get_recv_port_num();
 				if(ret == 0)
-					log "info":"init middle succesee())()())(()())(@@@@@@@@@";
+					log "info":"init middle succesee";
 				else
-					log "info":"init middle failed! ret =%d())()())(()())(@@@@@@@@@",ret;
+					log "info":"init middle failed! ret =%d",ret;
 				call $Recv_Data_From_664_Middleware_Loop_Event();
                 break;
             default:
                 log "error" : "Unsupported work mode!";
                 break;
             }
+            call $init_vxworks_ok();
         }
     }
diff --git a/simics-workspace/modules/RDC/RDC.dml b/simics-workspace/modules/RDC/RDC.dml
index a4408bb..f7bb643 100644
--- a/simics-workspace/modules/RDC/RDC.dml
+++ b/simics-workspace/modules/RDC/RDC.dml
@@ -1062,9 +1062,9 @@ method post_init() {
 	call $load_afdx_config();
 	call $InitTime();
 	init_429_middleware();
+    call $init_RDC_module_ok();
     call $init_429_middleware_ok();
     call $init_429_card_ok();
-    call $init_RDC_module_ok();
     call $socket_loop_recv();
 }

diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index 1bc31d1..f802318 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -51,6 +51,13 @@ extern void free_vxworks_runtime_header(void *p);
 extern void free_vxworks_runtime_name(void *p);
 extern void free_vxworks_runtime_description(void *p);

+extern void set_a664_driver_middleware_runtime_header(void *p);
+extern void set_a664_driver_middleware_runtime_name(void *p);
+extern void set_a664_driver_middleware_runtime_description(void *p, int flag);
+extern void free_a664_driver_middleware_runtime_header(void *p);
+extern void free_a664_driver_middleware_runtime_name(void *p);
+extern void free_a664_driver_middleware_runtime_description(void *p);
+
 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
     parameter configuration = "optional";
@@ -235,6 +242,27 @@ method init_vxworks_ok() {
     free_vxworks_runtime_description(&runtime_info.description);
 }

+method init_a664_driver_middleware_ok() {
+    local Runtime_Info runtime_info;
+
+    set_a664_driver_middleware_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_a664_driver_middleware_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_a664_driver_middleware_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_a664_driver_middleware_runtime_header(&runtime_info.header);
+    free_a664_driver_middleware_runtime_name(&runtime_info.name);
+    free_a664_driver_middleware_runtime_description(&runtime_info.description);
+}
+
 attribute middleware_mode "Used to switch middleware mode" {
     parameter documentation = "Used to switch work mode (to664middleware/to429middleware)";
     parameter allocate_type = "uint32";
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index 473983d..da98afc 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -55,7 +55,7 @@ void set_main_board_module_runtime_header(void *p) {
 }

 void set_main_board_module_runtime_name(void *p) {
-    char *name = "MainBoardModel";
+    char *name = "MainboardModel";
     int name_length = strlen(name) + 1;

     *(char **)p = (char *)malloc(name_length);
@@ -135,3 +135,48 @@ void free_vxworks_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
+
+void set_a664_driver_middleware_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_a664_driver_middleware_runtime_name(void *p) {
+    char *name = "A664DriveMiddleware";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_a664_driver_middleware_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "A664驱动中间件初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "A664驱动中间件初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_a664_driver_middleware_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_driver_middleware_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_driver_middleware_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index 57bc7e7..faeacbf 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -22,4 +22,11 @@ extern void free_vxworks_runtime_header(void *p);
 extern void free_vxworks_runtime_name(void *p);
 extern void free_vxworks_runtime_description(void *p);

+extern void set_a664_driver_middleware_runtime_header(void *p);
+extern void set_a664_driver_middleware_runtime_name(void *p);
+extern void set_a664_driver_middleware_runtime_description(void *p, int flag);
+extern void free_a664_driver_middleware_runtime_header(void *p);
+extern void free_a664_driver_middleware_runtime_name(void *p);
+extern void free_a664_driver_middleware_runtime_description(void *p);
+
 #endif
diff --git a/simics-workspace/modules/afdxES/pci-register.dml b/simics-workspace/modules/afdxES/pci-register.dml
index d594d90..e8e2cf7 100644
--- a/simics-workspace/modules/afdxES/pci-register.dml
+++ b/simics-workspace/modules/afdxES/pci-register.dml
@@ -556,6 +556,7 @@ bank pciport{
                 break;
             }
             call $init_vxworks_ok();
+            call $init_a664_driver_middleware_ok();
         }
     }
diff --git a/simics-workspace/include/afdx-exchange.dml b/simics-workspace/include/afdx-exchange.dml
index ae09cc3..ea3dc32 100644
--- a/simics-workspace/include/afdx-exchange.dml
+++ b/simics-workspace/include/afdx-exchange.dml
@@ -9,4 +9,5 @@ typedef struct {

 typedef struct {
     void (*transmit_runtime_info)(conf_object_t *obj, Runtime_Info *runtime_info);
+    void (*transmit_mib_info)(conf_object_t *obj, MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info);
 } transmit_runtime_info_between_afdxES_and_afdxES2_interface_t;
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index f802318..6fdd5fb 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -51,6 +51,9 @@ extern void free_vxworks_runtime_header(void *p);
 extern void free_vxworks_runtime_name(void *p);
 extern void free_vxworks_runtime_description(void *p);

+extern void set_afdxES2_mib_runtime_header(void *p);
+extern void free_afdxES2_mib_runtime_header(void *p);
+
 extern void set_a664_driver_middleware_runtime_header(void *p);
 extern void set_a664_driver_middleware_runtime_name(void *p);
 extern void set_a664_driver_middleware_runtime_description(void *p, int flag);
@@ -130,6 +133,10 @@ implement transmit_runtime_info_between_afdxES_and_afdxES2 {
     method transmit_runtime_info(Runtime_Info *runtime_info) {
         call $Transmit_runtime_info(runtime_info);
     }
+
+    method transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
+        call $Transmit_mib_info(mac_mib_info, rx_mib_info, tx_mib_info);
+    }
 }

 method Transmit_runtime_info(Runtime_Info *runtime_info) {
@@ -179,6 +186,63 @@ method Transmit_runtime_info(Runtime_Info *runtime_info) {
     delete buf;
 }

+method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
+    local Runtime_Info runtime_info;
+    local int buf_len;
+    local char *buf;
+    local int header_length;
+    local int len;
+
+    set_afdxES2_mib_runtime_header(&runtime_info.header);
+    header_length = Htonl(runtime_info.header_length);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + sizeof(*tx_mib_info);
+    len = Htonl(runtime_info.len);
+    runtime_info.type = 1;
+
+    buf_len = runtime_info.header_length + Strlen(runtime_info.header) + sizeof(runtime_info.len) + runtime_info.len;
+
+    buf = new char [buf_len];
+
+    memcpy(buf,
+           &header_length,
+           sizeof(runtime_info.header_length));
+    memcpy(buf + sizeof(runtime_info.header_length),
+           runtime_info.header,
+           runtime_info.header_length);
+    memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length,
+           &len,
+           sizeof(runtime_info.len));
+
+    local uint8 i;
+    local uint32 tmp;
+    for (i = 0; i < sizeof(*mac_mib_info); ++i) {
+        tmp = Htonl(*(cast(mac_mib_info, uint32*) +i));
+        log "info" : "tmp = %d", tmp;
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + i,
+               &tmp,
+               sizeoftype(uint32));
+    }
+
+    for (i = 0; i < sizeof(*rx_mib_info); ++i) {
+        tmp = Htonl(*(cast(rx_mib_info, uint32*) +i));
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(*mac_mib_info) + i,
+               &tmp,
+               sizeoftype(uint32));
+    }
+
+    for (i = 0; i < sizeof(*rx_mib_info); ++i) {
+        tmp = Htonl(*(cast(tx_mib_info, uint32*) +i));
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + i,
+               &tmp,
+               sizeoftype(uint32));
+    }
+
+
+    qt_socket_send(buf, buf_len);
+
+    delete buf;
+}
+
 method init_main_board_module_ok() {
     local Runtime_Info runtime_info;

diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index da98afc..58d3695 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -180,3 +180,16 @@ void free_a664_driver_middleware_runtime_description(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
+
+void set_afdxES2_mib_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void free_afdxES2_mib_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index faeacbf..a4fd95d 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -29,4 +29,11 @@ extern void free_a664_driver_middleware_runtime_header(void *p);
 extern void free_a664_driver_middleware_runtime_name(void *p);
 extern void free_a664_driver_middleware_runtime_description(void *p);

+extern void set_afdxES2_mib_runtime_header(void *p);
+extern void set_afdxES2_mib_runtime_name(void *p);
+extern void set_afdxES2_mib_runtime_description(void *p, int flag);
+extern void free_afdxES2_mib_runtime_header(void *p);
+extern void free_afdxES2_mib_runtime_name(void *p);
+extern void free_afdxES2_mib_runtime_description(void *p);
+
 #endif
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index 9b3828c..36873b7 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -212,6 +212,7 @@ attribute record_mib_cycle {

 method record_mib() {
     write_mid(&($maca_mib),&($macb_mib) ,&($rx_mib), &($tx_mib));
+
     after ($record_mib_cycle)
         call $record_mib();
 }
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index 36873b7..9ea184b 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -224,6 +224,6 @@ method post_init() {
     call $init_vl_cfg();
     call $record_mib();

-    $record_mib_cycle = 0.1;
+    $record_mib_cycle = 0.5;
 }
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index 6fdd5fb..e3403d8 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -128,7 +128,6 @@ implement ieee_802_3_mac {
 	}
 }

-
 implement transmit_runtime_info_between_afdxES_and_afdxES2 {
     method transmit_runtime_info(Runtime_Info *runtime_info) {
         call $Transmit_runtime_info(runtime_info);
@@ -192,12 +191,15 @@ method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_
     local char *buf;
     local int header_length;
     local int len;
+    local int type;

-    set_afdxES2_mib_runtime_header(&runtime_info.header);
+    set_afdxES2_mib_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
     header_length = Htonl(runtime_info.header_length);
     runtime_info.len = sizeof(runtime_info.type) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + sizeof(*tx_mib_info);
     len = Htonl(runtime_info.len);
     runtime_info.type = 1;
+    type = Htonl(runtime_info.type);

     buf_len = runtime_info.header_length + Strlen(runtime_info.header) + sizeof(runtime_info.len) + runtime_info.len;

@@ -212,31 +214,32 @@ method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_
     memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length,
            &len,
            sizeof(runtime_info.len));
-
+    memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len),
+           &type,
+           sizeof(runtime_info.type));
+
     local uint8 i;
     local uint32 tmp;
-    for (i = 0; i < sizeof(*mac_mib_info); ++i) {
+    for (i = 0; i < sizeof(*mac_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(mac_mib_info, uint32*) +i));
-        log "info" : "tmp = %d", tmp;
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + i,
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + i,
                &tmp,
                sizeoftype(uint32));
     }

-    for (i = 0; i < sizeof(*rx_mib_info); ++i) {
+    for (i = 0; i < sizeof(*rx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(rx_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(*mac_mib_info) + i,
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*mac_mib_info) + i,
                &tmp,
                sizeoftype(uint32));
     }

-    for (i = 0; i < sizeof(*rx_mib_info); ++i) {
+    for (i = 0; i < sizeof(*tx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(tx_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + i,
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + i,
                &tmp,
                sizeoftype(uint32));
     }
-

     qt_socket_send(buf, buf_len);

diff --git a/simics-workspace/modules/afdxES/communicate-with-qt.c b/simics-workspace/modules/afdxES/communicate-with-qt.c
index 03d9452..8fc6c5d 100644
--- a/simics-workspace/modules/afdxES/communicate-with-qt.c
+++ b/simics-workspace/modules/afdxES/communicate-with-qt.c
@@ -7,12 +7,6 @@

 SOCKET client_socket;

-/*
-extern int qt_socket_init(void);
-extern int qt_socket_recv(unsigned char *recvbuf, int size);
-extern int qt_socket_send(unsigned char *sendbuf, int size);
-*/
-
 int qt_socket_init(void) {
     WSADATA wsa;

@@ -50,12 +44,7 @@ int qt_socket_send(unsigned char *sendbuf, int size) {
         fprintf(stdout, "Socket send sucessfully, send %d bytes.\n", len);
         return len;
     } else {
-        fprintf(stderr, "Socket send failed, size = %d, sended len = %d!\n", size, len);
+        fprintf(stderr, "Socket send failed, error code is %d\n", WSAGetLastError());
         return 0;
     }
 }
-
-
-void qt_socket_transmit_module_runtime_info(int msg_type) {
-
-}
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index 9ea184b..e70fc0b 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -215,6 +215,8 @@ method record_mib() {

     after ($record_mib_cycle)
         call $record_mib();
+
+    $afdxES.transmit_runtime_info_between_afdxES_and_afdxES2.transmit_mib_info(&$maca_mib, &$rx_mib, &$tx_mib);
 }

 method post_init() {
@@ -226,4 +228,3 @@ method post_init() {

     $record_mib_cycle = 0.5;
 }
-
diff --git a/simics-workspace/include/afdx-exchange.dml b/simics-workspace/include/afdx-exchange.dml
index ea3dc32..bdbe6b9 100644
--- a/simics-workspace/include/afdx-exchange.dml
+++ b/simics-workspace/include/afdx-exchange.dml
@@ -9,5 +9,5 @@ typedef struct {

 typedef struct {
     void (*transmit_runtime_info)(conf_object_t *obj, Runtime_Info *runtime_info);
-    void (*transmit_mib_info)(conf_object_t *obj, MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info);
+    void (*transmit_mib_info)(conf_object_t *obj, MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info);
 } transmit_runtime_info_between_afdxES_and_afdxES2_interface_t;
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index e3403d8..d251525 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -133,8 +133,8 @@ implement transmit_runtime_info_between_afdxES_and_afdxES2 {
         call $Transmit_runtime_info(runtime_info);
     }

-    method transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
-        call $Transmit_mib_info(mac_mib_info, rx_mib_info, tx_mib_info);
+    method transmit_mib_info(MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
+        call $Transmit_mib_info(maca_mib_info, macb_mib_info, rx_mib_info, tx_mib_info);
     }
 }

@@ -185,7 +185,7 @@ method Transmit_runtime_info(Runtime_Info *runtime_info) {
     delete buf;
 }

-method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
+method Transmit_mib_info(MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_mib_info) {
     local Runtime_Info runtime_info;
     local int buf_len;
     local char *buf;
@@ -196,7 +196,7 @@ method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_
     set_afdxES2_mib_runtime_header(&runtime_info.header);
     runtime_info.header_length = Strlen(runtime_info.header);
     header_length = Htonl(runtime_info.header_length);
-    runtime_info.len = sizeof(runtime_info.type) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + sizeof(*tx_mib_info);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + sizeof(*rx_mib_info) + sizeof(*tx_mib_info);
     len = Htonl(runtime_info.len);
     runtime_info.type = 1;
     type = Htonl(runtime_info.type);
@@ -220,23 +220,34 @@ method Transmit_mib_info(MAC_MIB *mac_mib_info, RX_MIB *rx_mib_info, TX_MIB *tx_

     local uint8 i;
     local uint32 tmp;
-    for (i = 0; i < sizeof(*mac_mib_info) / sizeoftype(uint32); ++i) {
-        tmp = Htonl(*(cast(mac_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + i,
+    for (i = 0; i < sizeof(*maca_mib_info) / sizeoftype(uint32); ++i) {
+        tmp = Htonl(*(cast(maca_mib_info, uint32*) +i));
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + i,
                &tmp,
                sizeoftype(uint32));
     }

+    for (i = 0; i < sizeof(*macb_mib_info) / sizeoftype(uint32); ++i) {
+        tmp = Htonl(*(cast(macb_mib_info, uint32*) +i));
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + i,
+               &tmp,
+               sizeoftype(uint32));
+    }
+
     for (i = 0; i < sizeof(*rx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(rx_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*mac_mib_info) + i,
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + i,
                &tmp,
                sizeoftype(uint32));
     }

     for (i = 0; i < sizeof(*tx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(tx_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length + sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*mac_mib_info) + sizeof(*rx_mib_info) + i,
+        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + sizeof(*rx_mib_info) + i,
                &tmp,
                sizeoftype(uint32));
     }
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index e70fc0b..e8cb5c5 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -216,7 +216,7 @@ method record_mib() {
     after ($record_mib_cycle)
         call $record_mib();

-    $afdxES.transmit_runtime_info_between_afdxES_and_afdxES2.transmit_mib_info(&$maca_mib, &$rx_mib, &$tx_mib);
+    $afdxES.transmit_runtime_info_between_afdxES_and_afdxES2.transmit_mib_info(&$maca_mib, &$macb_mib, &$rx_mib, &$tx_mib);
 }

 method post_init() {
diff --git a/simics-workspace/modules/RDC/RDC.dml b/simics-workspace/modules/RDC/RDC.dml
index f7bb643..4a388e9 100644
--- a/simics-workspace/modules/RDC/RDC.dml
+++ b/simics-workspace/modules/RDC/RDC.dml
@@ -1,4 +1,3 @@
-// rtc_module.dml - Skeleton code to base new DML device modules on

 dml 1.2;

@@ -214,7 +213,19 @@ typedef struct
 }BLOCK_TIME_STRUCT_t;

-
+/* 2014-09-17 added, begin */
+/*  */
+extern typedef  struct
+{
+	uint8 mode;
+	uint8 timeOut;
+	float MIBCycle;
+	uint8 filePath[200];
+}QT_RDC_CONF_VALUE_t;
+
+
+data QT_RDC_CONF_VALUE_t *pQtRdcConfValue;
+/* 2014-09-17 added, end */
 extern int getAfdxFrameBlockNum();
 extern int hwa_load_conf_file();
 extern A429_TO_UDP_ARRAY* GetnA429ToAudp();
@@ -225,6 +236,10 @@ extern AUDPTOA429_STRUCT_t* GetnUdpTo429();

 extern HWACFG_STRUCT_t *GetHwaCfg();

+/* 2014-09-17 added, begin */
+/* extern  QT_RDC_CONF_VALUE_t *getConfInfo(); */
+extern  QT_RDC_CONF_VALUE_t *parseConfInfo(void);
+/* 2014-09-17 added, end */
 /*
 extern int socket_init(void);
 extern int socket_recv(char *recvbuf, int size);
@@ -268,17 +283,17 @@ extern  int getRecvUdpCnt();

 implement Send_To_RDC {
 	method send_to_RDC(void *data, int dest_udp, int length) {
-		log "info" : "called by ARINC664 2";
-		log "info" : "The dest_udp is %d", dest_udp;
+		//log "info" : "called by ARINC664 2";
+		//log "info" : "The dest_udp is %d", dest_udp;
         // for test begin
-       // $ARINC664_2.Send_To_A664.send_to_A664(0, data, length);/*ÓÃÓÚ×Ô»·²âÊÔ*/
-
+       // $ARINC664_2.Send_To_A664.send_to_A664(0, data, length);/*????¡Á??¡¤????*/
+        /*
 		local uint32 i;
 		for(i=0;i<length;i++)
 			log "info":"data[%d] = %d",i,*cast(&data[i],uint8*);
          for (i=0;i<length/4;i++)
             log "info":"data[%d] = %x",i,*cast(&data[4*i],uint32*);
-
+        */
         call $AfdxTo429(dest_udp, cast(data, uint32*), length);

         // for test end
@@ -357,18 +372,20 @@ event AfdxTimer{/*Ë³Ðò×é°ü ¶¨Ê±³¬Ê±*/

 			pAfdxFrameBlock = getpAfdxFrameBlock();
 			pAfdxFrameBlock[*nBlockIndex].nFrameNum = 0;
+			$begin[$nA429ToAfdxCfgIndex]  = 0;
 			/*
 			if(pAfdxFrameBlock[*nBlockIndex].nFrameNum>0)
 			{
 				call $nSendToAfdx(*nBlockIndex,pAfdxFrameBlock[*nBlockIndex].pAfdxFrameBlock,pAfdxFrameBlock[*nBlockIndex].nFrameNum);
 			}
 			*/
-		    log "info": "Time Out: portId is %d\n.",*nBlockIndex;
+		    log "info": "Time Out: portId is %d",*nBlockIndex;
 			local double current_time = SIM_time($dev.obj);
-			log "info" : "Current time = %f", current_time;
+			//log "info" : "Current time = %f", current_time;
 			}
 }

+data int time_num;
 event AfdxRtcTimer{/*¶¨Ê±×é°ü*/
 		parameter timebase = "seconds";
 		method event(void* data) {
@@ -379,12 +396,21 @@ event AfdxRtcTimer{/*¶¨Ê±×é°ü*/
 			AfdxFrameBlockNum = getAfdxFrameBlockNum();
 			for(i=0;i<AfdxFrameBlockNum;i++)
 			{
-				if(pAfdxFrameBlock[i].nFrameNum>0)/*´«µÝblock¸öÊý*/
+				if(pAfdxFrameBlock[i].nFrameNum>0)/*????block????*/
 				{
+					local int j;
+					for (j=0; j < pAfdxFrameBlock[i].nFrameNum; j++)
+					{
+						log "info" : "recv data[%d] = %x", j, *(cast(pAfdxFrameBlock[i].pAfdxFrameBlock,int *)+j);
+						local double current_time = SIM_time($dev.obj);
+						log "info" : "Afdx Current time = %f\n", current_time;
+					}
 					call $nSendToAfdx(i,pAfdxFrameBlock[i].pAfdxFrameBlock,pAfdxFrameBlock[i].nFrameNum);
+
+					pAfdxFrameBlock[i].nFrameNum=0;
 				}
 			}
-			inline $this.post(40000,NULL);
+			inline $this.post($pQtRdcConfValue->timeOut/1000.0,NULL);
 		}
 }

@@ -417,9 +443,9 @@ struct channel_data {

 method send429(uint8 channel,uint32 data)
 {
-
-	log "info" : "The channel is %d", channel;
 /*
+	log "info" : "The channel is %d", channel;
+
     local channel_data x;
     x.nr = channel;
     x.data = data;
@@ -435,9 +461,12 @@ method A429To429(uint8 channel,uint32 data)
 	local uint8 i = 0;
 	local A429_TO_A429_ARRAY * nA429ToA429arry;
 	nLabel = data&0xff;
+
 	nA429ToA429arry = GetnA429ToA429();
+	/*  mwg add
 	log "info" : "A429TO429 :%x!\n",nA429ToA429arry->nA429ToA429[channel][nLabel];
 	log "info" : "data is :%x!\n",data;
+	*/
 	for (i=0;i<16;i++)
 	{
 		if (((nA429ToA429arry->nA429ToA429[channel][nLabel])&(1<<i)) == 1)
@@ -453,29 +482,35 @@ method A429To429(uint8 channel,uint32 data)
 //send to afdx card
 method nSendToAfdx(uint8 portid,uint32 * data,uint8 datalen)
 {
-    log "info": "sendAfdx:portid:%d,data:%x,datalen:%d",portid,*data,datalen;
+  // log "info": "sendAfdx:portid:%d,data:%x,datalen:%d",portid,*data,datalen;
     $ARINC664_2.Send_To_A664.send_to_A664(portid,cast(data,void *),datalen);
 }

 //429toafdx/429 receive from 429

+data int middle_num;
+data int last_num;
+data int head_num;
+
+data int begin[100];
+data int nA429ToAfdxCfgIndex;
 method A429ToAfdx(uint8 channel,uint32 data)
 {
-    log "info": "Received:Channel:%d,data:0x%x",channel,data;
+ //   log "info": "Received:Channel:%d,data:0x%x",channel,data;

 	local int i = 0;
 	local nFrameR * pFrameR;
 	local uint8 nLabel;
 	local uint32 nData;
-	local int nA429ToAfdxCfgIndex = 0;
+
 	local uint32 nFramebit = 0;
 	local uint8 nArryIndex;
 	local uint8 nBitIndex;
 	nLabel = data&0xff;
 	nData = (data&0x1FFFFC00)>>10;
 	local BLOCK_TIME_STRUCT_t * pBlockTime;
-	local uint8 nAfdxFlag;/*×é°ü·½Ê½*/
+	local uint8 nAfdxFlag = $pQtRdcConfValue->mode;/*×é°ü·½Ê½ 0£ºË³Ðò×é°ü£» 1£º¶¨Ê±×é°ü*/

 	local A429_TO_UDP_ARRAY * A429ToUdpArry;
 	local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
@@ -496,18 +531,19 @@ method A429ToAfdx(uint8 channel,uint32 data)
 			{
 				pFrameR= pFrameR->pNext;
 			}
-			log "info": "portID:%d;\n",pFrameR->nPortId;
+		//	log "info": "portID:%d;\n",pFrameR->nPortId;
 		}
 	}
 	/*print config end*/
-	log "info": "usd:%d,label:0x%x\n",A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed,nLabel;
+	//log "info": "usd:%d,label:0x%x\n",A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed,nLabel;

-	if(A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed ==0)/*Èç¹ûÃ»ÓÃÔò×ª·¢µ½429*/
+	if(A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed ==0)/*?????????¨°¡Á?¡¤???429*/
 	{
 			call $A429To429(channel,data);
-	}else{																	/*×ª·¢AFDX*/
+	}else{																	/*¡Á?¡¤?AFDX*/
 		if(nAfdxFlag == 1)/*¶¨Ê±×é°ü*/
 		{
+		//	log "info" : "first = %d ", ++$time_num_1;
 			pFrameR = A429ToUdpArry->nA429ToUdp[channel][data&0xff].pFrameR;
 			for (i=0;i<A429ToUdpArry->nA429ToUdp[channel][data&0xff].nUsed;i++)
 			{
@@ -518,16 +554,17 @@ method A429ToAfdx(uint8 channel,uint32 data)

                 if(pFrameR->pA429ToUdp->nUseType == 0)
                 {
-                    nA429ToAfdxCfgIndex = pFrameR->nPortId;
-                   // nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum;
-                    pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum]=data;
-                    pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
+                    $nA429ToAfdxCfgIndex = pFrameR->nPortId;
+                   // nFramebit=pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum;
+                    pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum]=data;
+                    pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum++;
+			//		log "info" : "second = %d ", ++$time_num_2;

                 }
-
-
+
 			}
-		}else{/*Ë³Ðò×é°ü*/
+		}else
+		{/*Ë³Ðò×é°ü*/
 			pFrameR = A429ToUdpArry->nA429ToUdp[channel][data&0xff].pFrameR;
 			for (i=0;i<A429ToUdpArry->nA429ToUdp[channel][data&0xff].nUsed;i++)
 			{
@@ -535,189 +572,69 @@ method A429ToAfdx(uint8 channel,uint32 data)
 				{
 					pFrameR= pFrameR->pNext;
 				}
-				if (pFrameR->pA429ToUdp->nUseType == 0)/*Õý³£Ä£Ê½Ôò¼ì²éÊÇ·ñÍ·°üÎ²°ü*/
+				if (pFrameR->pA429ToUdp->nUseType == 0)/*?????????¨°?¨¬?¨¦??¡¤??¡¤¡ã¨¹??¡ã¨¹*/
 				{
-					nA429ToAfdxCfgIndex = pFrameR->nPortId;
-					pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]=nA429ToAfdxCfgIndex;
+					$nA429ToAfdxCfgIndex = pFrameR->nPortId;
+					pBlockTime->pAfdxBlockTime[$nA429ToAfdxCfgIndex]=$nA429ToAfdxCfgIndex;
+
 					if (pFrameR->pAlabel->nHeadLabel == nLabel)     /*Í·°ü*/
 					{
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
+					//	log "info" : "head_num = %d",++$head_num;
+						$begin[$nA429ToAfdxCfgIndex]  = 1;
+						pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum = 0;

-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum]=data;
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
+						pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum]=data;
+						pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum++;
 						if(pFrameR->pAlabel->nTailLabel == nLabel)
 							{
 								log "info": "usd:for tail head and label!";
-								log "info": "frame:0x%x,index:%d,frameNum:%d\n",pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[0],nA429ToAfdxCfgIndex,pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum;
-								call $nSendToAfdx(nA429ToAfdxCfgIndex,pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum);
+							//	log "info": "frame:0x%x,index:%d,frameNum:%d\n",pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock[0],$nA429ToAfdxCfgIndex,pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum;
+								call $nSendToAfdx($nA429ToAfdxCfgIndex,pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum);

 								continue ;
 							}else{
+								//inline $AfdxTimer.post(4000,&(pBlockTime->pAfdxBlockTime[$nA429ToAfdxCfgIndex]));   //ÐèÒªË¼¿¼Ò»ÏÂÊÇ·ñ¿ÉÒÔ±»ÏÂÃæµÄÒ»ÐÐËùÌæ´ú

-								inline $AfdxTimer.post(40,&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
+								  inline $AfdxTimer.post($pQtRdcConfValue->timeOut/100.0,&(pBlockTime->pAfdxBlockTime[$nA429ToAfdxCfgIndex]));
 								  local double current_time = SIM_time($dev.obj);
-								  log "info" : "Current time = %f", current_time;
-								  log "info": "Time Start!!!: portId is %d\n.",nA429ToAfdxCfgIndex;
+								//  log "info" : "Current time = %f", current_time;
+								//  log "info": "Time Start!!!: portId is %d\n.",$nA429ToAfdxCfgIndex;

 							}
-					}else if (pFrameR->pAlabel->nTailLabel == nLabel)/*Î²°ü*/
+					}else if (pFrameR->pAlabel->nTailLabel == nLabel )/*Î²°ü*/
 					{
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum]=data;
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
-						call $nSendToAfdx(nA429ToAfdxCfgIndex,pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum);
-						inline $AfdxTimer.remove(&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
-					}else{
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum]=data;
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
-						if (pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum > 100)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
-							inline $AfdxTimer.remove(&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
+						if($begin[$nA429ToAfdxCfgIndex]  == 1) {
+						//	log "info" : "tail_num =%d",++$last_num;
+							pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum]=data;
+							pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum++;
+							call $nSendToAfdx($nA429ToAfdxCfgIndex,pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum);
+							inline $AfdxTimer.remove(&(pBlockTime->pAfdxBlockTime[$nA429ToAfdxCfgIndex]));
+							pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum = 0;
+							$begin[$nA429ToAfdxCfgIndex]  = 0;
+						} else {
+							//do nothing;
 						}
 					}
-				}/*usetype*/
-			}/*for*/
-		}/*end of Ë³Ðò×é°ü*/
-	}
-
-
-if(0)
-{
-    log "info": "Received:Channel:%d,data:%d",channel,data;
-    return;
-	local int i = 0;
-	local nFrameR * pFrameR;
-	local char nLabel;
-	local uint32 nData;
-	local int nA429ToAfdxCfgIndex = 0;
-	local uint32 nFramebit = 0;
-	local uint8 nArryIndex;
-	local uint8 nBitIndex;
-	nLabel = data&0xff;
-	nData = (data&0x1FFFFC00)>>10;
-	local BLOCK_TIME_STRUCT_t * pBlockTime;
-	local uint8 nAfdxFlag=0;/*×é°ü·½Ê½*/
-
-	local A429_TO_UDP_ARRAY * A429ToUdpArry;
-	local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-
-	pBlockTime = cast($regs.afdx_block_adr,BLOCK_TIME_STRUCT_t *);
-
-
-	A429ToUdpArry = GetnA429ToAudp();
-	pAfdxFrameBlock=getpAfdxFrameBlock();
-
-	//log "info": "usd:%d",A429ToUdpArry->nA429ToUdp[0][0].nUsed;
-
-	if(A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed ==0)/*Èç¹ûÃ»ÓÃÔò×ª·¢µ½429*/
-	{
-			call $A429To429(channel,data);
-	}else{																	/*×ª·¢AFDX*/
-		if(nAfdxFlag == 1)/*¶¨Ê±×é°ü*/
-		{
-			pFrameR = A429ToUdpArry->nA429ToUdp[channel][data&0xff].pFrameR;
-			for (i=0;i<A429ToUdpArry->nA429ToUdp[channel][data&0xff].nUsed;i++)
-			{
-				if(i>0)
-				{
-					pFrameR= pFrameR->pNext;
-				}
-					if(pFrameR->pA429ToUdp->nUseType == 0)
+					else
 					{
-						nA429ToAfdxCfgIndex = pFrameR->pA429ToUdp->nPortId;
-						nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum*19;
-						nArryIndex = nFramebit/32;
-						nBitIndex = nFramebit%32;
-						if (32-nBitIndex > 19)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData<<(32-nBitIndex));
-						}else
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData>>(19-(32-nBitIndex)));
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex+1] |= (nData<<(32-nBitIndex));
-						}
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
-
-					}
-
-
-			}
-		}else{/*Ë³Ðò×é°ü*/
-			pFrameR = A429ToUdpArry->nA429ToUdp[channel][data&0xff].pFrameR;
-			for (i=0;i<A429ToUdpArry->nA429ToUdp[channel][data&0xff].nUsed;i++)
-			{
-				if(i>0)
-				{
-					pFrameR= pFrameR->pNext;
-				}
-				if (pFrameR->pA429ToUdp->nUseType == 0)/*Õý³£Ä£Ê½Ôò¼ì²éÊÇ·ñÍ·°üÎ²°ü*/
-				{
-					nA429ToAfdxCfgIndex = pFrameR->pA429ToUdp->nPortId;
-					if (pFrameR->pAlabel->nHeadLabel == nLabel)     /*Í·°ü*/
-					{
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
-
-						nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum*19;
-						nArryIndex = nFramebit/32;
-						nBitIndex = nFramebit%32;
-						if (32-nBitIndex > 19)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData<<(32-nBitIndex));
-						}else
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData>>(19-(32-nBitIndex)));
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex+1] |= (nData<<(32-nBitIndex));
-						}
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
-						if(pFrameR->pAlabel->nTailLabel == nLabel)
-							{
-								call $nSendToAfdx(nA429ToAfdxCfgIndex,pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum);
-								continue ;
-							}else{
-								inline $AfdxTimer.post(40,&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
+						if($begin[$nA429ToAfdxCfgIndex]  == 1) {
+						//	log "info" : "middle_num =%d",++$middle_num;
+							pAfdxFrameBlock[$nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum]=data;
+							pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum++;
+							if (pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum >= 100) {
+								pAfdxFrameBlock[$nA429ToAfdxCfgIndex].nFrameNum = 0;
+								$begin[$nA429ToAfdxCfgIndex]  = 0;
+							//	log "info" : "beyond 100";
+								inline $AfdxTimer.remove(&(pBlockTime->pAfdxBlockTime[$nA429ToAfdxCfgIndex]));
 							}
-					}else if (pFrameR->pAlabel->nTailLabel == nLabel)/*Î²°ü*/
-					{
-						nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum*19;
-						nArryIndex = nFramebit/32;
-						nBitIndex = nFramebit%32;
-						if (32-nBitIndex > 19)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData<<(32-nBitIndex));
-						}else
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData>>(19-(32-nBitIndex)));
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex+1] |= (nData<<(32-nBitIndex));
-						}
-						call $nSendToAfdx(nA429ToAfdxCfgIndex,pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock,pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum);
-						inline $AfdxTimer.remove(&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
-					}else{
-
-						nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum*19;
-						nArryIndex = nFramebit/32;
-						nBitIndex = nFramebit%32;
-						if (32-nBitIndex > 19)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData<<(32-nBitIndex));
-						}else
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex] |= (nData>>(19-(32-nBitIndex)));
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[nArryIndex+1] |= (nData<<(32-nBitIndex));
-						}
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum++;
-						if (pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum > 100)
-						{
-							pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
+						}else {
+							//do nothing
 						}
 					}
 				}/*usetype*/
 			}/*for*/
-		}/*end of Ë³Ðò×é°ü*/
+		}/*end of ???¨°¡Á¨¦¡ã¨¹*/
 	}
-
-}
 }

@@ -726,7 +643,7 @@ if(0)
 //receive from afdx card
 method AfdxTo429(uint16 dest_udp,uint32 *payload,uint32 length)
 {
-log "info" : "Entering nUdpTo429()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+//log "info" : "Entering nUdpTo429()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
 local uint8 i;
 local uint8 j;
 local uint32 Channel;
@@ -738,23 +655,23 @@ usertype_count = 0;
 wrongchannel_count = 0;
 wrongsize_count = 0;
 local AUDPTOA429_STRUCT_t * nUdpTo429Arry;
-log "info" : "Before call nUdpTo429()";
+//log "info" : "Before call nUdpTo429()";
 nUdpTo429Arry = GetnUdpTo429();

-log "info" : "usetype is %d, channel is %d, length is %d",nUdpTo429Arry[dest_udp].nUseType,nUdpTo429Arry[dest_udp].nA429SendChannel1,length;
+//log "info" : "usetype is %d, channel is %d, length is %d",nUdpTo429Arry[dest_udp].nUseType,nUdpTo429Arry[dest_udp].nA429SendChannel1,length;
     if (nUdpTo429Arry[dest_udp].nUseType ==0 && nUdpTo429Arry[dest_udp].nA429SendChannel1 !=0 && length%4 == 0)     //UseType Normal & Channels OK & frame size OK
-	{log "info": "after if!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+	{//log "info": "after if!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";

         for (i=1; i<=(length/4); i++) {
 		Channel = nUdpTo429Arry[dest_udp].nA429SendChannel1;
-            for (j=1;j<=16;j++) {
-			log "info": "channel is %d,j is:%d\n", Channel,j;
+           for (j=1;j<=16;j++) {
+		//	log "info": "channel is %d,j is:%d\n", Channel,j;
                 if ((Channel & 0x1) == 1)
                 {
-                    log "info": "Before call send429 ##########################";
+                 //   log "info": "Before call send429 ##########################";
                     STORE_BE32(&payload_temp,*payload);
                     call $send429(j, payload_temp);
-					log "info":"after call send429";
+				//	log "info":"after call send429";
                 }
                 Channel = Channel>>0x1;
             }
@@ -771,7 +688,7 @@ log "info" : "usetype is %d, channel is %d, length is %d",nUdpTo429Arry[dest_udp

 constant PORT_DATA_SIZE = 8;     // too big , sizeoftype(uint8) + sizeoftype(uint32) is OK?

-
+data int recv_num;
 method socket_loop_recv() {
 	local RX_DATA rx[16];

@@ -780,12 +697,13 @@ method socket_loop_recv() {
 	local uint8 i = 0;
 	for (; i < 16; ++i) {
 		if (rx[i].is_vaild == 1) {
-			log "info" : "Recv from channel: %d, data %x", i + 1, rx[i].rx_data;
+			$recv_num++;
+			//log "info" : "Rchannel: %d, data %x ,recv num is %d", i + 1, rx[i].rx_data, $recv_num;
 			call $A429ToAfdx(i + 1, rx[i].rx_data);
 		}
 	}

-	after (0.001) call $socket_loop_recv();
+	after (0.0001) call $socket_loop_recv();
 }

 method load_afdx_config()
@@ -830,22 +748,22 @@ method load_afdx_config()

 	userid = cast(pHwaCfg->position,uint32) + cast(((pHwaCfg->side) << 5),uint32) + cast(((pHwaCfg->domain) << 8),uint32);
 	//partid =
-	/*½ÓÊÕvlµÄÅäÖÃ*/
-	for(i=0;i<pHwaCfg->revvl_num;i++)/*½ÓÊÕVL×î¶à256¸ö*/
+	/*????vl??????*/
+	for(i=0;i<pHwaCfg->revvl_num;i++)/*????VL¡Á??¨¤256??*/
 	{

 	  recv_rm_cfg_cam.address =i;
 	  recv_rm_cfg_cam.VL_ID= pHwaCfg->recvVlSet[i].vlNum;

-	  recv_rm_cfg_ram.ram_data.VL_ENABLE = 1;/*Ä¬ÈÏ¶¼Ê¹ÄÜ*/
+	  recv_rm_cfg_ram.ram_data.VL_ENABLE = 1;/*??????????*/
 	  recv_rm_cfg_ram.ram_data.SKEW_MAX = pHwaCfg->recvVlSet[i].skewMax;
-	  recv_rm_cfg_ram.ram_data.RM_ENABLE = pHwaCfg->recvVlSet[i].redundantAble;/*ÈßÓàÊ¹ÄÜ*/
+	  recv_rm_cfg_ram.ram_data.RM_ENABLE = pHwaCfg->recvVlSet[i].redundantAble;/*???¨¤????*/

 	  if(pHwaCfg->recvVlSet[i].redundantAble!=0)
 	  {
 		recv_rm_cfg_ram.ram_data.NETWORK_B_ENABLE=1;
 		recv_rm_cfg_ram.ram_data.NETWORK_A_ENABLE=1;
-		recv_rm_cfg_ram.ram_data.NETWORK_B_IC_ENABLE=pHwaCfg->recvVlSet[i].integrityAble;/*ÍêÕûÐÔ¼ì²é*/
+		recv_rm_cfg_ram.ram_data.NETWORK_B_IC_ENABLE=pHwaCfg->recvVlSet[i].integrityAble;/*?¨º?????¨¬?¨¦*/
 		recv_rm_cfg_ram.ram_data.NETWORK_A_IC_ENABLE=pHwaCfg->recvVlSet[i].integrityAble;
 	  }else{
 		recv_rm_cfg_ram.ram_data.NETWORK_B_ENABLE=0;
@@ -875,7 +793,7 @@ method load_afdx_config()
 	}else{
 		  log "info" : "The nDataSrcPatition no data!!!!!error !!!!!!";
 	}
-	/*½ÓÊÕportµÄÅäÖÃ   ½ÓÊÕ¶Ë¿Ú×î´óÎª4096*/
+	/*????port??????   ????????¡Á??¨®??4096*/
 	for(i=0;i<RecvCfgUdpCnt;i++)
 	{
 		//partid = 1;/*lanxingdong detip err*/
@@ -912,7 +830,7 @@ method load_afdx_config()
 	}

-	/*·¢ËÍVLµÄÅäÖÃ   ·¢ËÍVL×î´óÎª128*/
+	/*¡¤???VL??????   ¡¤???VL¡Á??¨®??128*/
 	for(i=0;i<pHwaCfg->sendvl_num;i++)
 	{

@@ -929,7 +847,7 @@ method load_afdx_config()
 	  log "info" : "The sendvl_num is %d", i;
 	  log "info": "------------------------------------------------------------------------\n\n";
 	}
-	/*·¢ËÍ¶Ë¿ÚµÄÅäÖÃ   ·¢ËÍ¶Ë¿Ú×î´óÎª1024*/
+	/*¡¤?????????????   ¡¤???????¡Á??¨®??1024*/
     //log "info" : "SendCfgUdpCnt is %d", SendCfgUdpCnt;

 	for(i=0;i<SendCfgUdpCnt;i++)
@@ -957,9 +875,9 @@ method load_afdx_config()
 	  send_cfg_table.ram_data_part1.MIN_FRAME_LENGTH =pHwaCfg->sendVlSet[VlIndex>>2].minLen;
 	  send_cfg_table.ram_data_part1.PORT_TYPE=SendCfgUdp[i].nPortType;
 	  send_cfg_table.ram_data_part2.PARTITION_ID=SendCfgUdp[i].nDataSrcPatition;
-	  send_cfg_table.ram_data_part2.INTERFACE_ID=pHwaCfg->sendVlSet[VlIndex>>2].netSelect;/*ÍøÂçÑ¡Ôñ*/
+	  send_cfg_table.ram_data_part2.INTERFACE_ID=pHwaCfg->sendVlSet[VlIndex>>2].netSelect;/*????????*/
 	  log "info" : "Debug INTERFACE_ID = %d",  send_cfg_table.ram_data_part2.INTERFACE_ID;
-	  send_cfg_table.ram_data_part2.PROTOCAL_ID=0x11;/*Ö»ÓÐUDP*/
+	  send_cfg_table.ram_data_part2.PROTOCAL_ID=0x11;/*????UDP*/
 	  send_cfg_table.ram_data_part2.USER_DEFINED_ID=userid;
 	  send_cfg_table.ram_data_part3.SUB_VL_ID = (VlIndex&0x03);
 	  send_cfg_table.ram_data_part3.DEST_UDP_PORT=SendCfgUdp[i].nDstUdp;
@@ -1058,7 +976,8 @@ method transmit_runtime_info(Runtime_Info *runtime_info) {
 // initial configuration is set and when the configuration is loaded from a
 // checkpoint.
 method post_init() {
-	hwa_load_conf_file();
+	$pQtRdcConfValue = parseConfInfo();
+
 	call $load_afdx_config();
 	call $InitTime();
 	init_429_middleware();
@@ -1066,10 +985,14 @@ method post_init() {
     call $init_429_middleware_ok();
     call $init_429_card_ok();
     call $socket_loop_recv();
+	if($pQtRdcConfValue->mode == 1)/*¶¨Ê±×é°ü´¥·¢*/		/* ¸ÄÓÃÊµ¼ÊµÄÄ£Ê½²ÎÊý */
+	{
+	  inline $AfdxRtcTimer.post(0.05,NULL);
+	}
 }

 method destroy() {
     log "info" : "Stop and Close 429 card.";
     close_429_card();
-}
+}
diff --git a/simics-workspace/modules/RDC/hwacfg.h b/simics-workspace/modules/RDC/hwacfg.h
index 5e16525..82d7454 100644
--- a/simics-workspace/modules/RDC/hwacfg.h
+++ b/simics-workspace/modules/RDC/hwacfg.h
@@ -2,6 +2,7 @@
 #ifndef __HWA_CFG_H__
 #define __HWA_CFG_H__

+#define BUFF_LEN 200

 typedef struct
 {
@@ -71,4 +72,11 @@ typedef struct
 	ICMP_STRUCT_t IcmpSet[16];
 }HWACFG_STRUCT_t;

-#endif /* __HWA_CFG_H__ */
\ No newline at end of file
+typedef struct
+{
+	unsigned char mode;
+	unsigned char timeOut;
+	float MIBCycle;
+	unsigned char filePath[BUFF_LEN];
+}QT_RDC_CONF_VALUE_t;
+#endif /* __HWA_CFG_H__ */
diff --git a/simics-workspace/modules/RDC/op_429_card.c b/simics-workspace/modules/RDC/op_429_card.c
index 1d2d6f2..ea20b13 100644
--- a/simics-workspace/modules/RDC/op_429_card.c
+++ b/simics-workspace/modules/RDC/op_429_card.c
@@ -220,7 +220,7 @@ void send_to_429(void *channel_nr, void *word) {
     chan_stat.word = *(OwUInt32*)word;
     inited_channel[chan_stat.channel_nr - 1].tx_data = chan_stat.word;
     send_to_429_card(&inited_channel[chan_stat.channel_nr - 1]);
-    fprintf(stdout, "Transmit from channel %d, data is %x\n", chan_stat.channel_nr, inited_channel[chan_stat.channel_nr - 1].tx_data);
+   // fprintf(stdout, "Transmit from channel %d, data is %x\n", chan_stat.channel_nr, inited_channel[chan_stat.channel_nr - 1].tx_data);
 }
 #else
 void send_to_429(void *channel_nr, void *word) {
@@ -249,7 +249,7 @@ static recv_from_429_card(void *channels) {
         } else {
             if (receiveWords != 0) {
                 inited_channel[i].rx.is_vaild = 1;
-                fprintf(stdout, "Recv from channel %d, data is %x\n", i + 1, inited_channel[i].rx.rx_data);
+              //  fprintf(stdout, "driver recv  %d, data is %x\n", i + 1, inited_channel[i].rx.rx_data);
             } else {
                 inited_channel[i].rx.is_vaild = 0;
             }
diff --git a/simics-workspace/modules/RDC/rdc_load_conf.c b/simics-workspace/modules/RDC/rdc_load_conf.c
index 32038c7..81df2ed 100644
--- a/simics-workspace/modules/RDC/rdc_load_conf.c
+++ b/simics-workspace/modules/RDC/rdc_load_conf.c
@@ -6,6 +6,17 @@
 #include <memory.h>
 #include "hwacfg.h"
 #include "softcfg.h"
+typedef struct
+{
+	unsigned char name[20];	/*  ±êʶÃû */
+	unsigned char type[10];	/*  ±êʶÀàÐÍ */
+	unsigned char value[BUFF_LEN];	/* ±êʶÊýֵ */
+}QT_RDC_CONF_INFO;
+
+static unsigned int count = 0;
+
+QT_RDC_CONF_INFO qtRdcConfInfo[30];
+QT_RDC_CONF_VALUE_t qtRdcConfValue;

 typedef struct
 {
@@ -90,6 +101,10 @@ HWACFG_STRUCT_t *GetHwaCfg()
 	return &cfg_hwa;
 }

+QT_RDC_CONF_VALUE_t *getConfInfo()
+{
+	return &qtRdcConfValue;
+}
 int ReadHwaCfg(FILE *fp)
 {
 	int nReadCnt=0;
@@ -299,19 +314,17 @@ int ReadHeaderCfg(FILE *fp)
 	return 0;
 }

-int hwa_load_conf_file()
+int hwa_load_conf_file(char *path)
 {
-	/*
-	FILE *fp;
-	char ch;
-	fp=fopen("d:\\a.txt","r");
-	ch = fgetc(fp);
-	printf("ch is:0x%x\n",ch);
-	*/
 	FILE *fp;
-	fp=fopen("d:\\CARRDC_L_CFG.bin","rb");
+	fprintf(stdout,"file path =%s\n",path);
+	fp = fopen(path,"rb");
+
+	if(fp == NULL) {
+		fprintf(stdout,"open path failed!\n");
+		while(1);
+	}
 	memset(&A429ToUdpArry,0,sizeof(A429ToUdpArry));
-//	memset(nA429ToA429,0,20*256*sizeof(A429TOA429_STRUCT_t));
 	ReadSoftCfg(fp);
 	ReadHeaderCfg(fp);
 	ReadHwaCfg(fp);
@@ -569,3 +582,136 @@ method AfdxTo429()

 }
 #endif
+/*************************************************************************************************/
+
+
+void saveRdcConfInfo()
+{
+	FILE *fp;
+	char *pCh;
+	char *pBuf,tempBuf[10];
+	int i = 0;
+
+
+	//while(1);
+	pBuf = (char *)malloc(BUFF_LEN);
+	if(pBuf == NULL)
+	{
+		fprintf(stderr, "malloc buffer error,please check!\n");
+		//while(1);
+	}
+
+	fp = fopen("rdcconf.txt","r");
+	if(fp == NULL)
+	{
+		fprintf(stderr,"open rdc configure file error,please check!\n");
+		//while(1);
+	}
+
+	memset((void *)qtRdcConfInfo, 0, sizeof(QT_RDC_CONF_INFO) * 30);
+	while(feof(fp) == 0)
+	{
+		memset(tempBuf, 0, 10);
+		pCh = fgets(pBuf, BUFF_LEN - 1, fp);
+		if(pCh == NULL)
+		{
+			fprintf(stderr, "read file error,please check!\n");
+			break;
+		}
+
+		//fprintf(stdout, "buffer[0]:%x,[1]:%x\n",pBuf[0],pBuf[1]);
+
+		if(pBuf[0] == 10 && pBuf[1] == 0 )
+		{
+			continue;
+		}
+
+		//fprintf(stdout, "buffer string is:%s\n",pBuf);
+
+		pCh = strchr(pBuf,':');
+		if(pCh == NULL)
+		{
+			fprintf(stderr, "find char error,please check!\n");
+			//while(1);
+		}
+
+		memcpy(tempBuf, pBuf, pCh - pBuf);
+		fprintf(stdout, "pCh:%d, pBuf:%d, data len:%d, tempBuf:%s\n",pCh,pBuf,pCh - pBuf, tempBuf);
+
+		if(strcmp(tempBuf, "Name") == 0)
+		{
+			strcpy(pBuf, pCh + 2);
+			strcpy(qtRdcConfInfo[count].name,pBuf);
+			//fprintf(stdout, "name:%s\n",qtRdcConfInfo[count].name);
+		}else if(strcmp(tempBuf, "Type") == 0)
+		{
+			strcpy(pBuf, pCh + 2);
+			strcpy(qtRdcConfInfo[count].type,pBuf);
+			//fprintf(stdout, "type:%s\n",qtRdcConfInfo[count].type);
+		}else if(strcmp(tempBuf, "Value") == 0)
+		{
+			strcpy(pBuf, pCh + 2);
+			strcpy(qtRdcConfInfo[count].value,pBuf);
+			count++;
+			//fprintf(stdout, "value:%s\n",qtRdcConfInfo[count].value);
+		}
+	}
+
+	for(i = 0; i < count; i++)
+	{
+		fprintf(stdout, "\nname:%s",qtRdcConfInfo[i].name);
+		fprintf(stdout, "type:%s",qtRdcConfInfo[i].type);
+		fprintf(stdout, "value:%s",qtRdcConfInfo[i].value);
+	}
+}
+
+
+QT_RDC_CONF_VALUE_t *parseConfInfo(void)
+{
+	unsigned int i = 0, j = 0;
+	int mode;
+
+	saveRdcConfInfo();
+
+	memset((void *)&qtRdcConfValue, 0, sizeof(QT_RDC_CONF_VALUE_t));
+
+	for(i = 0; i < count; i++)
+	{
+		fprintf(stdout, "count:%d, i:%d, name:%s.\n",count, i, qtRdcConfInfo[i].name);
+		if((strncmp(qtRdcConfInfo[i].name,"RDCMode", 7) == 0) && (strncmp(qtRdcConfInfo[i].name,"RDCModel", 8) != 0))
+		{
+			qtRdcConfValue.mode = atoi(qtRdcConfInfo[i].value);
+		}
+
+		else if(strncmp(qtRdcConfInfo[i].name,"RDCTimeout", 10) == 0)
+		{
+			qtRdcConfValue.timeOut = atoi(qtRdcConfInfo[i].value);
+		}
+
+		else if(strncmp(qtRdcConfInfo[i].name,"RDCMIBCycle", 11) == 0)
+		{
+			qtRdcConfValue.MIBCycle = (float)atoi(qtRdcConfInfo[i].value);
+		}
+
+		else if(strncmp(qtRdcConfInfo[i].name,"RDCModel", 8) == 0)
+		{
+			//fprintf(stdout, "input rdcmodel,i:%d.\n",i);
+			strcpy(qtRdcConfValue.filePath, qtRdcConfInfo[i].value);
+			int num = strlen(qtRdcConfValue.filePath);
+			qtRdcConfValue.filePath[num-1] = '\0';
+
+		}
+	}
+
+	fprintf(stdout, "\nmode:%02d(1:¶¨ʱ£»0:˳Ðò).\n",qtRdcConfValue.mode);
+	fprintf(stdout, "MIBCycle:%02f(˳Ðòʱ).\n",qtRdcConfValue.MIBCycle);
+	fprintf(stdout, "timeout:%02d(¶¨ʱʱ).\n",qtRdcConfValue.timeOut);
+	fprintf(stdout, "file path:%s.\n",qtRdcConfValue.filePath);
+
+	hwa_load_conf_file(qtRdcConfValue.filePath);
+	return &qtRdcConfValue;
+}
+
+
+
+/*************************************************************************************************/
diff --git a/simics-workspace/modules/RDC/softcfg.h b/simics-workspace/modules/RDC/softcfg.h
index 0cd0def..81d46ec 100644
--- a/simics-workspace/modules/RDC/softcfg.h
+++ b/simics-workspace/modules/RDC/softcfg.h
@@ -7,6 +7,7 @@
 #define A429_CHANNEL_SIZE  16
 #define A429_LABEL_NUM  256

+#define BUFF_LEN 200
 typedef struct
 {

@@ -124,4 +125,4 @@ typedef struct
 {
 	unsigned short nA429ToA429[20][A429_LABEL_NUM];
 }A429_TO_A429_ARRAY;
-#endif
\ No newline at end of file
+#endif
diff --git a/simics-workspace/modules/afdxES/Makefile b/simics-workspace/modules/afdxES/Makefile
index 82d6319..3b46e45 100644
--- a/simics-workspace/modules/afdxES/Makefile
+++ b/simics-workspace/modules/afdxES/Makefile
@@ -5,7 +5,7 @@
 #

 MODULE_CLASSES = afdxES
-SRC_FILES = tomiddleware.c communicate-with-qt.c untils.c afdxES_runtime_info.c
+SRC_FILES = tomiddleware.c communicate-with-qt.c untils.c afdxES_runtime_info.c mib.c
 DML_FILES = afdxES.dml
 DMLC_FLAGS = -m -I$(SIMICS_WORKSPACE)/include

diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index d251525..6790ad2 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -61,6 +61,20 @@ extern void free_a664_driver_middleware_runtime_header(void *p);
 extern void free_a664_driver_middleware_runtime_name(void *p);
 extern void free_a664_driver_middleware_runtime_description(void *p);

+extern void set_a664_middleware_runtime_header(void *p);
+extern void set_a664_middleware_runtime_name(void *p);
+extern void set_a664_middleware_runtime_description(void *p, int flag);
+extern void free_a664_middleware_runtime_header(void *p);
+extern void free_a664_middleware_runtime_name(void *p);
+extern void free_a664_middleware_runtime_description(void *p);
+
+extern void set_a664_card_runtime_header(void *p);
+extern void set_a664_card_runtime_name(void *p);
+extern void set_a664_card_runtime_description(void *p, int flag);
+extern void free_a664_card_runtime_header(void *p);
+extern void free_a664_card_runtime_name(void *p);
+extern void free_a664_card_runtime_description(void *p);
+
 connect phyA {
 	parameter documentation = "Send data to the second ARINC664 card";
     parameter configuration = "optional";
@@ -121,7 +135,7 @@ implement ieee_802_3_mac {
             if ($is_ieee_802_3_log_on) {
                 call $print_ieee_802_3_mac_rm();
             }
-            call $unpacket_frame(data, size)->($rx_mib);
+            call $unpacket_frame(data, size);
         } else {
 			log "error" : "Send from unkown network";
         }
@@ -223,7 +237,7 @@ method Transmit_mib_info(MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB
     for (i = 0; i < sizeof(*maca_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(maca_mib_info, uint32*) +i));
         memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
-               sizeof(runtime_info.len) + sizeof(runtime_info.type) + i,
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + i*4,
                &tmp,
                sizeoftype(uint32));
     }
@@ -231,15 +245,15 @@ method Transmit_mib_info(MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB
     for (i = 0; i < sizeof(*macb_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(macb_mib_info, uint32*) +i));
         memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
-               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + i,
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + i*4,
                &tmp,
                sizeoftype(uint32));
     }

     for (i = 0; i < sizeof(*rx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(rx_mib_info, uint32*) +i));
-        memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
-               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + i,
+		memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + i*4,
                &tmp,
                sizeoftype(uint32));
     }
@@ -247,7 +261,7 @@ method Transmit_mib_info(MAC_MIB *maca_mib_info, MAC_MIB *macb_mib_info, RX_MIB
     for (i = 0; i < sizeof(*tx_mib_info) / sizeoftype(uint32); ++i) {
         tmp = Htonl(*(cast(tx_mib_info, uint32*) +i));
         memcpy(buf + sizeof(runtime_info.header_length) + runtime_info.header_length +
-               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + sizeof(*rx_mib_info) + i,
+               sizeof(runtime_info.len) + sizeof(runtime_info.type) + sizeof(*maca_mib_info) + sizeof(*macb_mib_info) + sizeof(*rx_mib_info) + i*4,
                &tmp,
                sizeoftype(uint32));
     }
@@ -341,6 +355,48 @@ method init_a664_driver_middleware_ok() {
     free_a664_driver_middleware_runtime_description(&runtime_info.description);
 }

+method init_a664_middleware_ok() {
+    local Runtime_Info runtime_info;
+
+    set_a664_middleware_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_a664_middleware_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_a664_middleware_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_a664_middleware_runtime_header(&runtime_info.header);
+    free_a664_middleware_runtime_name(&runtime_info.name);
+    free_a664_middleware_runtime_description(&runtime_info.description);
+}
+
+method init_a664_card_ok() {
+    local Runtime_Info runtime_info;
+
+    set_a664_card_runtime_header(&runtime_info.header);
+    runtime_info.header_length = Strlen(runtime_info.header);
+    runtime_info.type = 0;
+    set_a664_card_runtime_name(&runtime_info.name);
+    runtime_info.name_length = Strlen(runtime_info.name);
+    runtime_info.flag = 0;
+    set_a664_card_runtime_description(&runtime_info.description, runtime_info.flag);
+    runtime_info.description_length = Strlen(runtime_info.description);
+    runtime_info.len = sizeof(runtime_info.type) + sizeof(runtime_info.name_length) + Strlen(runtime_info.name) +
+        sizeof(runtime_info.flag) + sizeof(runtime_info.description_length) + Strlen(runtime_info.description);
+
+    call $Transmit_runtime_info(&runtime_info);
+
+    free_a664_card_runtime_header(&runtime_info.header);
+    free_a664_card_runtime_name(&runtime_info.name);
+    free_a664_card_runtime_description(&runtime_info.description);
+}
+
 attribute middleware_mode "Used to switch middleware mode" {
     parameter documentation = "Used to switch work mode (to664middleware/to429middleware)";
     parameter allocate_type = "uint32";
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.c b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
index 58d3695..2ada80a 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.c
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.c
@@ -193,3 +193,93 @@ void free_afdxES2_mib_runtime_header(void *p) {
     free(*(char **)p);
     *(char **)p = NULL;
 }
+
+void set_a664_middleware_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_a664_middleware_runtime_name(void *p) {
+    char *name = "A664Middleware";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_a664_middleware_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "A664中间件初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "A664中间件初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_a664_middleware_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_middleware_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_middleware_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void set_a664_card_runtime_header(void *p) {
+    char *header = "Hwa";
+    int header_length = strlen(header) + 1;
+
+    *(char **)p = (char *)malloc(header_length);
+    memcpy(*(char **)p, header, header_length);
+}
+
+void set_a664_card_runtime_name(void *p) {
+    char *name = "A664Card";
+    int name_length = strlen(name) + 1;
+
+    *(char **)p = (char *)malloc(name_length);
+    memcpy(*(char **)p, name, name_length);
+}
+
+void set_a664_card_runtime_description(void *p, int flag) {
+    if (flag == 0) {            /* success */
+        char *description = "A664板卡初始化成功";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    } else {
+        char *description = "A664板卡初始化失败";
+        int description_length = strlen(description) + 1;
+        *(char **)p = (char *)malloc(description_length);
+        memcpy(*(char **)p, description, description_length);
+    }
+}
+
+void free_a664_card_runtime_header(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_card_runtime_name(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
+
+void free_a664_card_runtime_description(void *p) {
+    free(*(char **)p);
+    *(char **)p = NULL;
+}
diff --git a/simics-workspace/modules/afdxES/afdxES_runtime_info.h b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
index a4fd95d..f074617 100644
--- a/simics-workspace/modules/afdxES/afdxES_runtime_info.h
+++ b/simics-workspace/modules/afdxES/afdxES_runtime_info.h
@@ -36,4 +36,18 @@ extern void free_afdxES2_mib_runtime_header(void *p);
 extern void free_afdxES2_mib_runtime_name(void *p);
 extern void free_afdxES2_mib_runtime_description(void *p);

+extern void set_a664_middleware_runtime_header(void *p);
+extern void set_a664_middleware_runtime_name(void *p);
+extern void set_a664_middleware_runtime_description(void *p, int flag);
+extern void free_a664_middleware_runtime_header(void *p);
+extern void free_a664_middleware_runtime_name(void *p);
+extern void free_a664_middleware_runtime_description(void *p);
+
+extern void set_a664_card_runtime_header(void *p);
+extern void set_a664_card_runtime_name(void *p);
+extern void set_a664_card_runtime_description(void *p, int flag);
+extern void free_a664_card_runtime_header(void *p);
+extern void free_a664_card_runtime_name(void *p);
+extern void free_a664_card_runtime_description(void *p);
+
 #endif
diff --git a/simics-workspace/modules/afdxES/checksum.dml b/simics-workspace/modules/afdxES/checksum.dml
index ce60054..df8c3d3 100644
--- a/simics-workspace/modules/afdxES/checksum.dml
+++ b/simics-workspace/modules/afdxES/checksum.dml
@@ -70,8 +70,8 @@ method receive_udp_check_sum(PortQueue* queue)->(bool result) {
     call $part_udp_check_sum(checksum_data,
                              port_item.size,sum)
         ->(new_udp_checksum);
-    log "info" : "new_udp_checksum =%x", new_udp_checksum;
-    log "info" : "new_udp_checksum =%x", old_udp_checksum;
+  //  log "info" : "new_udp_checksum =%x", new_udp_checksum;
+  //  log "info" : "new_udp_checksum =%x", old_udp_checksum;
     if(new_udp_checksum != old_udp_checksum) result = false;
     else result = true;
 }
@@ -134,8 +134,8 @@ method unpacket_ip_checksum(uint8 *buffer)->(uint8 correct) {
 	buffer[IP_CHECKSUM_ADDR+1]=0;

 	call $ip_check_sum(ip_header_addr, IP_HEADER_LENGTH)->(new_ip_checksum);
-	log "info" : "2	new_ip_checksum =%x", new_ip_checksum;
-	log "info" : "2	old_ip_checksum =%x", old_ip_checksum;
+	//log "info" : "2	new_ip_checksum =%x", new_ip_checksum;
+	//log "info" : "2	old_ip_checksum =%x", old_ip_checksum;
 	if(new_ip_checksum != old_ip_checksum)
 		correct = INCORRECT;
 	else
@@ -202,7 +202,7 @@ method crc_check(uint8 *data,uint32 size,uint32* table) {
 	crc1 = cast(data+size-4,uint32*);
 	STORE_BE32(&crc_value_temp,crc_value);
 	*crc1 = crc_value_temp;
-	log "info": "crc=%x.",*crc1;
+	//log "info": "crc=%x.",*crc1;
 }

 method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check) {
@@ -227,7 +227,7 @@ method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check) {
 	old_crc = *crc1;
 	STORE_BE32(&crc_value_temp,crc_value);
 	new_crc = crc_value_temp;
-	log "info": "new_crc=%x,old_crc=%x.",new_crc,old_crc;
+//	log "info": "new_crc=%x,old_crc=%x.",new_crc,old_crc;
 	if(old_crc == new_crc)
 		check = true;
 	else
diff --git a/simics-workspace/modules/afdxES/communicate-with-qt.c b/simics-workspace/modules/afdxES/communicate-with-qt.c
index 8fc6c5d..363e83b 100644
--- a/simics-workspace/modules/afdxES/communicate-with-qt.c
+++ b/simics-workspace/modules/afdxES/communicate-with-qt.c
@@ -41,7 +41,7 @@ int qt_socket_init(void) {
 int qt_socket_send(unsigned char *sendbuf, int size) {
     int len = send(client_socket, (char *)sendbuf, size, 0);
     if (len == size) {
-        fprintf(stdout, "Socket send sucessfully, send %d bytes.\n", len);
+        //  fprintf(stdout, "Socket send sucessfully, send %d bytes.\n", len);
         return len;
     } else {
         fprintf(stderr, "Socket send failed, error code is %d\n", WSAGetLastError());
diff --git a/simics-workspace/modules/afdxES/mib-info.dml b/simics-workspace/modules/afdxES/mib-info.dml
index 68e1fa8..1b8a1fd 100644
--- a/simics-workspace/modules/afdxES/mib-info.dml
+++ b/simics-workspace/modules/afdxES/mib-info.dml
@@ -3,6 +3,10 @@ dml 1.2;
 import "packet-description.dml";
 import "constant.dml";

+extern void get_tx_mib(uint8 *mib_t);
+extern void get_rx_mib(uint8 *mib_t);
+extern void get_mac_mib(uint8 a_or_b, uint8 *mib_t);
+
 // for MIB
 struct MAC_MIB {
     uint32 crc_error;   				//crc checksum error
@@ -81,54 +85,37 @@ method Clear_Tx_Mib_Info() {
 }

 method Recv_Tx_Mib_Info_From_664_Middleware() {
-    local uint32 data_type;
 	local int len;
 	local uint8 recvbuf[8192];

-    data_type = PACKET_TX_MIB;
-    Send_To_664_Middleware(cast(&data_type, uint8*), CFG_TYPE_SIZE);
-
-	len = Recv_Mib_Info_From_664_Middleware(recvbuf, 8192);
-    if (len > 0) {
-        call $Set_Tx_Mib_Info(recvbuf + 1);
-    } else {
-        log "error" : "Failed recv tx mib info from 664 middleware!\n";
-    }
+	get_tx_mib(recvbuf);
+	call $Set_Tx_Mib_Info(recvbuf);
 }

 method Recv_Mac_Mib_From_664_Middleware(int32 a_or_b) {
-	local uint32 data_type[2];
 	local uint8 recvbuf[8192];
 	local int len;

-	data_type[0] = PACKET_MAC_MIB;
-	data_type[1] = a_or_b;
-    Send_To_664_Middleware(cast(data_type, uint8*), 8);
-
-	len = Recv_Mib_Info_From_664_Middleware(recvbuf, 8192);
-    if (len > 0) {
-        $mac_sign = a_or_b;
-        call $Set_Mac_Mib_Info(recvbuf + 1);
-    } else {
-        log "error" : "Failed recv mac mib from 664 middleware!\n";
-    }
-
+	get_mac_mib(a_or_b, recvbuf);
+
+	//mwg test start
+	local int i;
+	for(i=0; i<8192; i++) {
+		if(recvbuf[i] != 0)
+			log "info":"recvbuf[%d] = %x",i,recvbuf[i];
+	}
+	//mwg test end
+	$mac_sign = a_or_b;
+	call $Set_Mac_Mib_Info(recvbuf);
 }

 method Recv_Rx_Mib_Info_From_664_Middleware() {
-	local uint32 data_type;
 	local uint8 recvbuf[8192];
 	local int32 len;
+
+	get_rx_mib(recvbuf);

-    data_type = PACKET_RX_MIB;
-    Send_To_664_Middleware(cast(&data_type, uint8*), CFG_TYPE_SIZE);
-
-	len = Recv_Mib_Info_From_664_Middleware(recvbuf, 8192);
-    if (len > 0) {
-        call $Set_Rx_Mib_Info(recvbuf + 1);
-    } else {
-        log "error" : "Failed recv rx mib info from 664 middleware";
-    }
+	call $Set_Rx_Mib_Info(recvbuf);
 }

 method  Set_Mac_Mib_Info(uint8 *buffer) {
diff --git a/simics-workspace/modules/afdxES/pci-register.dml b/simics-workspace/modules/afdxES/pci-register.dml
index e8e2cf7..af037fe 100644
--- a/simics-workspace/modules/afdxES/pci-register.dml
+++ b/simics-workspace/modules/afdxES/pci-register.dml
@@ -260,11 +260,11 @@ bank pciport{
         field bmmo [0:0] "B Mac Mode"{
             method write(value) {
                 if (value == 0) {
-                    log "info",2,0: "B mac mode is 100Mbps";
+                    log "info": "B mac mode is 100Mbps";
                     $phy_max_bandwidth = 1280 * 1024;
                 } else if (value == 1) {
                     $phy_max_bandwidth = 128 * 1024;
-                    log "info",2,0: "B mac mode is 10Mbps";
+                    log "info": "B mac mode is 10Mbps";
                 }
                 if (!$middleware_mode) {
                     $phyB.ieee_802_3_mac.config_bandwidth($phy_max_bandwidth);
@@ -274,10 +274,10 @@ bank pciport{
         field ammo [1:1] "A Mac Mode"{
             method write(value) {
                 if (value == 0) {
-                    log "info",2,0: "A mac mode is 100Mbps";
+                    log "info": "A mac mode is 100Mbps";
                     $phy_max_bandwidth = 1280 * 1024;
                 } else if (value == 1) {
-                    log "info",2,0: "A mac mode is 10Mbps";
+                    log "info": "A mac mode is 10Mbps";
                     $phy_max_bandwidth = 128 * 1024;
                 }
                 if (!$middleware_mode) {
@@ -544,6 +544,7 @@ bank pciport{
 				call $ Write_Config_All();
                 LoadCfgTo664Middleware();
 				ret = Init_664_Card();
+                call $init_a664_card_ok();
 				$recv_port_num = get_recv_port_num();
 				if(ret == 0)
 					log "info":"init middle succesee";
@@ -878,7 +879,8 @@ bank pciport{

     register MACA_MIB_addr {
         method after_write(memop) {
-            call $Recv_Mac_Mib_From_664_Middleware(MACA_MIB_CONFIG);
+			if ($middleware_mode == To664Middleware)
+				call $Recv_Mac_Mib_From_664_Middleware(MACA_MIB_CONFIG);

             switch($this) {
             case 0:
@@ -909,7 +911,10 @@ bank pciport{
                 $MACA_MIB_data = $maca_mib.input_1024_1518_count;
                 break;
             case 9:
-                $MACA_MIB_data = $maca_mib.input_frame_byte_count;
+				if ($middleware_mode == To664Middleware)
+					$MACA_MIB_data = $maca_mib.input_frame_byte_count+$maca_mib.input_frame_count*4;
+				else if ($middleware_mode == To429Middleware)
+					$MACA_MIB_data = $maca_mib.input_frame_byte_count;
                 break;
             case 10:
                 $MACA_MIB_data = $maca_mib.output_frame_count;
@@ -930,7 +935,10 @@ bank pciport{
                 $MACA_MIB_data = $maca_mib.output_1024_1518_count;
                 break;
             case 16:
-                $MACA_MIB_data = $maca_mib.output_frame_byte_count;
+				if ($middleware_mode == To664Middleware)
+					$MACA_MIB_data = $maca_mib.output_frame_byte_count+$maca_mib.output_frame_count*4;
+                else if ($middleware_mode == To429Middleware)
+					$MACA_MIB_data = $maca_mib.output_frame_byte_count;
                 break;
             case 17:
                 $MACA_MIB_data = $maca_mib.first_bit_error_count;
@@ -947,7 +955,8 @@ bank pciport{

     register MACB_MIB_addr {
         method after_write(memop) {
-            call $Recv_Mac_Mib_From_664_Middleware(MACB_MIB_CONFIG);
+			if ($middleware_mode == To664Middleware)
+				call $Recv_Mac_Mib_From_664_Middleware(MACB_MIB_CONFIG);

             switch($this) {
             case 0:
@@ -978,7 +987,10 @@ bank pciport{
                 $MACB_MIB_data = $macb_mib.input_1024_1518_count;
                 break;
             case 9:
-                $MACB_MIB_data = $macb_mib.input_frame_byte_count;
+				if ($middleware_mode == To664Middleware)
+					$MACB_MIB_data = $macb_mib.input_frame_byte_count+$macb_mib.input_frame_count*4;
+				else if ($middleware_mode == To429Middleware)
+					$MACB_MIB_data = $macb_mib.input_frame_byte_count;
                 break;
             case 10:
                 $MACB_MIB_data = $macb_mib.output_frame_count;
@@ -999,7 +1011,10 @@ bank pciport{
                 $MACB_MIB_data = $macb_mib.output_1024_1518_count;
                 break;
             case 16:
-                $MACB_MIB_data = $macb_mib.output_frame_byte_count;
+				if ($middleware_mode == To664Middleware)
+					$MACB_MIB_data = $macb_mib.output_frame_byte_count+$macb_mib.output_frame_count*4;
+                else if ($middleware_mode == To429Middleware)
+					$MACB_MIB_data = $macb_mib.output_frame_byte_count;
                 break;
             case 17:
                 $MACB_MIB_data = $macb_mib.first_bit_error_count;
@@ -1016,7 +1031,8 @@ bank pciport{

     register rx_MIB_addr {
         method after_write(memop) {
-            call $Recv_Rx_Mib_Info_From_664_Middleware();
+			if ($middleware_mode == To664Middleware)
+				call $Recv_Rx_Mib_Info_From_664_Middleware();
             switch($this) {
             case 0:
                 $rx_MIB_data = $rx_mib.disable_A_filt_count;
@@ -1082,7 +1098,8 @@ bank pciport{

     register tx_MIB_addr {
         method after_write(memop) {
-            call $Recv_Tx_Mib_Info_From_664_Middleware();
+			if ($middleware_mode == To664Middleware)
+				call $Recv_Tx_Mib_Info_From_664_Middleware();
             switch($this) {
             case 0:
                 $tx_MIB_data = $tx_mib.tx_ip_count;
@@ -1283,20 +1300,30 @@ bank pciport{
         method read() -> (value) {
             local uint32 port_id = $pciport.rx_port_id;
             local bool is_empty;
+			local int port_type;
+
+			port_type = $analyse_cfg_ram_array[port_id].ram_data.PORT_TYPE;

             if (port_id >= 0 && port_id < 4096) {
-                switch ($port[port_id].port_type) {
-                case 0: case 1:
+                switch (port_type) {
+                case 0: case 2:
                     if ($middleware_mode == To429Middleware) {
                         inline $IsPortQueueEmpty($port[port_id].queue) ->(is_empty);
                     } else if ($middleware_mode == To664Middleware) {
                         inline $IsPortCacheEmpty($PortCache[port_id]) ->(is_empty);
-                    } else {
+					} else {
                         log "info" : "Unsupported work mode!\n";
                     }
                     break;
-                case 2:
-                    inline $IsPortSampleEmpty(&($port[port_id])) -> (is_empty);
+                case 1:
+					if ($middleware_mode == To429Middleware) {
+						inline $IsPortSampleEmpty(&($port[port_id])) -> (is_empty);
+					} else if ($middleware_mode == To664Middleware) {
+						inline $IsCacheSampleEmpty(port_id) -> (is_empty);
+					} else {
+						log "info" : "Unsupported work mode!\n";
+				    }
+
                     break;
                 default:
                     log "error" : "Unsuported port type";
@@ -1322,24 +1349,65 @@ bank pciport{
                 local bool is_empty;
                 local PortItem item;
                 local Cache_Item item1;
+				local int port_type;
+				port_type = $analyse_cfg_ram_array[port_id].ram_data.PORT_TYPE;
                 if (port_id >= 0 && port_id < 4096) {
-                    switch ($middleware_mode) {
-                    case To429Middleware:
-                        inline $DePortQueue($port[port_id].queue, &item)-> (is_empty);
-                        if (is_empty == false) {
-                            return;
-                        }
-                        break;
-                    case To664Middleware:
-                        inline $DePortCache($PortCache[port_id], &item1) -> (is_empty);
-                        if (is_empty == false) {
-                            return;
-                        }
-                        break;
-                    default:
-                        log "info" : "Unsupported work mode!\n";
-                        break;
-                    }
+					switch (port_type) {
+						case 0: case 2:
+							switch ($middleware_mode) {
+								case To429Middleware:
+									inline $DePortQueue($port[port_id].queue, &item)-> (is_empty);
+									if (is_empty == false) {
+										return;
+									}
+									break;
+								case To664Middleware:
+									inline $DePortCache($PortCache[port_id], &item1) -> (is_empty);
+									if (is_empty == false) {
+										return;
+									}
+									break;
+								default:
+									log "info" : "Unsupported work mode!\n";
+									break;
+							}
+							break;
+
+						case 1:
+							switch ($middleware_mode) {
+								case To429Middleware:
+									inline $IsPortSampleEmpty(&($port[port_id])) -> (is_empty);
+									if(is_empty == false) {
+										local int i;
+										//memcpy(item.frame, ($port[port_id]).frame, ($port[port_id]).size);
+										item.frame =  ($port[port_id]).frame;
+										item.size = ($port[port_id]).size;
+									/*	log "info": "afdx 1 sample data";
+										log "info" : "sample data size is %d",item.size;
+										for (i=8; i < item.size; i++) log "info" : "data[%d] = %x", i, item.frame[i];
+									*/
+									} else {
+										return ;
+									}
+									break;
+								case To664Middleware:
+									inline $IsCacheSampleEmpty(port_id) -> (is_empty);
+									if(is_empty == false ) {
+										memcpy(item1.buffer, $cache[port_id].buffer, $cache[port_id].size);
+										item1.size = $cache[port_id].size;
+									} else {
+										return;
+									}
+									break;
+								default:
+									log "info" : "Unsupported work mode!\n";
+									break;
+							}
+							break;
+
+						default:
+						break;
+					}
                 } else {
                     log "error": "wrong port id";
                     return;
@@ -1403,6 +1471,10 @@ bank pciport{

     register rx_sampling_port_freshness {
         parameter hard_reset_value = 0x1;
+
+		method after_read(memop) {
+		//	log "info" : " register freshness is %d",$this;
+			$this = 1;
+		}
     }
 }
-
diff --git a/simics-workspace/modules/afdxES/port-cache.dml b/simics-workspace/modules/afdxES/port-cache.dml
index 9bd1615..40c1ed3 100644
--- a/simics-workspace/modules/afdxES/port-cache.dml
+++ b/simics-workspace/modules/afdxES/port-cache.dml
@@ -83,3 +83,22 @@ method IsPortCacheEmpty(Port_Cache *port_cache) -> (bool result) {
         result = false;
     }
 }
+
+method RefreshCacheData(int id, Cache_Item item) {
+	memcpy($cache[id].buffer, item.buffer, item.size);
+	$cache[id].size  = item.size;
+	$pciport.rx_sampling_port_freshness = 0;  // ÐÂÏÊµÄ
+}
+
+method IsCacheSampleEmpty(int port_id) -> (bool result) {
+	if ($cache[port_id].size == 0)
+		result = true;
+	else
+		result = false;
+}
+
+struct Cache_Data {
+	uint8 buffer[1518];
+	int	  size;
+}
+data Cache_Data cache[4096];
diff --git a/simics-workspace/modules/afdxES/port-queue.dml b/simics-workspace/modules/afdxES/port-queue.dml
index f432806..24b36a2 100644
--- a/simics-workspace/modules/afdxES/port-queue.dml
+++ b/simics-workspace/modules/afdxES/port-queue.dml
@@ -39,8 +39,8 @@ method EnPortQueue(PortQueue *queue,UDP_Item item) ->(bool result) {
 		tail->single_size = item.udp_packet_size;
 		memcpy(tail->buffer,item.buffer,item.udp_packet_size);
 		queue->tail = tail;
-		log "info" : "tail whole size = %d",tail->whole_size;
-		log "info" : "tail single size =%d",tail->single_size;
+		//log "info" : "tail whole size = %d",tail->whole_size;
+		//log "info" : "tail single size =%d",tail->single_size;
 	} else {
 		if(item.udp_length > PORT_ITEM_SIZE || item.udp_length + queue->queue_size > PORT_QUEUE_MAX_SIZE) {
 			log "info": "queue is full or single queue is too big!";
@@ -59,8 +59,8 @@ method EnPortQueue(PortQueue *queue,UDP_Item item) ->(bool result) {
 		tail->single_size = item.udp_packet_size;
 		tail->dest_ip = item.dest_ip;
 		tail->src_ip = item.src_ip;
-		log "info" : "tail whole size =%d",tail->whole_size;
-		log "info" : "tail single size = %d",tail->single_size;
+		//log "info" : "tail whole size =%d",tail->whole_size;
+		//log "info" : "tail single size = %d",tail->single_size;

 		memcpy(tail->buffer, item.buffer, item.udp_packet_size);
@@ -164,7 +164,7 @@ method IsPortQueueEmpty(PortQueue *queue) ->(bool result) {
 }

 method RefreshPortData(Receive_Port *port, UDP_Item udp_item) {
-	port->port_type = 2;
+	port->port_type = 1;

 	if (port->frame != NULL)
 		dbuffer_free(port->dbuf);
@@ -173,6 +173,8 @@ method RefreshPortData(Receive_Port *port, UDP_Item udp_item) {
 	port->frame = dbuffer_append(port->dbuf, udp_item.udp_length);

 	memcpy(port->frame, udp_item.buffer, udp_item.udp_length);
+	port->size = udp_item.udp_length;
+	$pciport.rx_sampling_port_freshness = 0;  // ÐÂÏÊµÄ
 }

@@ -188,6 +190,7 @@ struct Receive_Port {
 	PortQueue *queue;
 	dbuffer_t *dbuf;
 	uint8 *frame;
+	int  size;
 }

 data Receive_Port port[4096];
diff --git a/simics-workspace/modules/afdxES/rm-handler.dml b/simics-workspace/modules/afdxES/rm-handler.dml
index 3bb65a0..44bab3d 100644
--- a/simics-workspace/modules/afdxES/rm-handler.dml
+++ b/simics-workspace/modules/afdxES/rm-handler.dml
@@ -42,27 +42,30 @@ method RM_Handler(RM_INFO *rm_info, uint8 interface_id, uint8 frame_sn) -> (bool
         rm_info->B_Interface_ID = 0;
     }

-    if (interface_id != rm_info->A_Interface_ID) {
-        $rx_mib.disable_A_filt_count++;
-    }

-    if (interface_id != rm_info->B_Interface_ID) {
-        $rx_mib.disable_B_filt_count++;
+	if (interface_id == rm_info->A_Interface_ID) {
+        call $mib_in_sum(&($maca_mib), rm_info->frame_size);
+    } else if (interface_id == rm_info->B_Interface_ID) {
+        call $mib_in_sum(&($macb_mib), rm_info->frame_size);
     }

     if ((frame_sn == $recv_vl[rm_info->rm_index].expect_sn) &&
         ((interface_id == rm_info->A_Interface_ID) ||
          (interface_id == rm_info->B_Interface_ID))) {
-        $rx_mib.size = rm_info->frame_size;
+        $rx_mib.size += rm_info->frame_size;
         $recv_vl[rm_info->rm_index].expect_sn++;
         $recv_vl[rm_info->rm_index].expect_sn %= 256;
-        if (interface_id == rm_info->A_Interface_ID) {
-            call $mib_in_sum(&($maca_mib), rm_info->frame_size);
-        } else if (interface_id == rm_info->B_Interface_ID) {
-            call $mib_in_sum(&($macb_mib), rm_info->frame_size);
-        }
+
         result = true;
     } else {
+		if(interface_id == rm_info->A_Interface_ID) {
+			 $rx_mib.disable_A_filt_count++;
+			 $rx_mib.redunt_filt_count++;
+		}
+		if(interface_id == rm_info->B_Interface_ID) {
+			 $rx_mib.disable_B_filt_count++;
+			 $rx_mib.redunt_filt_count++;
+		}
         result = false;
     }
 }
diff --git a/simics-workspace/modules/afdxES/tomiddleware.c b/simics-workspace/modules/afdxES/tomiddleware.c
index 0c177a5..f4b8ae8 100644
--- a/simics-workspace/modules/afdxES/tomiddleware.c
+++ b/simics-workspace/modules/afdxES/tomiddleware.c
@@ -13,93 +13,93 @@ static unsigned recv_ports[MAX_RECV_PORTS];
 static int send_port_num;
 static int recv_port_num;
 static char send_port_name[30]="send_port_";
-static char recv_port_name[30]="recv_port_";
-
-int Init_664_Work_Mode(void) {
-    WSADATA wsa;
-
-    if (WSAStartup(MAKEWORD(2,2), &wsa)) {
-        fprintf(stderr, "WSAStartup failed, error code is %d.\n", WSAGetLastError());
-        return -1;
-    }
-
-    client_socket = socket(AF_INET, SOCK_STREAM , 0);
-
-    if (client_socket  == INVALID_SOCKET) {
-        fprintf(stderr, "Create socket failed, error code is %d.\n", WSAGetLastError());
-        return -1;
-    }
-
-    SOCKADDR_IN serveraddr;
-    memset(&serveraddr, 0, sizeof(serveraddr));
-    serveraddr.sin_family = AF_INET;
-    serveraddr.sin_port = htons(10087);
-    serveraddr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
-
-    if (connect(client_socket, (struct sockaddr *) &serveraddr, sizeof(serveraddr)) != 0) {
-        fprintf(stderr, "Connect failed, error code is %d.\n", WSAGetLastError());
-        return -1;
-    }
-
-    fprintf(stdout, "Socket_init ok\n");
-
-    return 0;
-}
-
-int Send_To_664_Middleware(unsigned char *sendbuf, int size) {
-    int len = send(client_socket, (char *)sendbuf, size, 0);
-
-    if (len == size) {
-        fprintf(stdout, "Socket send sucessfully, send %d bytes.\n", len);
-        return len;
-    } else {
-        fprintf(stderr, "Socket send failed, size = %d, sended len = %d!\n", size, len);
-        return 0;
-    }
-}
-
-int Recv_Data_From_664_Middleware(unsigned char *recvbuf, int size) {
-    fd_set rfds;
-    FD_ZERO(&rfds);
-    FD_SET(client_socket, &rfds);
-
-    struct timeval tv = {0};
-
-    int retval = select(0, &rfds, NULL, NULL, &tv);
-    if (retval == -1) {
-        fprintf(stderr, "Socket recv select failed, error code is %d\n.", WSAGetLastError());
-        return -1;
-    }
-    else if (retval == 0) {
-        return 0;
-    } else {
-        int len = 0;
-
-        if (FD_ISSET(client_socket, &rfds)) {
-            memset(recvbuf, 0, size);
-
-            len = recv(client_socket, (char *)recvbuf, size, 0);
-            if (len > 0) {
-                fprintf(stdout, "Socket recv sucessfully, recv %d size!\n", len);
-            } else {
-                fprintf(stderr, "Socket recv failed, error code is %d.\n", WSAGetLastError());
-            }
-        }
-
-        return len;
-    }
-}
-
-int Recv_Mib_Info_From_664_Middleware(unsigned char *recvbuf, int size) {
-    int len = recv(client_socket, (char *)recvbuf, size, 0);
-    if (len > 0) {
-        fprintf(stdout, "Socket recv successfully, recv %d size!\n", len);
-    } else {
-        fprintf(stderr, "Socket recv failed, error code is %d.\n", WSAGetLastError());
-    }
-    return len;
-}
-
+static char recv_port_name[30]="recv_port_";
+
+int Init_664_Work_Mode(void) {
+    WSADATA wsa;
+
+    if (WSAStartup(MAKEWORD(2,2), &wsa)) {
+        fprintf(stderr, "WSAStartup failed, error code is %d.\n", WSAGetLastError());
+        return -1;
+    }
+
+    client_socket = socket(AF_INET, SOCK_STREAM , 0);
+
+    if (client_socket  == INVALID_SOCKET) {
+        fprintf(stderr, "Create socket failed, error code is %d.\n", WSAGetLastError());
+        return -1;
+    }
+
+    SOCKADDR_IN serveraddr;
+    memset(&serveraddr, 0, sizeof(serveraddr));
+    serveraddr.sin_family = AF_INET;
+    serveraddr.sin_port = htons(10087);
+    serveraddr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
+
+    if (connect(client_socket, (struct sockaddr *) &serveraddr, sizeof(serveraddr)) != 0) {
+        fprintf(stderr, "Connect failed, error code is %d.\n", WSAGetLastError());
+        return -1;
+    }
+
+    fprintf(stdout, "Socket_init ok\n");
+
+    return 0;
+}
+
+int Send_To_664_Middleware(unsigned char *sendbuf, int size) {
+    int len = send(client_socket, (char *)sendbuf, size, 0);
+
+    if (len == size) {
+     //   fprintf(stdout, "Socket send sucessfully, send %d bytes.\n", len);
+        return len;
+    } else {
+		fprintf(stderr, "Socket send failed, size = %d, sended len = %d!\n", size, len);
+        return 0;
+    }
+}
+
+int Recv_Data_From_664_Middleware(unsigned char *recvbuf, int size) {
+    fd_set rfds;
+    FD_ZERO(&rfds);
+    FD_SET(client_socket, &rfds);
+
+    struct timeval tv = {0};
+
+    int retval = select(0, &rfds, NULL, NULL, &tv);
+    if (retval == -1) {
+        fprintf(stderr, "Socket recv select failed, error code is %d\n.", WSAGetLastError());
+        return -1;
+    }
+    else if (retval == 0) {
+        return 0;
+    } else {
+        int len = 0;
+
+        if (FD_ISSET(client_socket, &rfds)) {
+            memset(recvbuf, 0, size);
+
+            len = recv(client_socket, (char *)recvbuf, size, 0);
+            if (len > 0) {
+                fprintf(stdout, "Socket recv sucessfully, recv %d size!\n", len);
+            } else {
+                fprintf(stderr, "Socket recv failed, error code is %d.\n", WSAGetLastError());
+            }
+        }
+
+        return len;
+    }
+}
+
+int Recv_Mib_Info_From_664_Middleware(unsigned char *recvbuf, int size) {
+    int len = recv(client_socket, (char *)recvbuf, size, 0);
+    if (len > 0) {
+        fprintf(stdout, "Socket recv successfully, recv %d size!\n", len);
+    } else {
+        fprintf(stderr, "Socket recv failed, error code is %d.\n", WSAGetLastError());
+    }
+    return len;
+}
+
 const int analyse_cfg_cam_array_len = MAX_RECV_PORTS;
 struct analyse_cfg_cam analyse_cfg_cam_array[MAX_RECV_PORTS];

@@ -191,8 +191,6 @@ static char* ab_enable_string(u32 enable_a, u32 enable_b)

 void send_port_string(FILE *fp) {
 	int i;
-	int j;
-	u64 tt;
 	for (i = 0; i < transmit_cfg_ram_array_len; i++) {
 		struct transmit_cfg_ram *ram = &transmit_cfg_ram_array[i];
 		if (all_zeroes((char *)ram, sizeof(*ram)))
@@ -350,28 +348,26 @@ int Init_664_Card(void) {
 	}

 	return 0;
-}
-#else
-int Init_664_Card(void) {
-}
-#endif
-
-#ifndef __DEBUG__
-int Recv_From_A664(int card_nr, int port_id, unsigned char *buf) {
+}
+#else
+int Init_664_Card(void) {
+}
+#endif
+
+#ifndef __DEBUG__
+int Recv_From_A664(int card_nr, int port_id, unsigned char *buf,unsigned *network, unsigned *valid) {
 	HwaRecvTime time;
-	unsigned network;
-	unsigned valid;

-	int len = hwa_aes_recv(card_nr, recv_ports[port_id], buf, MAX_PACK_LEN, &time, &network, &valid);
+	int len = hwa_aes_recv(card_nr, recv_ports[port_id], buf, MAX_PACK_LEN, &time, network, valid);

 	return len;
-}
-#else
-int Recv_From_A664(int card_nr, int port_id, unsigned char *buf) {
-}
-#endif
-
-#ifndef __DEBUG__
+}
+#else
+int Recv_From_A664(int card_nr, int port_id, unsigned char *buf,unsigned *network, unsigned *valid) {
+}
+#endif
+
+#ifndef __DEBUG__
 int Send_To_A664(int card_nr, int port_id, unsigned char *buf, int len) {
 	int ret = hwa_aes_send (card_nr, send_ports[port_id], buf, len);

diff --git a/simics-workspace/modules/afdxES/tomiddleware.dml b/simics-workspace/modules/afdxES/tomiddleware.dml
index e2dd1e2..95647d0 100644
--- a/simics-workspace/modules/afdxES/tomiddleware.dml
+++ b/simics-workspace/modules/afdxES/tomiddleware.dml
@@ -5,7 +5,7 @@ import "port-cache.dml";
 extern int Init_664_Work_Mode(void);
 extern int Init_664_Card(void);
 extern int Send_To_A664(int card_nr, int pord_id, char *buf, int len);
-extern int Recv_From_A664(int card_nr, int port_id, char *buf);
+extern int Recv_From_A664(int card_nr, int port_id, char *buf,uint32 *network,uint32 *valid);
 extern int Send_To_664_Middleware(char *recvbuf, int size);
 extern int Recv_Data_From_664_Middleware(char *sendbuf, int size);
 extern int Recv_Mib_Info_From_664_Middleware(char *recvbuf, int size);
@@ -33,6 +33,7 @@ data int recv_num;
 method Handle_664_Data(uint32 port_id,uint8 *data, int length) {
     local bool is_cached_ok;
     local Cache_Item item;
+	local int port_type;

     memcpy(item.buffer, data, length);
     item.size = length ;
@@ -41,30 +42,46 @@ method Handle_664_Data(uint32 port_id,uint8 *data, int length) {

 	if($recv_num%50 == 0)
 		log "info":"%d ",$recv_num;
-
+	port_type = $analyse_cfg_ram_array[port_id].ram_data.PORT_TYPE;
+	switch (port_type) {
+		case 0: case 2:
         call $EnPortCache($PortCache[port_id], item) -> (is_cached_ok);
         if (!is_cached_ok) {
             log "error" : "Port: %d's cache has full!\n", port_id;
             ++$rx_buf_overflow_number[port_id];
+			break;
+		case 1:
+			if ($recv_port_valid[port_id] == 1)
+				call  $RefreshCacheData(port_id, item);
+			break;
+		default:
+			log "error" : "Unsuported port type";
+			break;
         }
+	}
 }
 data int recv_port_num;
+data int recv_port_valid[4096];
 method Recv_Data_From_664_Middleware_Loop_Event() {
     local int length;
     local uint8 *buf = new uint8 [PORT_DATA_SIZE];
 	local int i;
+	local int j;
+	local uint32 network;
+	local uint32 valid;
 	for (i=0; i < $recv_port_num; i++)
 	{
-		length = Recv_From_A664(0, i, buf);
+		length = Recv_From_A664(0, i, buf, &network,&valid);
+		$recv_port_valid[i] = valid;
+		if (length > 0) {

-    if (length > 0) {
 			call $Handle_664_Data(i, buf, length);
 		}
     }

     delete buf;
 	//if($load_config_done == 1)
-		after (0.0001) call $Recv_Data_From_664_Middleware_Loop_Event();
+		after (0.001) call $Recv_Data_From_664_Middleware_Loop_Event();
 	//else
 	//	after (0.001) call $Recv_Data_From_664_Middleware_Loop_Event();
 }
@@ -74,7 +91,7 @@ method init_middleware_mode() {
 	ret = -1;
     if ($middleware_mode == To664Middleware) {
      //   Init_664_Work_Mode();
-
+        call $init_a664_middleware_ok();
         call $Init_Port_Cache();
     }
 }
diff --git a/simics-workspace/modules/afdxES/unpacket-frame.dml b/simics-workspace/modules/afdxES/unpacket-frame.dml
index 7f0047e..d597e1e 100644
--- a/simics-workspace/modules/afdxES/unpacket-frame.dml
+++ b/simics-workspace/modules/afdxES/unpacket-frame.dml
@@ -14,7 +14,7 @@ method init_udp_flag() {
     memset($udp_first,1,PORT_SIZE);
 }

-method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
+method unpacket_frame(uint8 *buffer,uint32 size) {
 	local uint16 dest_udp;
 	local uint16 vl;
 	local uint32 dest_ip;
@@ -38,7 +38,7 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
 	call $unpacket_ip_checksum(buffer)->(correct);		//IP checksum
     if (correct == INCORRECT) {
         log "info": "ip checksum error";
-		rx_mib.ip_checksum_filt_count++;
+		$rx_mib.ip_checksum_filt_count++;
         return;
     } else {
         if ($is_unpacket_frame_log_on) {
@@ -46,7 +46,7 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
         }
     }

-	rx_mib.rx_ip_data_count++;
+	$rx_mib.rx_ip_data_count++;
 	dest_udp =*cast((buffer + UDP_DEST_ADDR),uint16*);
 	dest_ip = *cast(buffer + IP_DEST_ADDR,uint32 *);
 	vl	= *(buffer + VL_ADDR);
@@ -93,7 +93,7 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {

 	if ($udp_first[port_id] == RECEIVE_UDP_FIRST) {
 		udp_item.udp_length = *cast(buffer + UDP_LENGTH_ADDR,uint16 *);
-		rx_mib.rx_udp_data_count++;
+		$rx_mib.rx_udp_data_count++;
 	} else {
 		udp_item.udp_length = 0;
     }
@@ -104,10 +104,10 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
 	udp_item.udp_packet_size = size - (IP_HEADER_LENGTH + MAC_HEADER_LENGTH +IPV4_LENGTH + SN_CRC_LENGTH);
 	udp_item.mf =mf;
     udp_item.dest_udp = dest_udp;
-
+	//log "info" : "udp port type %d", udp_item.port_type;
 	if (port_id >= 0 && port_id < 4096) {
 		switch (udp_item.port_type) {
-			case 0: case 1:
+			case 0: case 2:
 			    call $EnPortQueue(($port[port_id].queue),udp_item)->(result);
                 if ($is_unpacket_frame_log_on) {
                     call $print_unpacket_frame_PortQueue();
@@ -118,11 +118,12 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
 					return;
 				}
 				break;
-			case 2:
+			case 1:
 			    call $RefreshPortData(&($port[port_id]), udp_item);
                 if ($is_unpacket_frame_log_on) {
                     call $print_unpacket_frame_Refresh();
                 }
+				break;
 			default:
 			    log "error" : "Unsupported port type";
 			    break;
@@ -137,4 +138,4 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
     } else {
 		$udp_first[port_id] = 0;
     }
-}
+}
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index e8cb5c5..d943d6b 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -124,6 +124,7 @@ implement Send_To_A664{
 	method send_to_A664(int port_id,void *data,int length) {
 		$tx_regs.tx_port_id.id = port_id;
         $tx_regs.tx_frame_len.frame_len=length *4;
+
 		call $wrapped_frame(cast(data,uint8*), length *4);
 	}
 }
@@ -188,7 +189,7 @@ implement ieee_802_3_mac {
             if ($is_ieee_802_3_log_on) {
                 call $print_ieee_802_3_mac_rm();
             }
-            call $unpacket_frame(data, size)->($rx_mib);
+            call $unpacket_frame(data, size);
         } else {
             log "error" : "Send from unkown network";
         }
@@ -212,11 +213,11 @@ attribute record_mib_cycle {

 method record_mib() {
     write_mid(&($maca_mib),&($macb_mib) ,&($rx_mib), &($tx_mib));
-
+    $afdxES.transmit_runtime_info_between_afdxES_and_afdxES2.transmit_mib_info(&($maca_mib), &($macb_mib), &($rx_mib), &($tx_mib));
     after ($record_mib_cycle)
         call $record_mib();

-    $afdxES.transmit_runtime_info_between_afdxES_and_afdxES2.transmit_mib_info(&$maca_mib, &$macb_mib, &$rx_mib, &$tx_mib);
+
 }

 method post_init() {
diff --git a/simics-workspace/modules/afdxES2/checksum.dml b/simics-workspace/modules/afdxES2/checksum.dml
index b26d763..f91e2b3 100644
--- a/simics-workspace/modules/afdxES2/checksum.dml
+++ b/simics-workspace/modules/afdxES2/checksum.dml
@@ -71,8 +71,8 @@ method receive_udp_check_sum(PortQueue* queue)->(bool result) {
     call $part_udp_check_sum(checksum_data,
                              port_item.size,sum)
         ->(new_udp_checksum);
-    log "info" : "new_udp_checksum =%x", new_udp_checksum;
-    log "info" : "new_udp_checksum =%x", old_udp_checksum;
+//    log "info" : "new_udp_checksum =%x", new_udp_checksum;
+//    log "info" : "new_udp_checksum =%x", old_udp_checksum;
     if (new_udp_checksum != old_udp_checksum) {
         result = false;
     } else {
@@ -135,8 +135,8 @@ method unpacket_ip_checksum(uint8 *buffer)->(uint8 correct) {
 	buffer[IP_CHECKSUM_ADDR+1]=0;

 	call $ip_check_sum(ip_header_addr, IP_HEADER_LENGTH) -> (new_ip_checksum);
-	log "info" : "2	new_ip_checksum =%x", new_ip_checksum;
-	log "info" : "2	old_ip_checksum =%x", old_ip_checksum;
+//	log "info" : "2	new_ip_checksum =%x", new_ip_checksum;
+//	log "info" : "2	old_ip_checksum =%x", old_ip_checksum;
     if(new_ip_checksum != old_ip_checksum) {
 		correct = INCORRECT;
     } else {
@@ -205,7 +205,7 @@ method crc_check(uint8 *data,uint32 size,uint32* table) {
 	crc1 = cast(data+size-4,uint32*);
 	STORE_BE32(&crc_value_temp,crc_value);
 	*crc1 = crc_value_temp;
-	log "info": "crc=%x.",*crc1;
+	//log "info": "crc=%x.",*crc1;
 }

 method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check) {
@@ -226,7 +226,7 @@ method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check) {
 	STORE_BE32(&crc_value_temp,crc_value);
 	new_crc = crc_value_temp;

-	log "info": "new_crc=%x,old_crc=%x.",new_crc,old_crc;
+//	log "info": "new_crc=%x,old_crc=%x.",new_crc,old_crc;

 	if(old_crc == new_crc) {
 		check = true;
diff --git a/simics-workspace/modules/afdxES2/packet-description.dml b/simics-workspace/modules/afdxES2/packet-description.dml
index 62947df..0f2718f 100644
--- a/simics-workspace/modules/afdxES2/packet-description.dml
+++ b/simics-workspace/modules/afdxES2/packet-description.dml
@@ -74,8 +74,7 @@ struct Queue {

 //for port queue
-struct QueueItem
-{
+struct QueueItem {
 	uint8 *buffer;
 	int32 whole_size;
 	int32 single_size;
@@ -87,8 +86,7 @@ struct QueueItem
 	QueueItem *next;
 }

-struct UDP_Item
-{
+struct UDP_Item {
 	uint8* buffer;
 	uint32 udp_length;
 	uint32 udp_packet_size;
@@ -99,8 +97,7 @@ struct UDP_Item
 	uint2 port_type;
 }

-struct PortItem
-{
+struct PortItem {
 	uint8  *frame;
 	uint32 size;
 	uint32 dest_ip;
@@ -108,8 +105,7 @@ struct PortItem
 	uint32 dest_udp;
 }

-struct PortQueue
-{
+struct PortQueue {
 	QueueItem *head;
 	QueueItem *tail;
 	int32 item_length;
@@ -118,59 +114,56 @@ struct PortQueue
 }

 // for MIB
-struct MAC_MIB
-{
-		uint32 crc_error;   				//crc checksum error
-		uint32 delete_little_64;  			//delete the frame that size is little than 64B
-		uint32 delete_big_1518;   			//delete the frame that size is bigger than 1518B
-		uint32 input_frame_count;  			// input frame count
-		uint32 input_64_127_count;			//input frame size between 64 and 127
-		uint32 input_128_255_count;			//input frame size between 128 and 255
-		uint32 input_256_511_count;			//input frame size between 256 and 511
-		uint32 input_512_1023_count;		//input frame size between 512 and 1023
-		uint32 input_1024_1518_count;		//input frame size between 1024 and 1023
-		uint32 input_frame_byte_count; 		// input frame byte count
-		uint32 output_frame_count;  		// output frame byte count
-		uint32 output_64_127_count;			//output frame size between 64 and 127
-		uint32 output_128_255_count;		//output frame size between 128 and 255
-		uint32 output_256_511_count;		//output frame size between 256 and 511
-		uint32 output_512_1023_count;		//output frame size between 512 and 1023
-		uint32 output_1024_1518_count;		//output frame size between 1024 and 1023
-		uint32 output_frame_byte_count;  	// output frame byte count
-		uint32 first_bit_error_count;		//first bit error
-		uint32 ipchecksum_error_count;		//ip checksum error
-		uint32 delete_bit_2048_count;		//delete the frame bigger than 2048
+struct MAC_MIB {
+	uint32 crc_error;					//crc checksum error
+	uint32 delete_little_64;			//delete the frame that size is little than 64B
+	uint32 delete_big_1518;				//delete the frame that size is bigger than 1518B
+	uint32 input_frame_count;			// input frame count
+	uint32 input_64_127_count;			//input frame size between 64 and 127
+	uint32 input_128_255_count;			//input frame size between 128 and 255
+	uint32 input_256_511_count;			//input frame size between 256 and 511
+	uint32 input_512_1023_count;		//input frame size between 512 and 1023
+	uint32 input_1024_1518_count;		//input frame size between 1024 and 1023
+	uint32 input_frame_byte_count;		// input frame byte count
+	uint32 output_frame_count;			// output frame byte count
+	uint32 output_64_127_count;			//output frame size between 64 and 127
+	uint32 output_128_255_count;		//output frame size between 128 and 255
+	uint32 output_256_511_count;		//output frame size between 256 and 511
+	uint32 output_512_1023_count;		//output frame size between 512 and 1023
+	uint32 output_1024_1518_count;		//output frame size between 1024 and 1023
+	uint32 output_frame_byte_count;		// output frame byte count
+	uint32 first_bit_error_count;		//first bit error
+	uint32 ipchecksum_error_count;		//ip checksum error
+	uint32 delete_bit_2048_count;		//delete the frame bigger than 2048
 }

-struct RX_MIB
-{
-		uint32 disable_A_filt_count;
-		uint32 disable_B_filt_count;
-		uint32 A_integrated_filt_count;
-		uint32 B_integrated_filt_count;
-		uint32 vl_id_filt_count;
-		uint32 redunt_filt_count;
-		uint32 port_filt_count;
-	   	uint32 ip_checksum_filt_count;
-		uint32 ip_length_error_filt_count;
-		uint32 udp_length_error_filt_count;
-		uint32 ip_fragment_error_filt_count ;
-		uint32 overflow_count;
-		uint32 rx_icmp_reback_count;
-		uint32 rx_ip_data_count;
-		uint32 rx_udp_data_count;
-	    uint32 rx_icmp_data_count;
-		uint32 icmp_overflow_count;
-		uint32 rx_icmp_big_max_count;
-		uint32 rx_buffer_clear_delete_count;
-		uint32 size;
+struct RX_MIB {
+	uint32 disable_A_filt_count;
+	uint32 disable_B_filt_count;
+	uint32 A_integrated_filt_count;
+	uint32 B_integrated_filt_count;
+	uint32 vl_id_filt_count;
+	uint32 redunt_filt_count;
+	uint32 port_filt_count;
+	uint32 ip_checksum_filt_count;
+	uint32 ip_length_error_filt_count;
+	uint32 udp_length_error_filt_count;
+	uint32 ip_fragment_error_filt_count ;
+	uint32 overflow_count;
+	uint32 rx_icmp_reback_count;
+	uint32 rx_ip_data_count;
+	uint32 rx_udp_data_count;
+	uint32 rx_icmp_data_count;
+	uint32 icmp_overflow_count;
+	uint32 rx_icmp_big_max_count;
+	uint32 rx_buffer_clear_delete_count;
+	uint32 size;
 }

-struct TX_MIB
-{
-		uint32 tx_ip_count;
-		uint32 tx_udp_count;
-		uint32 tx_icmp_count;
+struct TX_MIB {
+	uint32 tx_ip_count;
+	uint32 tx_udp_count;
+	uint32 tx_icmp_count;
 }

diff --git a/simics-workspace/modules/afdxES2/port-queue.dml b/simics-workspace/modules/afdxES2/port-queue.dml
index e284fa1..336198a 100644
--- a/simics-workspace/modules/afdxES2/port-queue.dml
+++ b/simics-workspace/modules/afdxES2/port-queue.dml
@@ -158,7 +158,7 @@ method IsPortQueueEmpty(PortQueue *queue) -> (bool result) {
 }

 method RefreshPortData(Receive_Port *port, UDP_Item udp_item) {
-	port->port_type = 2;
+	port->port_type = 1;

 	if (port->frame != NULL) {
 		dbuffer_free(port->dbuf);
diff --git a/simics-workspace/modules/afdxES2/rm-handler.dml b/simics-workspace/modules/afdxES2/rm-handler.dml
index 3bb65a0..33e4fcf 100644
--- a/simics-workspace/modules/afdxES2/rm-handler.dml
+++ b/simics-workspace/modules/afdxES2/rm-handler.dml
@@ -41,28 +41,30 @@ method RM_Handler(RM_INFO *rm_info, uint8 interface_id, uint8 frame_sn) -> (bool
     } else {
         rm_info->B_Interface_ID = 0;
     }
-
-    if (interface_id != rm_info->A_Interface_ID) {
-        $rx_mib.disable_A_filt_count++;
-    }
-
-    if (interface_id != rm_info->B_Interface_ID) {
-        $rx_mib.disable_B_filt_count++;
+	if (interface_id == rm_info->A_Interface_ID) {
+            call $mib_in_sum(&($maca_mib), rm_info->frame_size);
+    } else if (interface_id == rm_info->B_Interface_ID) {
+            call $mib_in_sum(&($macb_mib), rm_info->frame_size);
     }

     if ((frame_sn == $recv_vl[rm_info->rm_index].expect_sn) &&
         ((interface_id == rm_info->A_Interface_ID) ||
          (interface_id == rm_info->B_Interface_ID))) {
-        $rx_mib.size = rm_info->frame_size;
+        $rx_mib.size += rm_info->frame_size;
         $recv_vl[rm_info->rm_index].expect_sn++;
         $recv_vl[rm_info->rm_index].expect_sn %= 256;
-        if (interface_id == rm_info->A_Interface_ID) {
-            call $mib_in_sum(&($maca_mib), rm_info->frame_size);
-        } else if (interface_id == rm_info->B_Interface_ID) {
-            call $mib_in_sum(&($macb_mib), rm_info->frame_size);
-        }
+
         result = true;
     } else {
+		if(interface_id == rm_info->A_Interface_ID) {
+			 $rx_mib.disable_A_filt_count++;
+			 $rx_mib.redunt_filt_count++;
+		}
+		if(interface_id == rm_info->B_Interface_ID) {
+			 $rx_mib.disable_B_filt_count++;
+			 $rx_mib.redunt_filt_count++;
+		}
+
         result = false;
     }
 }
diff --git a/simics-workspace/modules/afdxES2/unpacket-frame.dml b/simics-workspace/modules/afdxES2/unpacket-frame.dml
index 058403f..9e3a09f 100644
--- a/simics-workspace/modules/afdxES2/unpacket-frame.dml
+++ b/simics-workspace/modules/afdxES2/unpacket-frame.dml
@@ -14,7 +14,7 @@ method init_udp_flag() {
     memset($udp_first,1,PORT_SIZE);
 }

-method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
+method unpacket_frame(uint8 *buffer,uint32 size) {
 	local uint8 correct;
 	local uint16 dest_udp;
 	local uint16 vl;
@@ -37,14 +37,14 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
 	call $unpacket_ip_checksum(buffer)->(correct);		//IP checksum
 	if (correct == INCORRECT) {
 		log "info": "ip checksum error!";
-		rx_mib.ip_checksum_filt_count++;
+		$rx_mib.ip_checksum_filt_count++;
 		return ;
 	} else {
         if ($is_unpacket_frame_log_on) {
             call $print_unpacket_frame_ip_checksum();
         }
 	}
-	rx_mib.rx_ip_data_count++;
+	$rx_mib.rx_ip_data_count++;
 	dest_udp =*cast((buffer + UDP_DEST_ADDR),uint16*);

     dest_ip = *cast(buffer + IP_DEST_ADDR,uint32 *);
@@ -90,7 +90,7 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {

 	if ($udp_first[port_id] == RECEIVE_UDP_FIRST) {
 		udp_item.udp_length = *cast(buffer + UDP_LENGTH_ADDR,uint16 *);
-		rx_mib.rx_udp_data_count++;
+		$rx_mib.rx_udp_data_count++;
 	} else {
 		udp_item.udp_length = 0;
     }
@@ -106,7 +106,7 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {

 	if (port_id >= 0 && port_id < 4096) {
 		switch (udp_item.port_type) {
-			case 0: case 1:
+			case 0: case 1: case 2:
 			    call $EnPortQueue(($port[port_id].queue),udp_item)->(result);
                 if ($is_unpacket_frame_log_on) {
                     call $print_unpacket_frame_PortQueue();
@@ -115,11 +115,13 @@ method unpacket_frame(uint8 *buffer,uint32 size)->(RX_MIB rx_mib) {
 					log "info": "port queue is full";
 				}
 				break;
+			/*
 			case 2:
 			    call $RefreshPortData(&($port[port_id]), udp_item);
                 if ($is_unpacket_frame_log_on) {
                     call $print_unpacket_frame_Refresh();
                 }
+			*/
 			default:
 			    log "error" : "Unsupported port type";
 			    break;
diff --git a/simics-workspace/modules/RDC/op_429_card.c b/simics-workspace/modules/RDC/op_429_card.c
index ea20b13..fa54a05 100644
--- a/simics-workspace/modules/RDC/op_429_card.c
+++ b/simics-workspace/modules/RDC/op_429_card.c
@@ -1,6 +1,7 @@
 #include <op_429_card.h>
+#include <untils.h>

-#define __DEBUG__
+//#define __DEBUG__

 static A429Handle board;

@@ -169,28 +170,39 @@ static void init_channel_state(const A429Handle *board, const channel_conf_t* co
 }
 #endif

+static uint64_t get_serialNumber(void) {
+    FILE* fp;
+    char lineBuf[129];
+    char* delim = ":";  //分隔符为：空格
+    int num = 0;    //文件中总的字符串个数
+    int count = 0;  //一行中的字符串个数
+
+    char** dest  = (char**)calloc(2, sizeof(char*));
+
+    int i = 0;
+    for (; i < 2; ++i) {
+        dest[i] = (char*)calloc(64, sizeof(char));
+    }
+    char** tmpDest = dest;
+
+    if (NULL != (fp = fopen("test.txt", "r"))) {
+        while(fgets(lineBuf, 128, fp) != NULL) {
+            split(lineBuf, delim, tmpDest, &count);
+            num  = num + count;
+            tmpDest += count;
+        }
+    }
+    fclose(fp);
+
+    return dest[1];
+}
+
 #ifndef __DEBUG__
 void init_429_middleware(void) {
-    uint64_t aSerialNumber = 0; /* How to get? */
+    uint64_t aSerialNumber = get_serialNumber();
+
     board = init_board(aSerialNumber);
     init_channel_state(&board, g_channel_conf, MAX_CHANNELS);
-/*
-    char *header = "Hwa";
-    char *name = "TestProgram";
-    int type = 0;
-    int nflag = 0;
-    char *description = "TestProgram init OK";
-
-    char buf[1000];
-    int len = sizeof(type) + strlen(name) + 1 + sizeof(nflag) + strlen(description) + 1;
-    memcpy(buf, header, strlen(header) + 1);
-    memcpy(buf + strlen(header) + 1, &len, sizeof(len));
-    memcpy(buf + strlen(header) + 1 + sizeof(len), name, strlen(name) + 1);
-    memcpy(buf + strlen(header) + 1 + sizeof(len) + strlen(description) + 1, &nflag, sizeof(nflag));
-    memcpy(buf + strlen(header) + 1 + sizeof(len) + strlen(description) + 1 + sizeof(nflag), description, strlen(description) + 1);
-
-    socket_send(buf, len + 8);
-*/
 }
 #else
 void init_429_middleware(void) {
diff --git a/simics-workspace/modules/RDC/untils.c b/simics-workspace/modules/RDC/untils.c
index 032e4aa..593ecdc 100644
--- a/simics-workspace/modules/RDC/untils.c
+++ b/simics-workspace/modules/RDC/untils.c
@@ -9,3 +9,39 @@ int netStrlen(char *str) {
 int Strlen(char *str) {
     return strlen(str) + 1;
 }
+
+/*
+@in, str: 待分割的字符串
+@in, delim: 分隔符字符串
+@in_out, dest: 保存分割后的每个字符串，设为char**的引用，即表示可修改其值
+@out, pCount: 记录一行中分割所得字符串的个数
+*/
+
+void split(char *str, char *delim, char **dest, int *pCount) {
+    char *tmp;
+    *pCount = 0;
+
+    if (NULL == str || 0 == strlen(str)) {
+        return;
+    }
+
+    if (NULL == delim || 0 == strlen(str)) {
+        return;
+    }
+
+    tmp = strtok(str, delim);
+    while (tmp != NULL) {
+        int j = 0;
+        for (; tmp[j] != '\0'; ++j) {
+            if (tmp[j] == '\n') {
+                break;
+            }
+            (*dest)[j] = tmp[j];
+        }
+        (*dest)[j] = '\0';
+        ++dest;
+        (*pCount)++;
+
+        tmp = strtok(NULL, delim);
+    }
+}
diff --git a/simics-workspace/modules/RDC/untils.h b/simics-workspace/modules/RDC/untils.h
index c7e10ea..214bfa4 100644
--- a/simics-workspace/modules/RDC/untils.h
+++ b/simics-workspace/modules/RDC/untils.h
@@ -4,5 +4,6 @@
 extern int Strlen(char *str);
 extern int netStrlen(char *str);
 extern void set_runtime_header(void *p);
+extern void split(char *str, char *delim, char **dest, int *pCount);

 #endif
diff --git a/simics-workspace/modules/afdxES/afdxES.dml b/simics-workspace/modules/afdxES/afdxES.dml
index 6790ad2..791113b 100644
--- a/simics-workspace/modules/afdxES/afdxES.dml
+++ b/simics-workspace/modules/afdxES/afdxES.dml
@@ -137,7 +137,7 @@ implement ieee_802_3_mac {
             }
             call $unpacket_frame(data, size);
         } else {
-			log "error" : "Send from unkown network";
+			// log "error" : "Send from unkown network";
         }
 	}
 }
diff --git a/simics-workspace/modules/afdxES/constant.dml b/simics-workspace/modules/afdxES/constant.dml
index ac4cc11..a35b635 100644
--- a/simics-workspace/modules/afdxES/constant.dml
+++ b/simics-workspace/modules/afdxES/constant.dml
@@ -67,7 +67,7 @@ constant PORT_DATA_SIZE = 8192;
 constant PORT_FIFO_SIZE = 65535;
 constant PORT_ITEM_NUM  = 2622;
 constant PORT_ITEM_SIZE = 8096;
-constant PORT_QUEUE_MAX_SIZE = 64*1024;
+constant PORT_QUEUE_MAX_SIZE = 10* 1024 * 1024;

 // for send vl
 constant SEND_VL_NUM = 128;
@@ -87,4 +87,3 @@ constant PORT_CACHE_MAXSIZE =10* 1024 * 1024;
 // for mib
 constant MACA_MIB_CONFIG = 1;
 constant MACB_MIB_CONFIG = 2;
-
diff --git a/simics-workspace/modules/afdxES/tomiddleware.c b/simics-workspace/modules/afdxES/tomiddleware.c
index f4b8ae8..3b6b8a9 100644
--- a/simics-workspace/modules/afdxES/tomiddleware.c
+++ b/simics-workspace/modules/afdxES/tomiddleware.c
@@ -1,6 +1,6 @@
 #include "tomiddleware.h"

-#define __DEBUG__
+//#define __DEBUG__

 SOCKET client_socket;
 #define MAX_RECV_PORTS 128
diff --git a/simics-workspace/modules/afdxES2/afdxES2.dml b/simics-workspace/modules/afdxES2/afdxES2.dml
index d943d6b..cfb1a6e 100644
--- a/simics-workspace/modules/afdxES2/afdxES2.dml
+++ b/simics-workspace/modules/afdxES2/afdxES2.dml
@@ -191,7 +191,7 @@ implement ieee_802_3_mac {
             }
             call $unpacket_frame(data, size);
         } else {
-            log "error" : "Send from unkown network";
+            // log "error" : "Send from unkown network";
         }
     }