diff --git a/simics-workspace/modules/afdxES/mib_info.dml b/simics-workspace/modules/afdxES/mib_info.dml
old mode 100755
new mode 100644
diff --git a/simics-workspace/modules/afdxES/port-cache.dml b/simics-workspace/modules/afdxES/port-cache.dml
index 276064b..9bd1615 100644
--- a/simics-workspace/modules/afdxES/port-cache.dml
+++ b/simics-workspace/modules/afdxES/port-cache.dml
@@ -25,7 +25,7 @@ data Port_Cache *PortCache[PORT_SIZE];
 method Init_Port_Cache() {
     local uint32 i = 0;
     for (; i < PORT_SIZE; ++i) {
-        call InitPortCache() -> ($PortCache[i]);
+        call $InitPortCache() -> ($PortCache[i]);
     }
 }

diff --git a/simics-workspace/modules/afdxES/tomiddleware.dml b/simics-workspace/modules/afdxES/tomiddleware.dml
index d251d6d..908b4b4 100644
--- a/simics-workspace/modules/afdxES/tomiddleware.dml
+++ b/simics-workspace/modules/afdxES/tomiddleware.dml
@@ -58,14 +58,16 @@ method Recv_Data_From_664_Middleware_Loop_Event() {
     if (length > 0) {
         call $Handle_664_Data(buf, length);
     }
-
-    after (1) call $Recv_Data_From_664_Middleware_Loop_Event();
+
+    delete buf;
+    after (0.000001) call $Recv_Data_From_664_Middleware_Loop_Event();
 }

 method init_middleware_mode() {
     if ($middleware_mode == To664Middleware) {
         Init_664_Work_Mode();
         call $Recv_Data_From_664_Middleware_Loop_Event();
+        call $Init_Port_Cache();
     }
 }

@@ -110,6 +112,8 @@ method LoadCfgTo664Middleware() {

     data_type = DO_LOAD_CONF;
     Send_To_664_Middleware(cast(&data_type, uint8*), CFG_TYPE_SIZE);
+
+    Recv_Data_From_664_Middleware(cast(&data_type, uint8*), CFG_TYPE_SIZE);
 }

 method Send_Payload_To_664_Middleware(uint8 *data, uint32 port_id, uint32 length) {
diff --git a/simics-workspace/modules/myhello-component/Makefile b/simics-workspace/modules/myhello-component/Makefile
deleted file mode 100644
index 37857be..0000000
--- a/simics-workspace/modules/myhello-component/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-#                                                              -*- Makefile -*-
-# Simics module makefile
-#
-
-SIMICS_API := 4.6
-THREAD_SAFE:=yes
-SRC_FILES = myhello_component.py
-
-include $(MODULE_MAKEFILE)
diff --git a/simics-workspace/modules/myhello-component/myhello_component.py b/simics-workspace/modules/myhello-component/myhello_component.py
deleted file mode 100644
index 09f1e97..0000000
--- a/simics-workspace/modules/myhello-component/myhello_component.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# MODULE: myhello-component
-# COMPONENT: myhello_component
-
-# empty_component.py - sample code for a Simics configuration component
-# Use this file as a skeleton for your own component implementations.
-
-from comp import *
-
-class myhello_component(StandardConnectorComponent):
-    """The empty component class."""
-    _class_desc = "empty component"
-    _help_categories = ()
-
-    def setup(self):
-        StandardConnectorComponent.setup(self)
-        if not self.instantiated.val:
-            self.add_objects()
-
-    def add_objects(self):
-        # TODO: replace the example pci-bus connector with relevant connectors
-        self.add_connector('pci_bus', PciBusUpConnector(0, 'afdxES'))
-        afdxES = self.add_pre_obj('afdxES', 'afdxES')
-        afdxES2 = self.add_pre_obj('afdxES2', 'afdxES2')
-        RDC = self.add_pre_obj('rtc_module', 'rtc_module')
-        afdxES2.RDC = RDC
-        RDC.ARINC664_2 = afdxES2
-        RDC.LoadCfg = afdxES2
-        afdxES.phyA = afdxES2
-        afdxES2.phyA = afdxES
-        afdxES.phyB = afdxES2
-        afdxES2.phyB = afdxES
-        #afdxES.mode = 1
-
-    class component_connector(Interface):
-        def get_check_data(self, cnt):
-            return []
-        def get_connect_data(self, cnt):
-            return [[[0, self._up.get_slot('afdxES')]]]
-        def check(self, cnt, attr):
-            return True
-        def connect(self, cnt, attr):
-            self._up.get_slot('afdxES').pci_bus = attr[1]
-        def disconnect(self, cnt):
-            self._up.get_slot('afdxES').pci_bus = None
-
-
diff --git a/simics-workspace/modules/rtc_module/Makefile b/simics-workspace/modules/rtc_module/Makefile
deleted file mode 100644
index 55204e8..0000000
--- a/simics-workspace/modules/rtc_module/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- makefile -*-
-#
-# Sample makefile for the DML device: "empty-dml-device"
-# See Simics Model Builder User Guide for more details on what to put here.
-#
-
-MODULE_CLASSES = rtc_module
-SRC_FILES = socket.c rdc_load_conf.c
-DML_FILES = rtc_module.dml
-DMLC_FLAGS = -m -I$(SIMICS_WORKSPACE)/include
-
-MODULE_LDFLAGS = -lws2_32
-
-SIMICS_API := 4.6
-THREAD_SAFE := yes
-
-ifeq ($(MODULE_MAKEFILE),)
-$(error Make sure you compile your module from the workspace directory)
-else
-include $(MODULE_MAKEFILE)
-endif
diff --git a/simics-workspace/modules/rtc_module/commands.py b/simics-workspace/modules/rtc_module/commands.py
deleted file mode 100644
index 6eedbe0..0000000
--- a/simics-workspace/modules/rtc_module/commands.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import cli
-
-class_name = 'rtc_module'
-
-#
-# ------------------------ info -----------------------
-#
-
-def get_info(obj):
-    # USER-TODO: Return something useful here
-    return []
-
-cli.new_info_command(class_name, get_info)
-
-#
-# ------------------------ status -----------------------
-#
-
-def get_status(obj):
-    # USER-TODO: Return something useful here
-    return [("Registers",
-             [("Counter", obj.regs_counter)])]
-
-cli.new_status_command(class_name, get_status)
diff --git a/simics-workspace/modules/rtc_module/config.dml b/simics-workspace/modules/rtc_module/config.dml
deleted file mode 100644
index 51a6352..0000000
--- a/simics-workspace/modules/rtc_module/config.dml
+++ /dev/null
@@ -1,131 +0,0 @@
-dml 1.2;
-
-/////////////////////////////////////  analyse_cfg_cam  begin  //////////////////////////////////////
-constant ANALYSE_CFG_CAM_MAX_SIZE = 4096;
-constant ANALYSE_CFG_RAM_MAX_SIZE = 4096;
-
-struct analyse_cfg_cam {
-    uint32 address;
-
-    bitfields 28 {
-        uint26 RETENTION                @ [27:2];   // [91:66];
-        uint1  ICMP_TYPE_ID             @ [1:1];    // [65:65];
-        uint1  MULTICAST_ID             @ [0:0];    // [64:64];
-    } cam_data_part1;
-
-    bitfields 32 {
-        uint32 DEST_IP                  @ [31:0];   // [63:32];
-    } cam_data_part2;
-
-    bitfields 32 {
-        uint16 VL                       @ [31:16];
-        uint16 DEST_UDP                 @ [15:0];
-    } cam_data_part3;
-}
-
-data analyse_cfg_cam analyse_cfg_cam_array[ANALYSE_CFG_CAM_MAX_SIZE];
-data uint32 analyse_cfg_cam_index;
-
-struct analyse_cfg_ram {
-    bitfields 11 {
-        uint6  RETENTION                @ [10:5];
-        uint1  NETWORK_B_ENABLE         @ [3:3];
-        uint1  NETWORK_A_ENABLE         @ [2:2];
-        uint2  PORT_TYPE                @ [1:0];
-    } ram_data;
-}
-
-data analyse_cfg_ram analyse_cfg_ram_array[ANALYSE_CFG_RAM_MAX_SIZE];
-/////////////////////////////////////  analyse_cfg_cam  end  //////////////////////////////////////
-
-
-
-/////////////////////////////////////  transmit_cfg_ram  begin  //////////////////////////////////////
-constant TRANSMIT_CFG_RAM_MAX_SIZE = 1024;
-
-struct transmit_cfg_ram {
-	bitfields 29 {
-	    uint8  PRIVATE_IP               @ [28:21];      // [138:131]
-	    uint2  USER_DEFINED_ID_H        @ [20:19];     // [130:129]
-		uint14 USER_DEFINED_ID_L        @ [18:5];       // [128:115]
-		uint5  PARTITION_ID             @ [4:0];       // [114: 110]
-	} ram_data_part4;
-    bitfields 44 {
-        uint6  RETENTION                @ [43:38];     // [109:104]
-        uint2  PORT_TYPE                @ [37:36];     // [103:102]
-        uint11 MIN_FRAME_LENGTH         @ [35:25];      // [101:91]
-        uint1  IP_MULTICAST             @ [24:24];     // [90:90]
-        uint8  VL_INDEX                 @ [23:16];     // [89:82]
-        uint16 VL_ID                    @ [15:0];      // [81:66]
-    } ram_data_part1;
-
-    bitfields 32 {
-        uint16 USER_DEFINED_ID          @ [31:16];     // [65:50]
-        uint8  PROTOCAL_ID              @ [15:8];      // [49:42]
-        uint3  INTERFACE_ID             @ [7:5];       // [41:39]
-        uint5  PARTITION_ID             @ [4:0];       // [38:34]
-    } ram_data_part2;
-
-    bitfields 34 {
-        uint16 SOURCE_UDP_PORT          @ [33:18];
-        uint16 DEST_UDP_PORT            @ [17:2];
-        uint2  SUB_VL_ID                @ [1:0];
-    } ram_data_part3;
-}
-
-
-data transmit_cfg_ram transmit_cfg_ram_array[TRANSMIT_CFG_RAM_MAX_SIZE];
-/////////////////////////////////////  transmit_cfg_ram  end  //////////////////////////////////////
-
-
-/////////////////////////////////////  scheduling_cfg_ram  begin  //////////////////////////////////////
-constant SCHEDULING_CFG_RAM_MAX_SIZE = 128;
-
-struct scheduling_cfg_ram {
-    uint17 BAG;
-}
-
-data scheduling_cfg_ram scheduling_cfg_ram_array[SCHEDULING_CFG_RAM_MAX_SIZE];
-/////////////////////////////////////  scheduling_cfg_ram  end  //////////////////////////////////////
-
-
-/////////////////////////////////////  rm_cfg_cam  begin  //////////////////////////////////////
-constant RM_CFG_CAM_MAX_SIZE = 256;
-constant RM_CFG_RAM_MAX_SIZE = 256;
-
-struct rm_cfg_cam {
-    uint32 address;
-    uint16 VL_ID;
-}
-
-data rm_cfg_cam rm_cfg_cam_array[RM_CFG_CAM_MAX_SIZE];
-data uint32 rm_cfg_cam_index;
-
-
-struct rm_cfg_ram {
-    bitfields 27 {
-        uint1  VL_ENABLE                @ [26:26];
-        uint21 SKEW_MAX                 @ [25:5];
-        uint1  RM_ENABLE                @ [4:4];
-        uint1  NETWORK_B_IC_ENABLE      @ [3:3];
-        uint1  NETWORK_A_IC_ENABLE      @ [2:2];
-        uint1  NETWORK_B_ENABLE         @ [1:1];
-        uint1  NETWORK_A_ENABLE         @ [0:0];
-    } ram_data;
-}
-
-data rm_cfg_ram rm_cfg_ram_array[RM_CFG_RAM_MAX_SIZE];
-/////////////////////////////////////  rm_cfg_cam  end  //////////////////////////////////////
-
-
-/////////////////////////////////////  fragment_cfg_ram  begin  //////////////////////////////////////
-constant FRAGMENT_CFG_RAM_MAX_SIZE = 1024;
-
-struct fragment_cfg_ram {
-   uint11 MAX_FRAME_LENGTH;
-}
-
-
-data fragment_cfg_ram fragment_cfg_ram_array[FRAGMENT_CFG_RAM_MAX_SIZE];
-/////////////////////////////////////  fragment_cfg_ram  end  //////////////////////////////////////
-
diff --git a/simics-workspace/modules/rtc_module/hwacfg.h b/simics-workspace/modules/rtc_module/hwacfg.h
deleted file mode 100644
index afd1e4c..0000000
--- a/simics-workspace/modules/rtc_module/hwacfg.h
+++ /dev/null
@@ -1,74 +0,0 @@
-
-#ifndef __HWA_CFG_H__
-#define __HWA_CFG_H__
-
-
-typedef struct
-{
-	unsigned short vlNum;
-	unsigned short bag;
-	unsigned short period;
-	unsigned short offset;
-
-	//unsigned long  dstIP;
-	unsigned short vl_use;
-	unsigned short RTC_period;
-
-	unsigned short netSelect;
-	unsigned short subvlTotal;
-
-	unsigned short allow_redu;
-	//unsigned short fragAble;
-	//unsigned short allow_slice;
-	unsigned short back0;
-
-	//unsigned short fragLen;
-	unsigned short maxLen;
-	unsigned short minLen;
-}SENDVL_STRUCT_t;
-
-typedef struct
-{
-	unsigned short vlNum;
-	unsigned short skewMax;
-	unsigned short redundantAble;
-	unsigned short integrityAble;
-
-	//unsigned long  dstIP;
-	unsigned short vl_use;
-	unsigned short back0;
-
-	//unsigned long  blank;
-	unsigned short back1;
-	unsigned short back2;
-}REVVL_STRUCT_t;
-
-typedef struct
-{
-	unsigned short maxlen;
-	unsigned short echoVlNum;
-	unsigned short replyVlNum;
-	unsigned short replySubVlNum;
-	//  unsigned short udpSrcPort;
-	//by wj 100226 unsigned short udpDstIPemp;
-	unsigned int udpDstIPemp;
-	unsigned int blank1;
-}ICMP_STRUCT_t;
-
-typedef struct
-{
-	unsigned short flag;
-	unsigned short blank1;
-	unsigned short sendvl_num;
-	unsigned short revvl_num;
-	unsigned short domain;
-	unsigned short side;
-	unsigned short position;
-	unsigned short blank2;
-
-	SENDVL_STRUCT_t sendVlSet[128];
-	REVVL_STRUCT_t recvVlSet[256];
-	ICMP_STRUCT_t IcmpSet[16];
-}HWACFG_STRUCT_t;
-
-#endif /* __HWA_CFG_H__ */
diff --git a/simics-workspace/modules/rtc_module/rdc_load_conf.c b/simics-workspace/modules/rtc_module/rdc_load_conf.c
deleted file mode 100644
index 2585e7e..0000000
--- a/simics-workspace/modules/rtc_module/rdc_load_conf.c
+++ /dev/null
@@ -1,570 +0,0 @@
-// filetest.cpp : ¶¨Òå¿ØÖÆ̨ӦÓóÌÐòµÄÈë¿ڵ㡣
-//
-
-#include <stdio.h>
-#include <malloc.h>
-#include <memory.h>
-#include "hwacfg.h"
-#include "softcfg.h"
-
-typedef struct
-{
-	char version[16];
-	char SqlName[32];
-	char cfgDate[16];
-}CFG_HEADER_STRUCT_t;
-
-#define SOFT_CFG_OFFSET 0x1E10
-#define HARD_CFG_SIZE   0x1D10
-
-CFG_HEADER_STRUCT_t cfg_header;
-HWACFG_STRUCT_t     cfg_hwa;
-SOFTCFG_STRUCT_t    cfg_soft;
-
-SEND_UDP_STRUCT_t *pSendUdpCfg;
-RECV_UDP_STRUCT_t *pRecvUdpCfg;
-unsigned int nSendUdpCfgCnt;
-unsigned int nRecvUdpCfgCnt;
-
-#define A429_CHANNEL_SIZE  16
-#define A429_LABEL_NUM  256
-
-
-
-A429_TO_UDP_ARRAY A429ToUdpArry;
-A429_TO_A429_ARRAY A429To429Arry;
-/*A429TOA429_STRUCT_t        nA429ToA429[A429_CHANNEL_SIZE][A429_LABEL_NUM];*/
-
-
-AUDPTOA429_STRUCT_t nUdpTo429[0x10000];
-
-AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-int AfdxFrameBlockNum;
-
-SEND_UDP_STRUCT_t * getSendUdpCfg()
-{
-	return pSendUdpCfg;
-}
-
-RECV_UDP_STRUCT_t * getRecvUdpCfg()
-{
-	return pRecvUdpCfg;
-}
-
- int getSendUdpCnt()
-{
-	return nSendUdpCfgCnt;
-}
-
- int getRecvUdpCnt()
-{
-	return nRecvUdpCfgCnt;
-}
-
-int getAfdxFrameBlockNum()
-{
-	return AfdxFrameBlockNum;
-}
-A429_TO_A429_ARRAY* GetnA429ToA429()
-{
-	return &A429To429Arry;
-}
-
-A429_TO_UDP_ARRAY* GetnA429ToAudp()
-{
-	return &A429ToUdpArry;
-}
-
-AFDXFRAME_STRUCT_t *getpAfdxFrameBlock()
-{
-	return pAfdxFrameBlock;
-}
-
-AUDPTOA429_STRUCT_t* GetnUdpTo429()
-{
-    return &nUdpTo429;
-}
-
-HWACFG_STRUCT_t *GetHwaCfg()
-{
-	return &cfg_hwa;
-}
-
-int ReadHwaCfg(FILE *fp)
-{
-	int nReadCnt=0;
-	int nHwaHeadSize = 0;
-	int nHwaSendVlSize = 0;
-	int nHwaRecvVlSize = 0;
-	int nHwaIcmpSize = 0;
-	char buf[0x1D10] = {0};
-	//fseek(fp,0x100, SEEK_SET);
-	rewind(fp);
-	fseek(fp,0x100, SEEK_SET);
-	nReadCnt = fread(buf,sizeof(char),0x1D10,fp);
-
-	nHwaHeadSize = 8* sizeof(unsigned short);
-	memcpy(&cfg_hwa,buf,nHwaHeadSize);
-
-	nHwaSendVlSize = 128*sizeof(SENDVL_STRUCT_t);
-	memcpy(cfg_hwa.sendVlSet,buf+nHwaHeadSize,nHwaSendVlSize);
-
-	nHwaRecvVlSize = 256*sizeof(REVVL_STRUCT_t);
-	memcpy(cfg_hwa.recvVlSet,buf+nHwaHeadSize+nHwaSendVlSize,nHwaRecvVlSize);
-
-	nHwaIcmpSize = 16*sizeof(ICMP_STRUCT_t);
-	memcpy(cfg_hwa.IcmpSet,buf+nHwaHeadSize+nHwaSendVlSize+nHwaRecvVlSize,nHwaIcmpSize);
-
-
-	return 0;
-}
-
-int ReadSoftCfg(FILE *fp)
-{
-	int nReadCnt=0;
-	int nRet;
-	unsigned char buf[16] = {0};
-	int ret = 0;
-	int i=0,j=0,k=0;
-	unsigned int nLabelBaseAddr;
-
-	int nA429ChannelNum;
-
-	A429_STRUCT_t     *pA429Cfg;
-	unsigned int nA429CfgCnt;
-
-	ALABEL_STRUCT_t  *pAlabelCfg;
-	unsigned int nAlabelCfgCnt;
-
-	ALABEL_STRUCT_t *pAlabel;
-	nFrameR * pFrameR;
-	unsigned int softLen=0;
-	int nFileOffset;
-	rewind(fp);
-	fseek(fp,SOFT_CFG_OFFSET, SEEK_SET);
-	ret = sizeof(SOFTCFG_STRUCT_t);
-	nReadCnt = fread(buf,sizeof(char),ret,fp);
-	memcpy(&cfg_soft,buf,ret);
-	softLen += nReadCnt;
-    nSendUdpCfgCnt = cfg_soft.nSendUdpNum;
-    nRecvUdpCfgCnt = cfg_soft.nRecvUdpNum;
-	/*read send udp cfg*/
-	rewind(fp);
-	fseek(fp,SOFT_CFG_OFFSET+cfg_soft.nSendUdpCfgOffset, SEEK_SET);
-	long fileoffset=ftell(fp);
-	ret = cfg_soft.nSendUdpNum*sizeof(SEND_UDP_STRUCT_t);
-	pSendUdpCfg = (SEND_UDP_STRUCT_t *)malloc(cfg_soft.nSendUdpNum*sizeof(SEND_UDP_STRUCT_t));
-	nReadCnt = fread(pSendUdpCfg,sizeof(SEND_UDP_STRUCT_t),cfg_soft.nSendUdpNum,fp);
-	softLen += nReadCnt;
-	fileoffset=ftell(fp);
-	nRet=feof(fp);
-	pAfdxFrameBlock = (AFDXFRAME_STRUCT_t *)malloc(cfg_soft.nSendUdpNum*sizeof(AFDXFRAME_STRUCT_t));
-	AfdxFrameBlockNum = cfg_soft.nSendUdpNum;
-	/*read recv udp cfg*/
-	rewind(fp);
-	fseek(fp,SOFT_CFG_OFFSET+cfg_soft.nRecvUdpCfgOffset, SEEK_SET);
-	ret = sizeof(RECV_UDP_STRUCT_t);
-	pRecvUdpCfg = (RECV_UDP_STRUCT_t *)malloc(cfg_soft.nRecvUdpNum*sizeof(RECV_UDP_STRUCT_t));
-	nReadCnt = fread(pRecvUdpCfg,sizeof(char),cfg_soft.nRecvUdpNum*sizeof(RECV_UDP_STRUCT_t),fp);
-	softLen += nReadCnt;
-
-	/*read  A429 cfg*/
-	rewind(fp);
-	fseek(fp,SOFT_CFG_OFFSET+cfg_soft.n429PortCfgOffset, SEEK_SET);
-	ret = cfg_soft.n429PortNum*sizeof(A429_STRUCT_t);
-	pA429Cfg = (A429_STRUCT_t *)malloc(20*20*sizeof(A429_STRUCT_t));
-	nReadCnt = fread(pA429Cfg,sizeof(char),cfg_soft.n429PortNum*sizeof(A429_STRUCT_t),fp);
-	softLen += nReadCnt;
-
-	nLabelBaseAddr = SOFT_CFG_OFFSET+cfg_soft.n429PortCfgOffset+20*20*sizeof(A429_STRUCT_t);
-	for (i=0;i<cfg_soft.nSendUdpNum;i++)
-	{
-		rewind(fp);
-		nFileOffset =nLabelBaseAddr + pSendUdpCfg[i].nLabelOffset;
-		fseek(fp,nFileOffset, SEEK_SET);
-		pAlabel = (ALABEL_STRUCT_t *)malloc(sizeof(ALABEL_STRUCT_t));
-		nReadCnt = fread(pAlabel,sizeof(char),sizeof(ALABEL_STRUCT_t),fp);
-
-		for(j=0;j<256;j++)
-		{
-			if(pAlabel->nLabelMap[j/32]&(1<<(j%32)))
-			{
-				printf("%03d_",j);
-				if (pSendUdpCfg[i].nA429RecvChannel > 20)
-				{
-					printf("Channel err!\n");
-				}
-				if (pSendUdpCfg[i].nA429RecvChannel > 16)
-				{
-					//printf("Channel not support:0x%x!i:%x\n",pSendUdpCfg[i].nA429RecvChannel,i);
-					continue;
-				}
-                nA429ChannelNum = pSendUdpCfg[i].nA429RecvChannel;
-				A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].nUsed += 1;
-				if (A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].nUsed==1)
-				{
-					A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR = (nFrameR *)malloc(sizeof(nFrameR));
-					A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR->pA429ToUdp = &pSendUdpCfg[i];
-					A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR->pAlabel = pAlabel;
-					A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR->pNext = NULL;
-                    A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR->nPortId = i;
-                   #if 0
-					for (k=0;k<128;k++)
-					{
-						if ((A429ToUdpArry.nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].pFrameR->pA429ToUdp->nSubVlIndex >> 2) == cfg_hwa.sendVlSet[k].vlNum)
-						{
-							A429ToUdpArry.nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].pFrameR->pSendVl  = &cfg_hwa.sendVlSet[k];
-						}
-					}
-                    #endif
-				}else{
-					pFrameR = (nFrameR *)malloc(sizeof(nFrameR));
-					pFrameR->pNext = A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR;
-					pFrameR->pA429ToUdp = &pSendUdpCfg[i];
-					pFrameR->pAlabel = pAlabel;
-                    pFrameR->nPortId  = i;
-					#if 0
-                    for (k=0;k<128;k++)
-					{
-						if ((A429ToUdpArry.nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].pFrameR->pA429ToUdp->nSubVlIndex >> 2) == cfg_hwa.sendVlSet[k].vlNum)
-						{
-							pFrameR->pSendVl  = &cfg_hwa.sendVlSet[k];
-						}
-					}
-                    #endif
-					A429ToUdpArry.nA429ToUdp[nA429ChannelNum][j].pFrameR = pFrameR;
-				}
-
-
-// 				nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].nA429ToUdp = pSendUdpCfg[cfg_soft.nSendUdpNum];
-// 				nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].nHeadLabel = pAlabel->nHeadLabel;
-// 				nA429ToUdp[pSendUdpCfg[i].nA429RecvChannel][j].nHeadLabel = pAlabel->nTailLabel;
-
-			}
-		}
-		printf("head[%03d]_",pAlabel->nHeadLabel);
-		printf("tail[%03d]_",pAlabel->nTailLabel);
-		printf("portID:%d\n",i);
-// 		free(pAlabel);
-// 		pAlabel = NULL;
-	 }
-// 	free(pRecvUdpCfg);
-// 	pRecvUdpCfg = NULL;
-
-	for (i=0;i<20;i++)
-	{
-		for (k=0;k<20;k++)
-		{
-			for (j=0;j<256;j++)
-			{
-				if (pA429Cfg[i*20+k].Labelmap[j/32]&(1<<(j%32)))
-				{
-					A429To429Arry.nA429ToA429[i][j] |= 1<<k;;
-				}
-			}
-		}
-
-	}
-
-	for (i=0;i<cfg_soft.nRecvUdpNum;i++)
-	{
-		if (pRecvUdpCfg[i].nRecvUdpPort > 65535)
-		{
-			printf("nRecvUdpPort err!\n");
-			continue;
-		}
-		nUdpTo429[pRecvUdpCfg[i].nRecvUdpPort].nA429SendChannel1 |= pRecvUdpCfg[i].nA429RecvChannel1;
-		nUdpTo429[pRecvUdpCfg[i].nRecvUdpPort].nUseType =  pRecvUdpCfg[i].nUseType;
-	}
-// 	free(pA429Cfg);
-// 	pA429Cfg = NULL;
-
-
-	return 0;
-}
-
-int ReadHeaderCfg(FILE *fp)
-{
-	int nReadCnt=0;
-	char buf[0x100] = {0};
-	rewind(fp);
-	nReadCnt = fread(buf,sizeof(char),0x100,fp);
-	memcpy(cfg_header.version,buf,16);
-	memcpy(cfg_header.SqlName,buf+16,32);
-	memcpy(cfg_header.cfgDate,buf+48,16);
-	printf("version:%s!\n",cfg_header.version);
-	printf("sqlname:%s!\n",cfg_header.SqlName);
-	printf("create date:%s!\n",cfg_header.cfgDate);
-	return 0;
-}
-
-int hwa_load_conf_file()
-{
-	/*
-	FILE *fp;
-	char ch;
-	fp=fopen("d:\\a.txt","r");
-	ch = fgetc(fp);
-	printf("ch is:0x%x\n",ch);
-	*/
-	FILE *fp;
-	fp=fopen("c:\\CARRDC_L_CFG.bin","rb");
-	memset(&A429ToUdpArry,0,sizeof(A429ToUdpArry));
-//	memset(nA429ToA429,0,20*256*sizeof(A429TOA429_STRUCT_t));
-	ReadSoftCfg(fp);
-	ReadHeaderCfg(fp);
-	ReadHwaCfg(fp);
-
-	return 0;
-}
-
-#if 0
-void send429(char channel,unsigned int data)
-{
-
-}
-void nSendToAfdx()
-{
-
-}
-void A429To429(char channel,unsigned int data)
-{
-	char nLabel;
-	nLabel = data&0xff;
-	int i = 0;
-	for (i=0;i<16;i++)
-	{
-		if (nA429ToA429[channel][nLabel]&(1<<i))
-		{
-			send429(i,data);
-		}
-
-	}
-
-
-}
-
-
-void A429ToAfdx(char channel,unsigned int data)
-{
-	int i = 0;
-	nFrameR * pFrameR;
-	char nLabel;
-	unsigned int nData;
-	int nA429ToAfdxCfgIndex = 0;
-	unsigned int nFramebit = 0;
-	unsigned char nArryIndex,nBitIndex;
-	nLabel = data&0xff;
-	nData = (data&0x1FFFFC00)>>10;
-
-	if(nA429ToUdp[channel][nLabel].nUsed ==0)
-	{
-		A429To429(channel,data);
-	}else{
-		pFrameR = nA429ToUdp[channel][data&0xff].pFrameR;
-		for (i=0;i<nA429ToUdp[channel][data&0xff].nUsed;i++)
-		{
-			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++;
-				}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));
-					}
-					nSendToAfdx();
-					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;
-					}
-				}
-
-
-			}
-		}
-
-
-
-
-
-	}
-
-}
-
-
-
-method AfdxTo429()
-{
-	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;/*×é°ü·½ʽ*/
-
-	pBlockTime = cast($regs.afdx_block_adr,BLOCK_TIME_STRUCT_t *);
-
-	local A429_TO_UDP_STRUCT_t ** nA429ToUdp;
-	local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-
-	nA429ToUdp = GetnA429ToAudp();
-	pAfdxFrameBlock=getpAfdxFrameBlock();
-
-
-
-	if(nA429ToUdp[channel][nLabel].nUsed ==0)/*Èç¹ûûÓÃÔòת·¢µ½429*/
-	{
-		call $A429To429(channel,data);
-	}else{																	/*ת·¢AFDX*/
-		if(nAfdxFlag == 1)/*¶¨ʱ×é°ü*/
-		{
-			pFrameR = nA429ToUdp[channel][data&0xff].pFrameR;
-			for (i=0;i<nA429ToUdp[channel][data&0xff].nUsed;i++)
-			{
-				if(i>0)
-				{
-					pFrameR= pFrameR->pNext;
-				}
-					if(pFrameR->pA429ToUdp->nUseType == 0)
-					{
-						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 = nA429ToUdp[channel][data&0xff].pFrameR;
-			for (i=0;i<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();
-								continue ;
-							}else{
-								inline $AfdxTimer.post(400000,&(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();
-						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;
-						}
-					}
-				}/*usetype*/
-			}/*for*/
-		}/*end of ˳Ðò×é°ü*/
-	}
-
-
-
-}
-#endif
diff --git a/simics-workspace/modules/rtc_module/rtc_module.dml b/simics-workspace/modules/rtc_module/rtc_module.dml
deleted file mode 100755
index 8bc91cc..0000000
--- a/simics-workspace/modules/rtc_module/rtc_module.dml
+++ /dev/null
@@ -1,945 +0,0 @@
-// rtc_module.dml - Skeleton code to base new DML device modules on
-
-dml 1.2;
-
-device rtc_module;
-
-parameter desc = "name of device";
-
-parameter documentation = "Longer description that will appear in the help";
-parameter byte_order = "big-endian";
-
-import "utility.dml";
-import "interface.dml";
-import "config.dml";
-header %{
-#include <hwacfg.h>
-#include <softcfg.h>
-%}
-
-
-extern typedef struct
-{
-	uint8 vlNum;
-	uint8 bag;
-	uint8 period;
-	uint8 offset;
-
-	//unsigned long  dstIP;
-	uint8 vl_use;
-	uint8 RTC_period;
-
-	uint8 netSelect;
-	uint8 subvlTotal;
-
-	uint8 allow_redu;
-	//unsigned short fragAble;
-	//unsigned short allow_slice;
-	uint8 back0;
-
-	//unsigned short fragLen;
-	uint8 maxLen;
-	uint8 minLen;
-}SENDVL_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 vlNum;
-	uint8 skewMax;
-	uint8 redundantAble;
-	uint8 integrityAble;
-
-	//unsigned long  dstIP;
-	uint8 vl_use;
-	uint8 back0;
-
-	//unsigned long  blank;
-	uint8 back1;
-	uint8 back2;
-}REVVL_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 maxlen;
-	uint8 echoVlNum;
-	uint8 replyVlNum;
-	uint8 replySubVlNum;
-	//  unsigned short udpSrcPort;
-	//by wj 100226 unsigned short udpDstIPemp;
-	uint8 udpDstIPemp;
-	uint8 blank1;
-}ICMP_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 flag;
-	uint8 blank1;
-	uint8 sendvl_num;
-	uint8 revvl_num;
-	uint8 domain;
-	uint8 side;
-	uint8 position;
-	uint8 blank2;
-
-	SENDVL_STRUCT_t sendVlSet[128];
-	REVVL_STRUCT_t recvVlSet[256];
-	ICMP_STRUCT_t IcmpSet[16];
-}HWACFG_STRUCT_t;
-
-
-extern typedef struct
-{
-
-	uint8 nPortId;
-	uint8 nSrcUdp;
-
-	uint8 nSubVlIndex;
-	uint8 nDstUdp;
-
-	uint8 nPortType;
-	uint8 nA429RecvChannel;
-
-	uint32 nDstIP;
-	uint8 nUseType;
-	uint8 nDataSrcPatition;
-	uint8 n;/*·ÖƬ*/
-
-	uint8 nLabelOffset;
-	uint32 nIcdid;
-	uint8 nMessageLength;
-	uint8 nRecvBufLength;
-
-}SEND_UDP_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 nPortId;
-	uint8 nRecvUdpPort;
-
-	uint8 nA429RecvChannel1;
-	uint8 nMessageLength;
-
-	uint8 nRecvBufLength;
-	uint8 nPortType;
-
-	uint8 nUseType;
-	uint8 nVlId;
-	uint8 n;/*·ÖƬ*/
-
-	uint8 nA429RecvChannel2;
-	uint32 nIcdid;
-
-}RECV_UDP_STRUCT_t;
-
-extern typedef struct
-{
-	uint32 A429RecvChannel;
-	uint32 A429SendChannel;
-	uint32 nSendCheck;
-	uint32 Labelmap[8];
-}A429_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 nHeadLabel;
-	uint8 nTailLabel;
-	uint32 nLabelMap[8];
-}ALABEL_STRUCT_t;
-
-extern typedef struct
-{
-	uint32 nSoftCfgLength;
-	uint8 n429PortNum;
-	uint8 n429PortCfgOffset;
-
-	uint8 nSendUdpNum;
-	uint8 nSendUdpCfgOffset;
-
-	uint8 nRecvUdpNum;
-	uint8 nRecvUdpCfgOffset;
-
-}SOFTCFG_STRUCT_t;
-
-extern typedef struct
-{
-	SEND_UDP_STRUCT_t * pA429ToUdp;
-	ALABEL_STRUCT_t *pAlabel;
-	SENDVL_STRUCT_t * pSendVl;
-    int nPortId;
-	nFrameR *pNext;
-}nFrameR;
-
-/*nomal struct*/
-extern typedef struct
-{
-	nFrameR * pFrameR;
-	uint8 nUsed;
-}A429_TO_UDP_STRUCT_t;
-
-
-// typedef struct
-// {
-// 	A429_STRUCT_t nA429To429;
-// 	unsigned int nUsed;
-// }A429TOA429_STRUCT_t;
-
-extern typedef struct
-{
-	uint8 nUseType;
-	uint8  nA429SendChannel1;
-}AUDPTOA429_STRUCT_t;
-
-extern typedef struct
-{
-	uint32 pAfdxFrameBlock[100];
-	uint8 nFrameNum;
-}AFDXFRAME_STRUCT_t;
-
-
-extern typedef struct
-{
-	A429_TO_UDP_STRUCT_t nA429ToUdp[16][256];
-}A429_TO_UDP_ARRAY;
-
-extern typedef struct
-{
-	uint8 nA429ToA429[20][256];
-}A429_TO_A429_ARRAY;
-
-typedef struct
-{
-	uint8 pAfdxBlockTime[1024];
-}BLOCK_TIME_STRUCT_t;
-
-
-
-extern int getAfdxFrameBlockNum();
-extern int hwa_load_conf_file();
-extern A429_TO_UDP_ARRAY* GetnA429ToAudp();
-extern AFDXFRAME_STRUCT_t *getpAfdxFrameBlock();
-extern A429_TO_A429_ARRAY* GetnA429ToA429();
-
-extern AUDPTOA429_STRUCT_t* GetnUdpTo429();
-
-extern HWACFG_STRUCT_t *GetHwaCfg();
-
-extern int socket_init(void);
-extern int socket_recv(char *recvbuf, int size);
-extern int socket_send(char *sendbuf, int size);
-
-/*load cfg udp api*/
-extern SEND_UDP_STRUCT_t * getSendUdpCfg();
-extern RECV_UDP_STRUCT_t * getRecvUdpCfg();
-extern  int getSendUdpCnt();
-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;
-        // for test begin
-       // $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);
-
-        local uint8 portid = 2;
-        local uint32 d = 0xacacac58;
-        local uint32 *data = &d;
-        local uint8 datalen = 2;
-        $ARINC664_2.Send_To_A664.send_to_A664(portid,cast(data,void *),datalen);
-
-
-        // for test end
-	}
-}
-
-connect ARINC664_2 {
-    parameter documentation = "Send frame to ARINC664_2";
-	parameter configuration = "optional";
-
-	interface Send_To_A664 {
-		parameter c_type = "Send_To_A664_interface_t";
-	}
-}
-
-connect LoadCfg{
-    parameter documentation = "load afdx config";
-	parameter configuration = "optional";
-
-	interface load_cfg_table {
-		parameter c_type = "load_cfg_table_interface_t";
-	}
-}
-
-// USER-TODO: add connect definitions here, if needed
-
-// USER-TODO: add attribute definitions here, if needed
-
-// Basic bank declaration
-bank regs {
-    parameter register_size = 4;
-    // USER-TODO: Add more register declarations here.  Usually use just one
-    // line per register, containing size (optional), offset, any templates
-    // implemented, and a short description. Use the read_write template for
-    // normal registers where a read usually returns the last written value,
-    // and the unimplemented template for registers that you haven't yet
-    // implemented.
-    register counter @ 0x00 is (read_write) "A simple counter.";
-}
-
-// USER-TODO: add implement and port declarations here, if needed
-
-// USER-TODO: add event declarations here, if needed
-
-// USER-TODO: add common methods here, if needed
-
-// USER-TODO: add templates here, if needed
-
-// Implementation of registers
-bank regs {
-    register counter{
-       method read() -> (value) {
-				log "info": "read from counter";
-				//value = hwa_load_conf_file();
-				//test of udpto429
-                //local uint64 i = 0x4E09567AE5947D7F;
-                //call $AfdxTo429(1064,cast(&i, uint32*), 8);
-                //test of send429
-                call $send429(11,0x4E09567A);
-                //test of A429To429
-                /*call $A429To429(uint8 channel,uint32 data);*/
-				}
-    }
-
-    register afdx_block_adr size 4 is (unmapped);
-}
-event AfdxTimer{
-		parameter timebase = "seconds";
-		method event(void* data) {
-			local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-			local uint8 *nBlockIndex = data;
-
-			pAfdxFrameBlock = getpAfdxFrameBlock();
-			pAfdxFrameBlock[*nBlockIndex].nFrameNum = 0;
-				//log "info": "Tick: .";
-
-			}
-}
-
-event AfdxRtcTimer{
-		parameter timebase = "seconds";
-		method event(void* data) {
-			local uint8 i=0;
-			local int AfdxFrameBlockNum;
-			local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-			pAfdxFrameBlock = getpAfdxFrameBlock();
-			AfdxFrameBlockNum = getAfdxFrameBlockNum();
-			for(i=0;i<AfdxFrameBlockNum;i++)
-			{
-				if(pAfdxFrameBlock[i].nFrameNum>0)/*´«µÝblock¸öÊý*/
-				{
-					call $nSendToAfdx(i,pAfdxFrameBlock[i].pAfdxFrameBlock,pAfdxFrameBlock[i].nFrameNum);
-				}
-			}
-			inline $this.post(40000,NULL);
-		}
-}
-
-method InitTime()
-{
-	local BLOCK_TIME_STRUCT_t * pBlockTime;
-	local uint32 nBlockAdr;
-	pBlockTime = new BLOCK_TIME_STRUCT_t;
-	$regs.afdx_block_adr = cast(pBlockTime,uint32);
-
-}
-
-/*
-method init()
-{
-	hwa_load_conf_file();
-	call $InitTime();
-}
-*/
-
-method nSendAfdxFrame()
-{
-
-}
-//send to 429 card//
-struct channel_data {
-    uint32 nr;
-    uint32 data;
-}
-
-method send429(uint8 channel,uint32 data)
-{
-	log "info" : "The channel is %d", channel;
-    local channel_data x;
-    x.nr = channel;
-    x.data = data;
-	log "info" : "Before call socket send@@@@@@@@@@@@@@@@@@@";
-    socket_send(cast(&x, uint8*), sizeof(x));
-}
-
-method A429To429(uint8 channel,uint32 data)
-{
-	local uint8 nLabel;
-	local uint8 i = 0;
-	local A429_TO_A429_ARRAY * nA429ToA429arry;
-	nLabel = data&0xff;
-	nA429ToA429arry = GetnA429ToA429();
-	log "info" : "A429TO429 :%x!\n",nA429ToA429arry->nA429ToA429[channel][nLabel];
-	for (i=0;i<16;i++)
-	{
-		if (((nA429ToA429arry->nA429ToA429[channel][nLabel])&(1<<i)) == 1)
-		{
-			call $send429(i,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;
-    $ARINC664_2.Send_To_A664.send_to_A664(portid,cast(data,void *),datalen);
-}
-
-//429toafdx/429 receive from 429
-
-
-method A429ToAfdx(uint8 channel,uint32 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 A429_TO_UDP_ARRAY * A429ToUdpArry;
-	local AFDXFRAME_STRUCT_t *pAfdxFrameBlock;
-
-	pBlockTime = cast($regs.afdx_block_adr,BLOCK_TIME_STRUCT_t *);
-
-
-	A429ToUdpArry = GetnA429ToAudp();
-	pAfdxFrameBlock=getpAfdxFrameBlock();
-	/*print config*/
-	pFrameR = A429ToUdpArry->nA429ToUdp[channel][data&0xff].pFrameR;
-	for (i=0;i<A429ToUdpArry->nA429ToUdp[channel][data&0xff].nUsed;i++)
-	{
-		if(i>0)
-		{
-			pFrameR= pFrameR->pNext;
-		}
-		log "info": "portID:%d;\n",pFrameR->nPortId;
-	}
-	/*print config end*/
-	log "info": "usd:%d,label:0x%x\n",A429ToUdpArry->nA429ToUdp[channel][nLabel].nUsed,nLabel;
-
-	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)
-                {
-                    nA429ToAfdxCfgIndex = pFrameR->nPortId;
-                   // nFramebit=pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum;
-                    pAfdxFrameBlock[nA429ToAfdxCfgIndex].pAfdxFrameBlock[pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum]=data;
-                    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->nPortId;
-					if (pFrameR->pAlabel->nHeadLabel == nLabel)     /*ͷ°ü*/
-					{
-						pAfdxFrameBlock[nA429ToAfdxCfgIndex].nFrameNum = 0;
-
-						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);
-
-								continue ;
-							}else{
-								inline $AfdxTimer.post(400000,&(pBlockTime->pAfdxBlockTime[nA429ToAfdxCfgIndex]));
-							}
-					}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;
-						}
-					}
-				}/*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)
-					{
-						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(400000,&(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;
-						}
-					}
-				}/*usetype*/
-			}/*for*/
-		}/*end of ˳Ðò×é°ü*/
-	}
-
-}
-}
-
-
-
-
-//receive from afdx card
-method AfdxTo429(uint16 dest_udp,uint32 *payload,uint32 length)
-{
-log "info" : "Entering nUdpTo429()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
-local uint8 i;
-local uint8 j;
-local uint32 Channel;
-local uint32 usertype_count;
-local uint32 wrongchannel_count;
-local uint32 wrongsize_count;
-local uint32 payload_temp;
-usertype_count = 0;
-wrongchannel_count = 0;
-wrongsize_count = 0;
-local AUDPTOA429_STRUCT_t * nUdpTo429Arry;
-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;
-    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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
-
-        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;
-                if ((Channel & 0x1) == 1)
-                {
-                    log "info": "Before call send429 ##########################";
-                    STORE_BE32(&payload_temp,*payload);
-                    call $send429(j, payload_temp);
-					log "info":"after call send429";
-                }
-                Channel = Channel>>0x1;
-            }
-            payload = payload++;
-        }
-    }
-    else if (nUdpTo429Arry[dest_udp].nUseType !=0)  //usertype not normal
-        usertype_count++;
-    else if (nUdpTo429Arry[dest_udp].nA429SendChannel1 ==0)  //wrong 429 transmit channel
-        wrongchannel_count++;
-    else if (sizeof(payload)%4 != 0)  //wrong payload size
-        wrongsize_count++;
-}
-
-constant PORT_DATA_SIZE = 8;     // too big , sizeoftype(uint8) + sizeoftype(uint32) is OK?
-
-
-method socket_loop_recv() {
-    local int length;
-    local uint8 *buf = new uint8 [PORT_DATA_SIZE];
-    length = socket_recv(buf, PORT_DATA_SIZE);
-   // log "info" : "THe length is %d.", length;
-    if (length > 0) {
-        local uint8 channel;
-        local uint32 data;
-        memcpy(&channel, buf, sizeoftype(uint32));
-        memcpy(&data, buf + sizeoftype(uint32), sizeoftype(uint32));
-
-        call $A429ToAfdx(channel, data);
-
-
-    }
-
-    delete buf;
-	after (0.001) call $socket_loop_recv();
-
-}
-
-method load_afdx_config()
-{
-	local HWACFG_STRUCT_t *pHwaCfg;
-	local analyse_cfg_cam  cam_cfg_table;
-	local analyse_cfg_ram recv_cfg_ram;
-
-	local rm_cfg_cam  recv_rm_cfg_cam;
-	local rm_cfg_ram  recv_rm_cfg_ram;
-
-
-	local transmit_cfg_ram    send_cfg_table;
-	local scheduling_cfg_ram  send_bag_table;
-	local fragment_cfg_ram   send_frame_length;
-	local uint32 i=0;
-
-	local uint32 SendCfgUdpCnt;
-	local uint32 RecvCfgUdpCnt;
-	local RECV_UDP_STRUCT_t *RecvCfgUdp;
-	local SEND_UDP_STRUCT_t *SendCfgUdp;
-
-	local uint32 userid ;
-	local uint32 partid ;
-
-	local uint16 VlIndex;
-	pHwaCfg = GetHwaCfg();
-
-	RecvCfgUdp=getRecvUdpCfg();
-	SendCfgUdp=getSendUdpCfg();
-	RecvCfgUdpCnt=getRecvUdpCnt();
-	SendCfgUdpCnt=getSendUdpCnt();
-	log "info" : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\";
-	log "info" :"revvl_num = %d",pHwaCfg->revvl_num;
-	log "info" :"sendvl_num = %d",pHwaCfg->sendvl_num;
-	log "info" :"RecvCfgUdpCnt = %d",RecvCfgUdpCnt;
-	log "info" :"SendCfgUdpCnt = %d",SendCfgUdpCnt;
-	log "info" : "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\";
-
-
-	local int num;
-
-	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¸ö*/
-	{
-
-	  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.SKEW_MAX = pHwaCfg->recvVlSet[i].skewMax;
-	  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_A_IC_ENABLE=pHwaCfg->recvVlSet[i].integrityAble;
-	  }else{
-		recv_rm_cfg_ram.ram_data.NETWORK_B_ENABLE=0;
-		recv_rm_cfg_ram.ram_data.NETWORK_A_ENABLE=1;
-		recv_rm_cfg_ram.ram_data.NETWORK_B_IC_ENABLE=0;
-		recv_rm_cfg_ram.ram_data.NETWORK_A_IC_ENABLE=pHwaCfg->recvVlSet[i].integrityAble;
-	  }
-
-	  $LoadCfg.load_cfg_table.load_rm_cam_cfg_table(1,&recv_rm_cfg_cam);
-	  $LoadCfg.load_cfg_table.load_rm_ram_cfg_table(1,&recv_rm_cfg_ram);
-
-	  log "info" : "The revvl_num is %d, and the cam_cfg_table.cam_data_part3.VL is %d", i, cam_cfg_table.cam_data_part3.VL;
-	  log "info": "n\n";
-	}
-
-
-
-
-	//load port cfg
-	//extern SEND_UDP_STRUCT_t * getSendUdpCfg();
-	//extern RECV_UDP_STRUCT_t * getRecvUdpCfg();
-	//extern unsigned int getSendUdpCnt();
-	//extern unsigned int getRecvUdpCnt();
-
-	/*½ÓÊÕportµÄÅäÖÃ   ½ÓÊն˿Ú×î´óΪ4096*/
-	for(i=0;i<RecvCfgUdpCnt;i++)
-	{
-	   cam_cfg_table.address =i;
-	   //RecvCfgUdp[i].nPortId = i;
-	  cam_cfg_table.cam_data_part3.VL= RecvCfgUdp[i].nVlId;
-	  cam_cfg_table.cam_data_part3.DEST_UDP = RecvCfgUdp[i].nRecvUdpPort;
-	  cam_cfg_table.cam_data_part2.DEST_IP = ((0xa << 24) | ((userid & 0xffff) << 8) | (partid & 0x1f));
-
-    if(((( cam_cfg_table.cam_data_part2.DEST_IP & 0xff000000) >> 24) == 224) &&
-        ((( cam_cfg_table.cam_data_part2.DEST_IP & 0x00ff0000) >> 16) == 224))
-      {
-        cam_cfg_table.cam_data_part1.MULTICAST_ID = 1;//mode_multicast
-      }
-     else
-      {
-         cam_cfg_table.cam_data_part1.MULTICAST_ID = 0;
-      }
-	  //
-	  //
-	  //cam_cfg_table.cam_data_part1.ICMP_TYPE_ID
-
-	   recv_cfg_ram.ram_data.PORT_TYPE = RecvCfgUdp[i].nPortType;
-
-	  recv_cfg_ram.ram_data.NETWORK_A_ENABLE=1;
-	  recv_cfg_ram.ram_data.NETWORK_B_ENABLE=1;
-
-	  $LoadCfg.load_cfg_table.load_analyse_cam_cfg_table(1,&cam_cfg_table);
-	  $LoadCfg.load_cfg_table.load_analyse_ram_cfg_table(1,&recv_cfg_ram);
-	}
-
-
-	/*·¢ËÍVLµÄÅäÖÃ   ·¢ËÍVL×î´óΪ128*/
-	for(i=0;i<pHwaCfg->sendvl_num;i++)
-	{
-
-	  send_bag_table.BAG = pHwaCfg->sendVlSet[i].bag;
-
-
-
-
-	  log "info": "------------------------------------------------------------------------";
-
-	  $LoadCfg.load_cfg_table.load_scheduling_ram_cfg_table(1,&send_bag_table);
-	 // $LoadCfg.load_cfg_table.load_fragment_ram_cfg_table(1,&send_frame_length);
-
-	  log "info" : "The sendvl_num is %d", i;
-	  log "info": "------------------------------------------------------------------------\n\n";
-	}
-	/*·¢ËͶ˿ڵÄÅäÖÃ   ·¢ËͶ˿Ú×î´óΪ1024*/
-    //log "info" : "SendCfgUdpCnt is %d", SendCfgUdpCnt;
-
-	for(i=0;i<SendCfgUdpCnt;i++)
-	{
-	  VlIndex = SendCfgUdp[i].nSubVlIndex;
-
-	  send_cfg_table.ram_data_part1.VL_ID =pHwaCfg->sendVlSet[VlIndex>>2].vlNum;
-	  send_cfg_table.ram_data_part1.VL_INDEX=VlIndex>>2;
-
-	  send_cfg_table.ram_data_part4.PARTITION_ID = (SendCfgUdp[i].nDstIP&0x1f);/*0~4*/
-	  send_cfg_table.ram_data_part4.USER_DEFINED_ID_L=(SendCfgUdp[i].nDstIP>>8)&0x3ff9;/*8~21*/
-	  send_cfg_table.ram_data_part4.USER_DEFINED_ID_H=(SendCfgUdp[i].nDstIP>>22)&0x3;/*22~23*/
-	  send_cfg_table.ram_data_part4.PRIVATE_IP= 0x0a;
-
-	  if(((( SendCfgUdp[i].nDstIP & 0xff000000) >> 24) == 224) &&
-        ((( SendCfgUdp[i].nDstIP & 0x00ff0000) >> 16) == 224))
-      {
-        send_cfg_table.ram_data_part1.IP_MULTICAST = 1;//mode_multicast
-      }
-     else
-      {
-         send_cfg_table.ram_data_part1.IP_MULTICAST = 0;
-      }
-
-	  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;/*ÍøÂçѡÔñ*/
-	  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.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;
-	  send_cfg_table.ram_data_part3.SOURCE_UDP_PORT=SendCfgUdp[i].nSrcUdp;
-
-	  send_frame_length.MAX_FRAME_LENGTH =pHwaCfg->sendVlSet[VlIndex>>2].maxLen;
-
-      if (i == 0) {
-        log "info" : "The min_frame_length = %d", send_cfg_table.ram_data_part1.MIN_FRAME_LENGTH;
-      //  while(1);
-      }
-
-
-	  log "info" : "SendCfgUdp[i].nDstIP = %x", SendCfgUdp[i].nDstIP;
-	  log "info" : "From RDC dest_ip is %x", (0x0 << 31) |  (0xa << 24) | (send_cfg_table.ram_data_part4.USER_DEFINED_ID_H << 22) | (send_cfg_table.ram_data_part4.USER_DEFINED_ID_L << 8) | (send_cfg_table.ram_data_part4.PARTITION_ID);
-
-	  $LoadCfg.load_cfg_table.load_transmit_ram_cfg_table(1,&send_cfg_table);
-	  $LoadCfg.load_cfg_table.load_fragment_ram_cfg_table(1,&send_frame_length);
-
-	}
-
-	$LoadCfg.load_cfg_table.load_cfg_done();
-
-
-}
-
-
-// USER-TODO: Add init() and post_init() methods here, if needed.
-// init() will be run to set the empty state of the model, before any
-// configuration or checkpointed attributes are set.  post_init() is run after
-// all configuration attributes have been set.  This happens both when the
-// initial configuration is set and when the configuration is loaded from a
-// checkpoint.
-method post_init() {
-    log "info" : "hehe";
-    hwa_load_conf_file();
-	call $load_afdx_config();
-    socket_init();
-    call $socket_loop_recv();
-}
diff --git a/simics-workspace/modules/rtc_module/socket.c b/simics-workspace/modules/rtc_module/socket.c
deleted file mode 100644
index 9ec592a..0000000
--- a/simics-workspace/modules/rtc_module/socket.c
+++ /dev/null
@@ -1 +0,0 @@
-#include <stdio.h>#include <string.h>#include <stdlib.h>#include <errno.h>#include <unistd.h>#include <WINSOCK2.H>SOCKET client_socket;extern int socket_init(void);extern int socket_recv(unsigned char *recvbuf, int size);extern int socket_send(unsigned char *sendbuf, int size);int socket_init(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(10086);    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 socket_send(unsigned char *sendbuf, int size) {    int len = send(client_socket, (char *)sendbuf, size, 0);	fprintf(stdout, "hehe$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n");    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 socket_recv(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);            fprintf(stderr, "Before call recv\n");             len = recv(client_socket, (char *)recvbuf, size, 0);            if (len == size) {                fprintf(stdout, "Socket recv sucessfully!\n", WSAGetLastError());            } else {                fprintf("Socket recv failed, error code is %d.\n", WSAGetLastError());            }        }        return len;    }}
\ No newline at end of file
diff --git a/simics-workspace/modules/rtc_module/softcfg.h b/simics-workspace/modules/rtc_module/softcfg.h
deleted file mode 100644
index 0cd0def..0000000
--- a/simics-workspace/modules/rtc_module/softcfg.h
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-#ifndef __SOFT_CFG_H__
-#define __SOFT_CFG_H__
-
-#define A429_CHANNEL_SIZE  16
-#define A429_LABEL_NUM  256
-
-typedef struct
-{
-
-	unsigned short nPortId;
-	unsigned short nSrcUdp;
-
-	unsigned short nSubVlIndex;
-	unsigned short nDstUdp;
-
-	unsigned short nPortType;
-	unsigned short nA429RecvChannel;
-
-	unsigned int nDstIP;
-	unsigned short nUseType;
-	unsigned short nDataSrcPatition;
-	unsigned short n;/*·ÖƬ*/
-
-	unsigned short nLabelOffset;
-	unsigned int nIcdid;
-	unsigned short nMessageLength;
-	unsigned short nRecvBufLength;
-
-}SEND_UDP_STRUCT_t;
-
-typedef struct
-{
-	unsigned short nPortId;
-	unsigned short nRecvUdpPort;
-
-	unsigned short nA429RecvChannel1;
-	unsigned short nMessageLength;
-
-	unsigned short nRecvBufLength;
-	unsigned short nPortType;
-
-	unsigned short nUseType;
-	unsigned short nVlId;
-	unsigned short n;/*·ÖƬ*/
-
-	unsigned short nA429RecvChannel2;
-	unsigned int nIcdid;
-
-}RECV_UDP_STRUCT_t;
-
-typedef struct
-{
-	unsigned int A429RecvChannel;
-	unsigned int A429SendChannel;
-	unsigned int nSendCheck;
-	unsigned int Labelmap[8];
-}A429_STRUCT_t;
-
-typedef struct
-{
-	unsigned short nHeadLabel;
-	unsigned short nTailLabel;
-	unsigned int nLabelMap[8];
-}ALABEL_STRUCT_t;
-
-typedef struct
-{
-	unsigned int nSoftCfgLength;
-	unsigned short n429PortNum;
-	unsigned short n429PortCfgOffset;
-
-	unsigned short nSendUdpNum;
-	unsigned short nSendUdpCfgOffset;
-
-	unsigned short nRecvUdpNum;
-	unsigned short nRecvUdpCfgOffset;
-
-}SOFTCFG_STRUCT_t;
-
-typedef struct FrameR
-{
-	SEND_UDP_STRUCT_t * pA429ToUdp;
-	ALABEL_STRUCT_t *pAlabel;
-	SENDVL_STRUCT_t * pSendVl;
-    int nPortId;
-	struct FrameR *pNext;
-}nFrameR;
-
-/*nomal struct*/
-typedef struct
-{
-	nFrameR * pFrameR;
-	unsigned short nUsed;
-}A429_TO_UDP_STRUCT_t;
-
-
-// typedef struct
-// {
-// 	A429_STRUCT_t nA429To429;
-// 	unsigned int nUsed;
-// }A429TOA429_STRUCT_t;
-
-typedef struct
-{
-	unsigned short nUseType;
-	unsigned short  nA429SendChannel1;
-}AUDPTOA429_STRUCT_t;
-
-typedef struct
-{
-	unsigned int pAfdxFrameBlock[100];
-	unsigned char nFrameNum;
-}AFDXFRAME_STRUCT_t;
-
-typedef struct
-{
-	A429_TO_UDP_STRUCT_t nA429ToUdp[A429_CHANNEL_SIZE][A429_LABEL_NUM];
-}A429_TO_UDP_ARRAY;
-
-typedef struct
-{
-	unsigned short nA429ToA429[20][A429_LABEL_NUM];
-}A429_TO_A429_ARRAY;
-#endif
\ No newline at end of file
diff --git a/simics-workspace/modules/rtc_module/test/README b/simics-workspace/modules/rtc_module/test/README
deleted file mode 100644
index 50e2378..0000000
--- a/simics-workspace/modules/rtc_module/test/README
+++ /dev/null
@@ -1,5 +0,0 @@
-Simics provides a simple way to create tests for devices developed in
-a workspace. This directory contains sample code that will help you
-understand how this test framework works. For a complete description
-of the framework's capabilities, refer to the Simics Model Builder
-Reference Manual.
diff --git a/simics-workspace/modules/rtc_module/test/SUITEINFO b/simics-workspace/modules/rtc_module/test/SUITEINFO
deleted file mode 100644
index e69de29..0000000
diff --git a/simics-workspace/modules/rtc_module/test/rtc_module_common.py b/simics-workspace/modules/rtc_module/test/rtc_module_common.py
deleted file mode 100644
index 8c38684..0000000
--- a/simics-workspace/modules/rtc_module/test/rtc_module_common.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import simics
-
-# Extend this function if your device requires any additional attributes to be
-# set. It is often sensible to make additional arguments to this function
-# optional, and let the function create mock objects if needed.
-def create_rtc_module(name = None):
-    '''Create a new rtc_module object'''
-    rtc_module = simics.pre_conf_object(name, 'rtc_module')
-    simics.SIM_add_configuration([rtc_module], None)
-    return simics.SIM_get_object(rtc_module.name)
diff --git a/simics-workspace/modules/rtc_module/test/s-info-status.py b/simics-workspace/modules/rtc_module/test/s-info-status.py
deleted file mode 100644
index 680a479..0000000
--- a/simics-workspace/modules/rtc_module/test/s-info-status.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import info_status
-import stest
-import rtc_module_common
-
-# Verify that info/status commands have been registered for all
-# classes in this module.
-info_status.check_for_info_status(['rtc_module'])
-
-# Create an instance of each object defined in this module
-dev = rtc_module_common.create_rtc_module()
-
-# Run info and status on each object. It is difficult to test whether
-# the output is informative, so we just check that the commands
-# complete nicely.
-for obj in [dev]:
-    for cmd in ['info', 'status']:
-        try:
-            SIM_run_command(obj.name + '.' + cmd)
-        except SimExc_General, e:
-            stest.fail(cmd + ' command failed: ' + str(e))
diff --git a/simics-workspace/modules/rtc_module/test/s-rtc_module.py b/simics-workspace/modules/rtc_module/test/s-rtc_module.py
deleted file mode 100644
index 7f9dc73..0000000
--- a/simics-workspace/modules/rtc_module/test/s-rtc_module.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import dev_util
-import conf
-import stest
-import rtc_module_common
-
-# Create an instance of the device to test
-dev = rtc_module_common.create_rtc_module()
-
-# Write your tests here