diff --git a/simics-workspace/modules/afdxES2/checksum.dml b/simics-workspace/modules/afdxES2/checksum.dml
index 93f5761..14a6102 100644
--- a/simics-workspace/modules/afdxES2/checksum.dml
+++ b/simics-workspace/modules/afdxES2/checksum.dml
@@ -2,85 +2,85 @@ dml 1.2;
 import "constant.dml";
 import "port-queue.dml";

-method udp_check_sum(Item *afdx_frame, Afdx_Frame_Packet* afdx_frame_packet)
-{
-		local uint32 sum =0;
-		local uint32 i=0;
-		local uint16 udp_checksum;
-		local uint16 *address;
-		local uint16 *udp_address_in_afdx;
-		local uint16 *udp_check_in_afdx;
-
-		//sum dest ip , source ip, udp_protocal,udp_length
-		address = cast(&afdx_frame_packet->ip_header_structure.IP_SOURCE_ADDRESS,uint16 *);
-		for(i=0; i < IP_ADDRESS_LENGTH/2; i++ )
-			sum += address[i];
-		sum += UPD_PROTOCAL_SUM;
-		sum +=afdx_frame_packet->udp_header_structure.UDP_LENGTH;
-
-		udp_address_in_afdx = cast(afdx_frame->frame + (MAC_HEADER_LENGTH + IPV4_LENGTH + IP_HEADER_LENGTH), uint16*);
-		call $part_udp_check_sum(udp_address_in_afdx,
-								 afdx_frame_packet->udp_header_structure.UDP_LENGTH,sum)
-								 ->(udp_checksum);
-		udp_check_in_afdx= cast(afdx_frame->frame+UDP_CHECKSUM_ADDR, uint16 *);
-		*udp_check_in_afdx = udp_checksum;
+method udp_check_sum(Item *afdx_frame, Afdx_Frame_Packet* afdx_frame_packet) {
+    local uint32 sum =0;
+    local uint32 i=0;
+    local uint16 udp_checksum;
+    local uint16 *address;
+    local uint16 *udp_address_in_afdx;
+    local uint16 *udp_check_in_afdx;
+
+    //sum dest ip , source ip, udp_protocal,udp_length
+    address = cast(&afdx_frame_packet->ip_header_structure.IP_SOURCE_ADDRESS,uint16 *);
+    for (i = 0; i < IP_ADDRESS_LENGTH/2; i++ ) {
+        sum += address[i];
+    }
+    sum += UPD_PROTOCAL_SUM;
+    sum +=afdx_frame_packet->udp_header_structure.UDP_LENGTH;
+
+    udp_address_in_afdx = cast(afdx_frame->frame + (MAC_HEADER_LENGTH + IPV4_LENGTH + IP_HEADER_LENGTH), uint16*);
+    call $part_udp_check_sum(udp_address_in_afdx,
+                             afdx_frame_packet->udp_header_structure.UDP_LENGTH,sum)
+        ->(udp_checksum);
+    udp_check_in_afdx= cast(afdx_frame->frame + UDP_CHECKSUM_ADDR, uint16 *);
+    *udp_check_in_afdx = udp_checksum;
 }

-
-
-method receive_udp_check_sum(PortQueue* queue)->(bool result)
-{
-		local uint32 sum =0;
-		local uint32 i=0;
-		local uint16 old_udp_checksum;
-		local uint16 new_udp_checksum;
-		local uint16 udp_check_in_item;
-		local uint16* address;
-		local uint16* checksum_data;
-		local PortItem port_item;
-		local QueueItem *checksumitem;
-		local uint32 offset = 0;
-		local int32  whole_size;
+method receive_udp_check_sum(PortQueue* queue)->(bool result) {
+    local uint32 sum =0;
+    local uint32 i=0;
+    local uint16 old_udp_checksum;
+    local uint16 new_udp_checksum;
+    local uint16 udp_check_in_item;
+    local uint16* address;
+    local uint16* checksum_data;
+    local PortItem port_item;
+    local QueueItem *checksumitem;
+    local uint32 offset = 0;
+    local int32  whole_size;

-		checksumitem = queue->tail->prev_whole->next;
-		port_item.dest_ip = checksumitem->dest_ip;
-		port_item.src_ip = checksumitem->src_ip;
-		port_item.size = checksumitem->whole_size;
-		port_item.frame = new uint8[checksumitem->whole_size];
-		whole_size = checksumitem->whole_size;
-		while(checksumitem&&whole_size>0)
-		{
-			if(checksumitem->single_size > whole_size)
+    checksumitem = queue->tail->prev_whole->next;
+    port_item.dest_ip = checksumitem->dest_ip;
+    port_item.src_ip = checksumitem->src_ip;
+    port_item.size = checksumitem->whole_size;
+    port_item.frame = new uint8[checksumitem->whole_size];
+    whole_size = checksumitem->whole_size;
+    while(checksumitem&&whole_size>0) {
+        if(checksumitem->single_size > whole_size)
 			checksumitem->single_size = whole_size;
-			whole_size -= checksumitem->single_size;
-			memcpy(port_item.frame+offset,checksumitem->buffer,checksumitem->single_size);
-			offset += checksumitem->single_size;
-			checksumitem = checksumitem->next;
-		}
+        whole_size -= checksumitem->single_size;
+        memcpy(port_item.frame+offset,checksumitem->buffer,checksumitem->single_size);
+        offset += checksumitem->single_size;
+        checksumitem = checksumitem->next;
+    }

-		old_udp_checksum = *cast(port_item.frame+UDP_CHECKSUM_OFFSET,uint16 *);
-		*cast(port_item.frame+UDP_CHECKSUM_OFFSET,uint16 *) = 0;
+    old_udp_checksum = *cast(port_item.frame+UDP_CHECKSUM_OFFSET,uint16 *);
+    *cast(port_item.frame+UDP_CHECKSUM_OFFSET,uint16 *) = 0;

-		address = cast(&port_item.dest_ip,uint16 *);
-		for(i=0; i < DEST_IP_ADDR_LENGTH/2; i++ )
-			sum += address[i];
-		address = cast(&port_item.src_ip,uint16 *);
-		for(i=0; i < SRC_IP_ADDR_LENGTH/2; i++ )
-			sum += address[i];
-		sum += UPD_PROTOCAL_SUM;
-		sum += port_item.size;
-		checksum_data = cast(port_item.frame,uint16 *);
-		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;
-		if(new_udp_checksum != old_udp_checksum) result = false;
-		else result = true;
+    address = cast(&port_item.dest_ip,uint16 *);
+    for (i = 0; i < DEST_IP_ADDR_LENGTH/2; i++) {
+        sum += address[i];
+    }
+    address = cast(&port_item.src_ip,uint16 *);
+    for (i = 0; i < SRC_IP_ADDR_LENGTH/2; i++) {
+        sum += address[i];
+    }
+    sum += UPD_PROTOCAL_SUM;
+    sum += port_item.size;
+    checksum_data = cast(port_item.frame,uint16 *);
+    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;
+    if (new_udp_checksum != old_udp_checksum) {
+        result = false;
+    } else {
+        result = true;
+    }
 }

-method part_udp_check_sum(uint16* a, uint32 len, uint32 sum) -> (uint16 checksum)
-{
+method part_udp_check_sum(uint16* a, uint32 len, uint32 sum) -> (uint16 checksum) {
     while (len > 1) {
         sum += *a++;
         len -= 2;
@@ -98,9 +98,7 @@ method part_udp_check_sum(uint16* a, uint32 len, uint32 sum) -> (uint16 checksum
 	checksum = cast(sum, uint16);
 }

-method ip_check_sum(uint8 *ptr, uint32 size)->(uint16 checksum)
-{
-
+method ip_check_sum(uint8 *ptr, uint32 size)->(uint16 checksum) {
     local uint32 cksum = 0;
     local uint32 index = 0;
 	local uint32 i = 0;
@@ -110,16 +108,14 @@ method ip_check_sum(uint8 *ptr, uint32 size)->(uint16 checksum)
     if(size % 2 != 0)
         return;

-    while(index < size)
-    {
+    while(index < size) {
         cksum += *(ptr + index + 1);
         cksum += *(ptr + index) << 8;

         index += 2;
     }

-    while(cksum > 0xffff)
-    {
+    while(cksum > 0xffff) {
         cksum = (cksum >> 16) + (cksum & 0xffff);
     }

@@ -127,9 +123,7 @@ method ip_check_sum(uint8 *ptr, uint32 size)->(uint16 checksum)
 	checksum = cast(cksum, uint16);
 }

-
-method unpacket_ip_checksum(uint8 *buffer)->(uint8 correct)
-{
+method unpacket_ip_checksum(uint8 *buffer)->(uint8 correct) {
 	local uint16 old_ip_checksum;
 	local uint16 new_ip_checksum;
 	local uint8* ip_header_addr;
@@ -140,30 +134,27 @@ method unpacket_ip_checksum(uint8 *buffer)->(uint8 correct)
 	buffer[IP_CHECKSUM_ADDR]=0;
 	buffer[IP_CHECKSUM_ADDR+1]=0;

-	call $ip_check_sum(ip_header_addr, IP_HEADER_LENGTH)->(new_ip_checksum);
+	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;
-	if(new_ip_checksum != old_ip_checksum)
+    if(new_ip_checksum != old_ip_checksum) {
 		correct = INCORRECT;
-	else
+    } else {
 		correct = CORRECT;
+    }
 }

-method Reflect(uint64 ref,uint8 ch)->(uint64 value)
-{
+method Reflect(uint64 ref,uint8 ch)->(uint64 value) {
 	local int i;
 	value = 0;
-	for( i = 1; i < ( ch + 1 ); i++ )
-	{
+	for( i = 1; i < ( ch + 1 ); i++ ) {
 		if( (ref & 1 )== 1)
 			value |= 1 << ( ch - i );
 		ref >>= 1;
 	}
 }

-// Éú³ÉCRC32 ·­ת±í µڶþÏîÊÇ77073096
-method gen_normal_table(uint32 *table)
-{
+method gen_normal_table(uint32 *table) {
 	local uint32 gx = 0x04c11db7;
 	local uint32 temp;
 	local uint32 crc;
@@ -171,19 +162,18 @@ method gen_normal_table(uint32 *table)
 	local uint32 t1;
 	local uint32 t2;
 	local uint32 flag;
-	for(i = 0; i <= 0xFF; i++)
-	{
+
+	for (i = 0; i <= 0xFF; i++) {
 		call $Reflect(i, 8)->(temp);
 		table[i]= temp<< 24;
 		local int j;
-		for (j = 0; j < 8; j++)
-		{
+		for (j = 0; j < 8; j++) {
 			flag=table[i]&0x80000000;
 			t1=(table[i] << 1);
 			if(flag==0)
-			t2=0;
+                t2=0;
 			else
-			t2=gx;
+                t2=gx;
 			table[i] =t1^t2 ;
 		}
 		crc=table[i];
@@ -191,27 +181,26 @@ method gen_normal_table(uint32 *table)
 	}
 }

-method Reverse_Table_CRC(uint8* data, int len, uint32* table)->(uint32 crc_value)
-{
+method Reverse_Table_CRC(uint8* data, int len, uint32* table)->(uint32 crc_value) {
 	local uint32 crc = 0xffffffff;
 	local uint8 *p = data;
 	local int i;
-	for(i=0; i <len; i++)
+	for (i=0; i <len; i++) {
 		crc =  table[( crc ^( p[i]) ) & 0xff] ^ (crc >> 8);
+    }
 	crc_value =  ~crc ;
 }

-
-method crc_check(uint8 *data,uint32 size,uint32* table)
-{
+method crc_check(uint8 *data,uint32 size,uint32* table) {
 	local uint32 crc = 0xffffffff;
 	local uint32 crc_value;
 	local uint32 crc_value_temp;
 	local uint8 *p = data;
 	local uint32 *crc1;
 	local int i;
-	for(i=0; i <size-4; i++)
+	for (i = 0; i <size-4; i++) {
 		crc =  table[( crc ^( p[i]) ) & 0xff] ^ (crc >> 8);
+    }
 	crc_value =  ~crc ;
 	crc1 = cast(data+size-4,uint32*);
 	STORE_BE32(&crc_value_temp,crc_value);
@@ -219,8 +208,8 @@ method crc_check(uint8 *data,uint32 size,uint32* table)
 	log "info": "crc=%x.",*crc1;

 }
-method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check)
-{
+
+method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check) {
 	local uint32 old_crc;
 	local uint32 new_crc;
 	local uint32 crc = 0xffffffff;
@@ -229,8 +218,9 @@ method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check)
 	local uint8 *p = data;
 	local uint32 *crc1;
 	local int i;
-	for(i=0; i <size-4; i++)
+	for (i=0; i <size-4; i++) {
 		crc =  table[( crc ^( p[i]) ) & 0xff] ^ (crc >> 8);
+    }
 	crc_value =  ~crc ;
 	crc1 = cast(data+size-4,uint32*);
 	old_crc = *crc1;
@@ -239,8 +229,9 @@ method recv_crc_check(uint8 *data,uint32 size,uint32* table)->(bool check)

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

-	if(old_crc == new_crc)
+	if(old_crc == new_crc) {
 		check = true;
-	else
+    } else {
 		check = false;
-}
\ No newline at end of file
+    }
+}