Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ wheels/

# OS-X files
.DS_Store

# Docker image tarballs
*.tar
37 changes: 37 additions & 0 deletions codesys-hde2e/Dockerfile_codesyscontrol_virtuallinux_4.18.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###############################################################################
# Copyright CODESYS Development GmbH
###############################################################################

# The referenced base image in this file can be downloaded from the Homepage of OSADL. The base image is a binary-only image for delayed source code delivery.
# https://www.osadl.org/OSADL-Container-Base-Image.osadl-container-base-image.0.html?&no_cache=1&sword_list%5B0%5D=docker
# Add it to your own registry and replace the FROM statement with your URL.
# Alteratively you can directly pull the base image for immediate source code delivery with all sources directly from docker-hub.
# To do that replace the FROM statement with:
FROM osadl/debian-docker-base-image:bookworm-amd64-latest

#FROM repoman.codesys.com:50000/config/standard/osadl-bin/debian/amd64/bookworm:develop

ENV CONTAINER=true

USER root
ENV USER=root

EXPOSE 443
EXPOSE 4840
EXPOSE 8080
EXPOSE 11740

RUN apt-get update && apt-get install -y procps libcap2-bin libpciaccess0 \
intel-cmt-cat python3 python3-pip python3-yaml \
&& apt-get source --download-only libcap2 procps libpciaccess 2>/dev/null \
&& rm -rf /var/lib/apt/lists/*

ARG CODESYSCONTROL_DEB=codesyscontrol_virtuallinux_4.18.0.0*_amd64.deb
ADD ${CODESYSCONTROL_DEB} /tmp/
ADD Docker_copyright_* /

RUN cd /tmp; cd /tmp; dpkg -i ${CODESYSCONTROL_DEB}; rm ${CODESYSCONTROL_DEB};

WORKDIR /var/opt/codesys/
ENTRYPOINT [ "/opt/codesys/scripts/startup.sh" ]
CMD []
Binary file not shown.
28 changes: 28 additions & 0 deletions codesys-hde2e/configs/control/CODESYSControl_User.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;virtuallinux
[CmpLog]
Logger.0.Filter=0x0000000F

[ComponentManager]
Component.1=CmpBACnet
Component.2=CmpBACnet2
Component.3=CmpPLCHandler
Component.4=CmpGwClient
Component.5=CmpXMLParser
Component.6=CmpGwClientCommDrvTcp
Component.7=CmpRetain
;Component.8=CmpGwClientCommDrvShm ; enable only if necessary, can result in higher cpu load
;Component.9=SysPci ; enable when using Hilscher CIFX
;Component.10=CmpHilscherCIFX ; enable when using Hilscher CIFX

[CmpApp]
Bootproject.RetainMismatch.Init=1
;RetainType.Applications=InSRAM
Application.1=Control

[CmpRedundancyConnectionIP]

[CmpRedundancy]

[CmpSrv]

[IoDrvEtherCAT]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"plcName": "Control_PLC_01",
"controller": [
{
"name": "Controller_01",
"pub": [
{
"ip": "192.168.10.15",
"pubId": 11,
"wrGroupId": 13,
"dataSetId": 110,
"task": {
"Name": "PubSubTask",
"Interval": 500,
"Priority": 1
}
}
],
"sub": [
{
"ip": "192.168.10.15",
"pubId": 12,
"wrGroupId": 14,
"dataSetId": 100,
"task": null
}
],
"processing": {
"iterations": 10,
"task": {
"Name": "ProcessingTask",
"Interval": 5000,
"Priority": 2
}
},
"logging": {
"enabled": true,
"task": {
"Name": "FileLoggingTask",
"Interval": 50000,
"Priority": 5
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"plcName": "Control_PLC_02",
"controller": [
{
"name": "Controller_02",
"pub": [
{
"ip": "192.168.10.16",
"pubId": 21,
"wrGroupId": 23,
"dataSetId": 110,
"task": {
"Name": "PubSubTask",
"Interval": 500,
"Priority": 1
}
}
],
"sub": [
{
"ip": "192.168.10.16",
"pubId": 22,
"wrGroupId": 24,
"dataSetId": 100,
"task": null
}
],
"processing": {
"iterations": 10,
"task": {
"Name": "ProcessingTask",
"Interval": 5000,
"Priority": 2
}
},
"logging": {
"enabled": true,
"task": {
"Name": "FileLoggingTask",
"Interval": 50000,
"Priority": 5
}
}
}
]
}
28 changes: 28 additions & 0 deletions codesys-hde2e/configs/io/CODESYSControl_User.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
;virtuallinux
[CmpLog]
Logger.0.Filter=0x0000000F

[ComponentManager]
Component.1=CmpBACnet
Component.2=CmpBACnet2
Component.3=CmpPLCHandler
Component.4=CmpGwClient
Component.5=CmpXMLParser
Component.6=CmpGwClientCommDrvTcp
Component.7=CmpRetain
;Component.8=CmpGwClientCommDrvShm ; enable only if necessary, can result in higher cpu load
;Component.9=SysPci ; enable when using Hilscher CIFX
;Component.10=CmpHilscherCIFX ; enable when using Hilscher CIFX

[CmpApp]
Bootproject.RetainMismatch.Init=1
;RetainType.Applications=InSRAM
Application.1=IO

[CmpRedundancyConnectionIP]

[CmpRedundancy]

[CmpSrv]

[IoDrvEtherCAT]
45 changes: 45 additions & 0 deletions codesys-hde2e/configs/io/hdE2ELatencyConfig_IO_PLC_01.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"plcName": "IO_PLC_01",
"io": [
{
"name": "IO_01",
"pub": [
{
"ip": "192.168.10.12",
"pubId": 12,
"wrGroupId": 14,
"dataSetId": 100,
"task": {
"Name": "PubSubTask",
"Interval": 500,
"Priority": 1
}
}
],
"sub": [
{
"ip": "192.168.10.12",
"pubId": 11,
"wrGroupId": 13,
"dataSetId": 110,
"task": null
}
],
"benchmarking": {
"task": {
"Name": "BenchmarkingTask",
"Interval": 500,
"Priority": 2
}
},
"logging": {
"enabled": true,
"task": {
"Name": "FileLoggingTask",
"Interval": 50000,
"Priority": 5
}
}
}
]
}
45 changes: 45 additions & 0 deletions codesys-hde2e/configs/io/hdE2ELatencyConfig_IO_PLC_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"plcName": "IO_PLC_02",
"io": [
{
"name": "IO_02",
"pub": [
{
"ip": "192.168.10.13",
"pubId": 22,
"wrGroupId": 24,
"dataSetId": 100,
"task": {
"Name": "PubSubTask",
"Interval": 500,
"Priority": 1
}
}
],
"sub": [
{
"ip": "192.168.10.13",
"pubId": 21,
"wrGroupId": 23,
"dataSetId": 110,
"task": null
}
],
"benchmarking": {
"task": {
"Name": "BenchmarkingTask",
"Interval": 500,
"Priority": 2
}
},
"logging": {
"enabled": true,
"task": {
"Name": "FileLoggingTask",
"Interval": 50000,
"Priority": 5
}
}
}
]
}
78 changes: 78 additions & 0 deletions codesys-hde2e/configs/rdt_config_control.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# RDT/CAT Configuration for Control PLCs
# Based on Intel Cache Allocation Technology (CAT) / Resource Director Technology (RDT)

# Global RDT Settings
rdt:
enabled: true
interface: "os" # Use OS interface (resctrl) - required for PID assignment
reset_before_apply: true # Reset RDT configuration before applying new settings

# Class of Service (COS) Definitions
# Class 0 is default, Classes 1-15 can be configured (hardware dependent)
classes:
# Class 1: Real-time Control PLC cores with dedicated L3 cache
- id: 1
name: "RT_Control_Cores"
description: "Real-time cores for Control PLC with dedicated cache allocation"
# L3 cache mask (hex): 0x0f = lower 4 ways of L3 cache (bits 0-3)
# Adjust based on your processor's cache configuration
l3_mask: "0x0f"
# L2 cache mask (optional, if supported by hardware)
# l2_mask: "0xf"
# Memory Bandwidth Allocation (percentage, optional)
mba: 100
# CPU cores assigned to this class
cores: [3, 5, 7, 9]
# PIDs will be assigned dynamically based on container
pids: []

# Class 2: Non-real-time cores with shared cache
- id: 2
name: "Non_RT_Cores"
description: "Non-real-time cores with shared cache"
# L3 cache mask: 0xf0 = upper 4 ways of L3 cache (bits 4-7)
l3_mask: "0xf0"
mba: 50
cores: [0, 1, 2, 4, 6, 8]
pids: []

# IRQ Affinity Configuration
irq_affinity:
enabled: true
# Cores for handling interrupts (non-RT cores to avoid RT interference)
irq_cores: "0,1,2"
# Move RCU tasks to non-RT cores
rcu_cores: "0,1,2"

# Core Isolation Settings
core_isolation:
# RT cores that should be isolated
isolated_cores: [3, 5, 7, 9]
# Kernel parameters that should be set (add to kernel cmdline):
# isolcpus=3,5,7,9
# nohz_full=3,5,7,9
# rcu_nocbs=3,5,7,9
# irqaffinity=0,1,2

# Instance-specific settings for Control PLCs
instances:
Control_PLC_01:
class_id: 1
cpu_affinity: "3,5" # Specific cores for this instance
priority: 95 # RT priority (1-99, higher = more priority)
enable_rdtset: true # Use rdtset wrapper when starting CODESYS

Control_PLC_02:
class_id: 1
cpu_affinity: "7,9" # Different cores for second instance
priority: 95
enable_rdtset: true

# Monitoring Configuration
monitoring:
enabled: false
interval: 1 # seconds
metrics:
- llc_occupancy # Last Level Cache occupancy
- mbm_local # Memory Bandwidth Monitoring - local
- mbm_total # Memory Bandwidth Monitoring - total
Loading
Loading