mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
AsyncIP endianess fix, test with VILLASnode
This commit is contained in:
parent
c7d0f4e654
commit
de6c7f83a4
7 changed files with 1830 additions and 1798 deletions
|
@ -1,3 +1,2 @@
|
|||
#Mon Jul 14 20:43:18 CEST 2014
|
||||
eclipse.preferences.version=1
|
||||
rtprojectfile=s2ss_tests.llp
|
||||
eclipse.preferences.version=1
|
||||
rtprojectfile=villas_udp.llp
|
||||
|
|
|
@ -1,115 +1,117 @@
|
|||
[EnvVars]
|
||||
ABORT_COMPILE_WHEN_NO_BITSTREAM=0
|
||||
ACTION_AFTER_N_OVERRUNS=10
|
||||
ACTION_ON_OVERRUNS=0
|
||||
AcquisitionMemory=0,2500,24,100
|
||||
ActiveGroups=7/0/24/25/26/27/28/29/
|
||||
CACHEABLE_DMA_MEMORY_ACCESS=ON
|
||||
COMM_RT=UDP/IP
|
||||
ClockPeriodMode=Free-Clock
|
||||
ClockPeriodTime=10
|
||||
DEBUG=0
|
||||
DETECT_OVERRUNS=ON
|
||||
ENABLE_WATCHDOG=ON
|
||||
EXT_CC_OPTS=
|
||||
EXT_LD_OPTS=
|
||||
EXT_LIB=
|
||||
EXT_LIBPATH=
|
||||
MODEL_PAUSE_TIME=0.000000
|
||||
MODEL_STOP_TIME=0.000000
|
||||
MONITORING=ON
|
||||
MONITORING_BLOCK=OFF
|
||||
MONITORING_DISPLAY=NEVER
|
||||
MSG_PRECISION_FACTOR=0
|
||||
MaxDynamicSignals=2/0/100/24/100/
|
||||
NB_STEP_WITHOUT_OVERRUNS=10
|
||||
OPAL_DEBUG=OFF
|
||||
OP_MATLABR2013A=1
|
||||
OS_COMPILE_RELEASE=2.6.29.6-opalrt-5
|
||||
PRINT_LOG_LEVEL=ALWAYS
|
||||
RESET_IO_MISSING=ON
|
||||
SYSNAME=linux
|
||||
USER_INCS=
|
||||
USER_SRCS=
|
||||
WATCHDOG_TIMEOUT=5000
|
||||
[EnvVars_REDHAWK_DYN_1]
|
||||
INTERNAL_IGN_SOURCE_FILE=sfun_gen_async_ctrl.c sfun_recv_async.c sfun_send_async.c
|
||||
INTERNAL_LIBRARY2=-lOpalAsyncApiR2013a
|
||||
INTERNAL_LIBRARY3=-lOpalAsyncApiCore
|
||||
[ExtraGetFilesComp_1_RT_LAB]
|
||||
AsyncIP=Binary|Async_Proc
|
||||
[ExtraPutFilesComp]
|
||||
include\config.h=Ascii
|
||||
include\msg.h=Ascii
|
||||
include\msg_format.h=Ascii
|
||||
include\socket.h=Ascii
|
||||
include\utils.h=Ascii
|
||||
Makefile.mk=Ascii
|
||||
src\msg.c=Ascii
|
||||
src\main.c=Ascii
|
||||
src\socket.c=Ascii
|
||||
src\utils.c=Ascii
|
||||
src\compat.c=Ascii
|
||||
[ExtraPutFilesComp_1_RT_LAB]
|
||||
C:\OPAL-RT\RT-LAB\v11.0.2.410\common\lib\redhawk\libOpalAsyncApiCore.a=Binary|Other
|
||||
[ExtraPutFilesLoad_1_RT_LAB]
|
||||
.\send_receive_sm_model\OpREDHAWKtarget\AsyncIP=Binary|Async_Proc
|
||||
[General]
|
||||
ATT_CHECKSUM1=1967915764
|
||||
ATT_CHECKSUM2=1071010712
|
||||
ATT_CHECKSUM3=752104040
|
||||
ATT_CHECKSUM4=1738184673
|
||||
ATT_CREATED_BY=jwu
|
||||
ATT_CREATED_ON=Thu Apr 15 08:21:54 1999
|
||||
ATT_ENABLE_PTA=OFF
|
||||
ATT_HANDLE_CONSOLE=ON
|
||||
ATT_LAST_SAVED_BY=ACS
|
||||
ATT_LAST_SAVED_ON=Thu May 19 14:14:01 2016
|
||||
ATT_REFERENCE_MDL_PATHS=
|
||||
ATT_REVISION=1.446
|
||||
AutoRetrieveFiles=ON
|
||||
AutoRetrieveRtlab=ON
|
||||
CompilerVersion=AUTOMATIC
|
||||
DESCRIPTION=
|
||||
DinamoFlag=OFF
|
||||
FILENAME=D:\svo\s2ss\clients\opal\villas_udp\models\send_receive\send_receive.mdl
|
||||
FORCE_RECOMPILE=0
|
||||
IMPORTED_GLOBAL_VARIABLES=1
|
||||
LastCompileRtlabVersion=v11.0.2.410
|
||||
LastMatlabUsed=24
|
||||
LastMatlabUsedName=v8.1
|
||||
MATLAB_USED_IN_MODEL=21
|
||||
Name=send_receive
|
||||
PRINT_CYCLE=OFF
|
||||
PostBuildCmd=
|
||||
PreBuildCmd=
|
||||
QNX_LAST_COMPILE_VERSION=
|
||||
RH64_LAST_COMPILE_VERSION=
|
||||
RH_LAST_COMPILE_VERSION=2.6.29.6-opalrt-5
|
||||
ReportFileId=
|
||||
RetrieveBuildTree=ON
|
||||
RetrieveRootDir=
|
||||
SimulationMode=2
|
||||
TLC=Automatic
|
||||
TMF=Automatic
|
||||
TRANSFERFILE_AT_LOAD=OFF
|
||||
TargetCompileCmd=/usr/bin/make -f /usr/opalrt/common/bin/opalmodelmk
|
||||
TargetPlatform=REDHAWK
|
||||
TimeFactor=1.000000000000000
|
||||
TimeStep=0.000050000000000
|
||||
sc_consoleTimeStep=-1.000000000000000
|
||||
sm_modelTimeStep=0.000049999998737
|
||||
sm_send_receiveTimeStep=0.000049999998737
|
||||
[General_1]
|
||||
TargetPreCompileCmd=make -f /usr/opalrt/common/bin/opalmodelmk
|
||||
[NodeMapping]
|
||||
sm_model=ACS_OPAL_RT
|
||||
sm_model_CORE_ASSIGNATION=1
|
||||
sm_model_CPU=-1
|
||||
sm_model_DEBUG=OFF
|
||||
sm_model_XHP_ENABLE=FALSE
|
||||
sm_send_receive=ACS_OPAL_RT
|
||||
sm_send_receive_CORE_ASSIGNATION=1
|
||||
sm_send_receive_CPU=-1
|
||||
sm_send_receive_DEBUG=OFF
|
||||
sm_send_receive_XHP_ENABLE=FALSE
|
||||
[EnvVars]
|
||||
ABORT_COMPILE_WHEN_NO_BITSTREAM=0
|
||||
ACTION_AFTER_N_OVERRUNS=10
|
||||
ACTION_ON_OVERRUNS=0
|
||||
AcquisitionMemory=0,2500,24,100
|
||||
ActiveGroups=7/0/24/25/26/27/28/29/
|
||||
CACHEABLE_DMA_MEMORY_ACCESS=ON
|
||||
COMM_RT=UDP/IP
|
||||
ClockPeriodMode=Free-Clock
|
||||
ClockPeriodTime=10
|
||||
DEBUG=0
|
||||
DETECT_OVERRUNS=ON
|
||||
ENABLE_WATCHDOG=ON
|
||||
EXT_CC_OPTS=
|
||||
EXT_LD_OPTS=
|
||||
EXT_LIB=
|
||||
EXT_LIBPATH=
|
||||
MODEL_PAUSE_TIME=0.000000
|
||||
MODEL_STOP_TIME=0.000000
|
||||
MONITORING=ON
|
||||
MONITORING_BLOCK=OFF
|
||||
MONITORING_DISPLAY=ALL
|
||||
MSG_PRECISION_FACTOR=0
|
||||
MaxDynamicSignals=2/0/100/24/44/
|
||||
NB_STEP_WITHOUT_OVERRUNS=10
|
||||
OPAL_DEBUG=OFF
|
||||
OP_MATLABR2013A=1
|
||||
OS_COMPILE_RELEASE=2.6.29.6-opalrt-5
|
||||
PRINT_LOG_LEVEL=DEBUG_ALL
|
||||
RESET_IO_MISSING=ON
|
||||
SYSNAME=linux
|
||||
USER_INCS=
|
||||
USER_SRCS=
|
||||
WATCHDOG_TIMEOUT=5000
|
||||
[EnvVars_REDHAWK_DYN_1]
|
||||
INTERNAL_IGN_SOURCE_FILE=sfun_gen_async_ctrl.c sfun_recv_async.c sfun_send_async.c
|
||||
INTERNAL_LIBRARY2=-lOpalAsyncApiR2013a
|
||||
INTERNAL_LIBRARY3=-lOpalAsyncApiCore
|
||||
[ExtraGetFilesComp_1_RT_LAB]
|
||||
AsyncIP=Binary|Async_Proc
|
||||
[ExtraPutFilesComp]
|
||||
Makefile.mk=Ascii
|
||||
include\config.h=Ascii
|
||||
include\msg.h=Ascii
|
||||
include\msg_format.h=Ascii
|
||||
include\socket.h=Ascii
|
||||
include\utils.h=Ascii
|
||||
src\compat.c=Ascii
|
||||
src\main.c=Ascii
|
||||
src\msg.c=Ascii
|
||||
src\socket.c=Ascii
|
||||
src\utils.c=Ascii
|
||||
[ExtraPutFilesComp_1_RT_LAB]
|
||||
C:\OPAL-RT\RT-LAB\v11.0.2.410\common\lib\redhawk\libOpalAsyncApiCore.a=Binary|Other
|
||||
[ExtraPutFilesLoad_1_RT_LAB]
|
||||
.\send_receive_sm_model\OpREDHAWKtarget\AsyncIP=Binary|Async_Proc
|
||||
[General]
|
||||
ATT_CHECKSUM1=1015056539
|
||||
ATT_CHECKSUM2=1816632134
|
||||
ATT_CHECKSUM3=3154910365
|
||||
ATT_CHECKSUM4=1473207731
|
||||
ATT_CREATED_BY=jwu
|
||||
ATT_CREATED_ON=Thu Apr 15 08:21:54 1999
|
||||
ATT_ENABLE_PTA=OFF
|
||||
ATT_HANDLE_CONSOLE=ON
|
||||
ATT_LAST_SAVED_BY=opal-user
|
||||
ATT_LAST_SAVED_ON=Tue Apr 25 15:37:56 2017
|
||||
ATT_REFERENCE_MDL_PATHS=
|
||||
ATT_REVISION=1.451
|
||||
AutoRetrieveFiles=ON
|
||||
AutoRetrieveRtlab=ON
|
||||
CompilerVersion=AUTOMATIC
|
||||
DESCRIPTION=
|
||||
DinamoFlag=OFF
|
||||
FILENAME=C:\Users\opal-user\OPAL-RT\msv-ufa\villas_udp\models\send_receive\send_receive.mdl
|
||||
FORCE_RECOMPILE=0
|
||||
IMPORTED_GLOBAL_VARIABLES=1
|
||||
LastCompileRtlabVersion=v11.0.2.410
|
||||
LastMatlabUsed=24
|
||||
LastMatlabUsedName=v8.1
|
||||
MATLAB_USED_IN_MODEL=21
|
||||
Name=send_receive
|
||||
PRINT_CYCLE=OFF
|
||||
PostBuildCmd=
|
||||
PreBuildCmd=
|
||||
QNX_LAST_COMPILE_VERSION=
|
||||
RH64_LAST_COMPILE_VERSION=
|
||||
RH_LAST_COMPILE_VERSION=2.6.29.6-opalrt-5
|
||||
ReportFileId=
|
||||
RetrieveBuildTree=ON
|
||||
RetrieveRootDir=
|
||||
SimulationMode=2
|
||||
TLC=Automatic
|
||||
TMF=Automatic
|
||||
TRANSFERFILE_AT_LOAD=OFF
|
||||
TargetCompileCmd=/usr/bin/make -f /usr/opalrt/common/bin/opalmodelmk
|
||||
TargetPlatform=REDHAWK
|
||||
TimeFactor=1.000000000000000
|
||||
TimeStep=0.000050000000000
|
||||
sc_consoleTimeStep=-1.000000000000000
|
||||
sm_modelTimeStep=0.000049999998737
|
||||
sm_send_receiveTimeStep=0.000049999998737
|
||||
[General_1]
|
||||
TargetPreCompileCmd=make -f /usr/opalrt/common/bin/opalmodelmk
|
||||
[NodeMapping]
|
||||
sm_model=ACS_OPAL_RT
|
||||
sm_model_CORE_ASSIGNATION=1
|
||||
sm_model_CPU=-1
|
||||
sm_model_DEBUG=OFF
|
||||
sm_model_XHP_ENABLE=FALSE
|
||||
sm_send_receive=ACS_OPAL_RT
|
||||
sm_send_receive_CORE_ASSIGNATION=1
|
||||
sm_send_receive_CPU=-1
|
||||
sm_send_receive_DEBUG=OFF
|
||||
sm_send_receive_XHP_ENABLE=FALSE
|
||||
[UserEnvVars]
|
||||
PROTOCOL=GTNET_SKT
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -112,8 +112,11 @@ static void * SendToIPPort(void *arg)
|
|||
|
||||
len = MSG_LEN(msg->length);
|
||||
#elif PROTOCOL == GTNET_SKT
|
||||
for (int i = 0; i < cnt; i++)
|
||||
uint32_t *imsg = (uint32_t *) msg;
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
msg[i] = (float) mdldata[i];
|
||||
imsg[i] = htonl(imsg[i]);
|
||||
}
|
||||
|
||||
len = mdldata_size / sizeof(double) * sizeof(float);
|
||||
#else
|
||||
|
@ -199,7 +202,7 @@ static void * RecvFromIPPort(void *arg)
|
|||
|
||||
#if PROTOCOL == VILLAS
|
||||
msg_ntoh(msg);
|
||||
|
||||
|
||||
ret = msg_verify(msg);
|
||||
if (ret) {
|
||||
OpalPrint("%s: Skipping invalid packet\n", PROGNAME);
|
||||
|
@ -217,6 +220,10 @@ static void * RecvFromIPPort(void *arg)
|
|||
/* Update OPAL model */
|
||||
OpalSetAsyncRecvIconStatus(msg->sequence, RecvID); /* Set the Status to the message ID */
|
||||
#elif PROTOCOL == GTNET_SKT
|
||||
uint32_t *imsg = (uint32_t *) msg;
|
||||
for (int i = 0; i < cnt; i++)
|
||||
imsg[i] = ntohl(imsg[i]);
|
||||
|
||||
for (int i = 0; i < cnt; i++)
|
||||
mdldata[i] = (double) msg[i];
|
||||
#else
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<?xml version="1.0" ?>
|
||||
<Project>
|
||||
<General>
|
||||
<att_name>s2ss_tests</att_name>
|
||||
<att_description>This is a project!</att_description>
|
||||
<att_ip_address>134.130.169.90:25252</att_ip_address>
|
||||
<att_hashcode>C2357876-6DB6-422F-ABD4-AB47963523A2</att_hashcode>
|
||||
<att_autosave>ON</att_autosave>
|
||||
<att_filename>D:\svo\s2ss\clients\opal\villas_udp\villas_udp.llp</att_filename>
|
||||
</General>
|
||||
<Models>
|
||||
<Model>
|
||||
<Path>
|
||||
<Relative>models/send_receive/send_receive.mdl</Relative>
|
||||
<Absolute>D:/svo/s2ss/clients/opal/villas_udp/models/send_receive/send_receive.mdl</Absolute>
|
||||
<UNC>//E265/D/svo/s2ss/clients/opal/villas_udp/models/send_receive/send_receive.mdl</UNC>
|
||||
</Path>
|
||||
</Model>
|
||||
</Models>
|
||||
</Project>
|
||||
<?xml version="1.0" ?>
|
||||
<Project>
|
||||
<General>
|
||||
<att_name>villas_udp</att_name>
|
||||
<att_description>This is a project!</att_description>
|
||||
<att_ip_address>134.130.169.16:25252</att_ip_address>
|
||||
<att_hashcode>7B042784-8CF2-444A-92E3-8457E429E28A</att_hashcode>
|
||||
<att_autosave>ON</att_autosave>
|
||||
<att_filename>C:\Users\opal-user\OPAL-RT\msv-ufa\villas_udp\villas_udp.llp</att_filename>
|
||||
</General>
|
||||
<Models>
|
||||
<Model>
|
||||
<Path>
|
||||
<Relative>models/send_receive/send_receive.mdl</Relative>
|
||||
<Absolute>C:/Users/opal-user/OPAL-RT/msv-ufa/villas_udp/models/send_receive/send_receive.mdl</Absolute>
|
||||
<UNC>C:/Users/opal-user/OPAL-RT/msv-ufa/villas_udp/models/send_receive/send_receive.mdl</UNC>
|
||||
</Path>
|
||||
</Model>
|
||||
</Models>
|
||||
</Project>
|
||||
|
|
24
etc/gtnet-skt/emulate_gtnet.conf
Normal file
24
etc/gtnet-skt/emulate_gtnet.conf
Normal file
|
@ -0,0 +1,24 @@
|
|||
/** GTNET-SKT test configuration.
|
||||
*
|
||||
* The syntax of this file is similar to JSON.
|
||||
* A detailed description of the format can be found here:
|
||||
* http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
|
||||
*
|
||||
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
||||
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
|
||||
*********************************************************************************/
|
||||
|
||||
stats = 1;
|
||||
debug = 10;
|
||||
|
||||
nodes = {
|
||||
node1 = {
|
||||
type = "socket",
|
||||
layer = "udp",
|
||||
local = "*:12000", # Local ip:port, use '*' for random port
|
||||
remote = "134.130.169.80:12001",
|
||||
header = "none", # 'gtnet-skt' or 'villas'. If not provided, 'villas' header will be used
|
||||
endian = "big", # Can be 'little' or 'small'. If not provided (default), little endianness logic will be applied
|
||||
vectorize = 1, # Number of samples to fetch per iteration from the socket
|
||||
}
|
||||
};
|
|
@ -297,12 +297,12 @@ static int socket_read_none(struct node *n, struct sample *smps[], unsigned cnt)
|
|||
}
|
||||
else {
|
||||
smp->sequence = n->sequence++; /* Fake sequence no generated by VILLASnode */
|
||||
smp->ts.origin.tv_sec = -1;
|
||||
smp->ts.origin.tv_nsec = -1;
|
||||
smp->ts.origin.tv_sec = 0;
|
||||
smp->ts.origin.tv_nsec = 0;
|
||||
}
|
||||
|
||||
smp->ts.received.tv_sec = -1;
|
||||
smp->ts.received.tv_nsec = -1;
|
||||
smp->ts.received.tv_sec = 0;
|
||||
smp->ts.received.tv_nsec = 0;
|
||||
|
||||
smp->length = length;
|
||||
|
||||
|
@ -700,4 +700,4 @@ static struct plugin p = {
|
|||
}
|
||||
};
|
||||
|
||||
REGISTER_PLUGIN(&p)
|
||||
REGISTER_PLUGIN(&p)
|
||||
|
|
Loading…
Add table
Reference in a new issue