From 4a624aa9298edd0bdb4a517298b696a5b794ae2a Mon Sep 17 00:00:00 2001 From: Martino Ferrari Date: Thu, 22 Jan 2026 01:26:24 +0100 Subject: [PATCH] better indexing --- examples/test_app.marte | 6414 ++++++++++++++++++++++++ test/validator_signal_test.go | 73 + test/validator_signals_content_test.go | 59 + 3 files changed, 6546 insertions(+) create mode 100644 examples/test_app.marte create mode 100644 test/validator_signal_test.go create mode 100644 test/validator_signals_content_test.go diff --git a/examples/test_app.marte b/examples/test_app.marte new file mode 100644 index 0000000..ec24a7d --- /dev/null +++ b/examples/test_app.marte @@ -0,0 +1,6414 @@ ++NiDevice = { + Class = NI9157Device + NiRioDeviceName = "RIO0" + NiRioSerialNumber = "0x01E4B4D5" + NiRioGenFile = "/opt/codac/ampegon-ps-tb/BitStreams/AmpegonPsTb_NI9159_V2.lvbitx" + NiRioGenSignature = "455F662BA8258B060FD324C9DEF38604" + Open = 1 + Run = 1 + Reset = 1 + Clear = 1 + ResetPostSleepMs = 120 +} + ++StateMachine = { + Class = StateMachine + +INITIAL = { + Class = ReferenceContainer + +START = { + Class = StateMachineEvent + NextState = "PRE_CFG" + NextStateError = "ERROR" + Timeout = 0 + +OpenDANWriterT1 = { + Class = Message + Destination = "TbTestApp.Data.DANWriterT1" + Function = OpenStream + Mode = ExpectsReply + } + +OpenDANWriterT2 = { + Class = Message + Destination = "TbTestApp.Data.DANWriterT2" + Function = OpenStream + Mode = ExpectsReply + } + +OpenDANWriterT3 = { + Class = Message + Destination = "TbTestApp.Data.DANWriterT3" + Function = OpenStream + Mode = ExpectsReply + } + +ChangeToStateIdleMsg = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = PreCfg + } + } + +StartNextStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StartNextStateExecution + Mode = ExpectsReply + } + } + } + +PRE_CFG = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 1 + } + } + // Enable DANWriterWriteT1 + +EnableDANWriterWriteT1 = { + Class = Message + Destination = TbTestApp.Functions.DANWriterWriteEnable + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = DANWriterEnable_DDB1 + SignalValue = 1 + } + } + } + +GOTO_MXI_CFG = { + Class = StateMachineEvent + NextState = "MXI_CFG" + NextStateError = "ERROR" + Timeout = 0 + // Prepare Next State + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareRun = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = MxiCfg + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + +GOTO_CFG_ERROR = { + Class = StateMachineEvent + NextState = "CFG_ERROR" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareCfgError = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = CfgError + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +MXI_CFG = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 2 + } + } + // Trigger MXIConfigurationSupervisor Configuration + +MxiCfgSup_MsgMode_1 = { + Class = Message + Destination = TbTestApp.Functions.MXIConfigurationSupervisor + Function = MXIOperation + +Parameters = { + Class = ConfigurationDatabase + param1 = 1 + param2 = null + param3 = null + param4 = null + } + } + } + +GOTO_PLC_CFG = { + Class = StateMachineEvent + NextState = "PLC_CFG" + NextStateError = "ERROR" + Timeout = 0 + // Prepare Next State + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareRun = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = PlcCfg + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + +GOTO_CFG_ERROR = { + Class = StateMachineEvent + NextState = "CFG_ERROR" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareCfgError = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = CfgError + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +PLC_CFG = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 3 + } + } + // Trigger PLCConfigurationSupervisor Configuration + +PlcCfgSup_MsgMode_0 = { + Class = Message + Destination = TbTestApp.Functions.PlcConfigurationSupervisor + Function = TriggerSelected + +Parameters = { + Class = ConfigurationDatabase + param1 = 0 + param2 = null + param3 = null + param4 = null + } + } + } + +GOTO_TEST_RUN = { + Class = StateMachineEvent + NextState = "TEST_RUN" + NextStateError = "ERROR" + Timeout = 0 + // Prepare Next State + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareRun = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = TestRun + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + +GOTO_CFG_ERROR = { + Class = StateMachineEvent + NextState = "CFG_ERROR" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareCfgError = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = CfgError + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +TEST_RUN = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 4 + } + } + } + +GOTO_TEST_POST = { + Class = StateMachineEvent + NextState = "TEST_POST" + NextStateError = "ERROR" + Timeout = 0 + // Prepare Next State + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareTestPost = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = TestPost + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +TEST_POST = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 5 + } + } + } + +GOTO_TEST_DONE = { + Class = StateMachineEvent + NextState = "TEST_DONE" + NextStateError = "ERROR" + Timeout = 0 + // Trigger PLCConfigurationSupervisor Disable + // Not used in this test + // Trigger MXIConfigurationSupervisor Disable + +MxiCfgSup_MsgMode_2 = { + Class = Message + Destination = TbTestApp.Functions.MXIConfigurationSupervisor + Function = MXIOperation + +Parameters = { + Class = ConfigurationDatabase + param1 = 2 + param2 = null + param3 = null + param4 = null + } + } + // Flush DANWriterT2 + +FlushDANWriterT2 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT2 + Function = CloseStream + Mode = ExpectsReply + } + // Flush FileWriterBufferT2 + +FlushFileWriterBufferT2 = { + Class = Message + Destination = TbTestApp.Data.FileWriterBufferT2 + Function = FlushFile + Mode = ExpectsReply + } + // Flush DANWriterT3 + +FlushDANWriterT3 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT3 + Function = CloseStream + Mode = ExpectsReply + } + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareTestDone = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = TestDone + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +TEST_DONE = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 7 + } + } + } + +TEST_DONE_TASKS = { + Class = StateMachineEvent + NextState = "TEST_DONE" + NextStateError = "ERROR" + Timeout = 0 + // Disable DANWriterWriteT1 + +DisableDANWriterWriteT1 = { + Class = Message + Destination = TbTestApp.Functions.DANWriterWriteEnable + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = DANWriterEnable_DDB1 + SignalValue = 0 + } + } + // Flush DANWriterT1 + +FlushDANWriterT1 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT1 + Function = CloseStream + Mode = ExpectsReply + } + } + +GOTO_PRE_CFG = { + Class = StateMachineEvent + NextState = "PRE_CFG" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PreparePreCfg = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = PreCfg + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +CFG_ERROR = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 8 + } + } + // Trigger PLCConfigurationSupervisor Disable + // Not used in this test + // Trigger MXIConfigurationSupervisor Disable + +MxiCfgSup_MsgMode_2 = { + Class = Message + Destination = TbTestApp.Functions.MXIConfigurationSupervisor + Function = MXIOperation + +Parameters = { + Class = ConfigurationDatabase + param1 = 2 + param2 = null + param3 = null + param4 = null + } + } + // Disable DANWriterWriteT1 + +DisableDANWriterWriteT1 = { + Class = Message + Destination = TbTestApp.Functions.DANWriterWriteEnable + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = DANWriterEnable_DDB1 + SignalValue = 0 + } + } + // Flush DANWriterTreeT1 + +FlushDANWriterT1 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT1 + Function = CloseStream + Mode = ExpectsReply + } + // Flush DANWriterTreeT2 + +FlushDANWriterT2 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT2 + Function = CloseStream + Mode = ExpectsReply + } + // Flush FileWriterBufferT2 + +FlushFileWriterBufferT2 = { + Class = Message + Destination = TbTestApp.Data.FileWriterBufferT2 + Function = FlushFile + Mode = ExpectsReply + } + // Flush DANWriterTreeT3 + +FlushDANWriterT3 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT3 + Function = CloseStream + Mode = ExpectsReply + } + } + +GOTO_PRE_CFG = { + Class = StateMachineEvent + NextState = "PRE_CFG" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PreparePreCfg = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = PreCfg + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } + +ERROR = { + Class = ReferenceContainer + +ENTER = { + Class = ReferenceContainer + // Set Current State + +SetCurrentState = { + Class = Message + Destination = TbTestApp.Functions.AppStateMachineState + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = SMState_DDB1 + SignalValue = 9 + } + } + // Trigger PLCConfigurationSupervisor Disable + // Not used in this test + // Trigger MXIConfigurationSupervisor Disable + +MxiCfgSup_MsgMode_2 = { + Class = Message + Destination = TbTestApp.Functions.MXIConfigurationSupervisor + Function = MXIOperation + +Parameters = { + Class = ConfigurationDatabase + param1 = 2 + param2 = null + param3 = null + param4 = null + } + } + // Disable DANWriterWriteT1 + +DisableDANWriterWriteT1 = { + Class = Message + Destination = TbTestApp.Functions.DANWriterWriteEnable + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = DANWriterEnable_DDB1 + SignalValue = 0 + } + } + // Flush DANWriterTreeT1 + +FlushDANWriterT1 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT1 + Function = CloseStream + Mode = ExpectsReply + } + // Flush DANWriterTreeT2 + +FlushDANWriterT2 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT2 + Function = CloseStream + Mode = ExpectsReply + } + // Flush FileWriterBufferT2 + +FlushFileWriterBufferT2 = { + Class = Message + Destination = TbTestApp.Data.FileWriterBufferT2 + Function = FlushFile + Mode = ExpectsReply + } + // Flush DANWriterTreeT3 + +FlushDANWriterT3 = { + Class = Message + Destination = TbTestApp.Data.DANWriterT3 + Function = CloseStream + Mode = ExpectsReply + } + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PrepareError = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = Error + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + +GOTO_PRE_CFG = { + Class = StateMachineEvent + NextState = "PRE_CFG" + NextStateError = "ERROR" + Timeout = 0 + +StopCurrentStateExecutionMsg = { + Class = Message + Destination = TbTestApp + Function = StopCurrentStateExecution + Mode = ExpectsReply + } + +PreparePreCfg = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = PrepareNextState + +Parameters = { + Class = ConfigurationDatabase + param1 = PreCfg + } + } + +GoToNextState = { + Class = Message + Destination = TbTestApp + Mode = ExpectsReply + Function = StartNextStateExecution + } + } + } +} + +$TbTestApp = { + Class = RealTimeApplication + +Functions = { + Class = ReferenceContainer + + // ----------- T1 START ----------- // + // Slow Timer Thread - Configuration and monitoring + // ------ TIMER ------ // + +Timer = { + Class = IOGAM + InputSignals = { + Counter = { + DataSource = Timer + Type = uint32 + } + Time = { + Frequency = 100 + DataSource = Timer + Type = uint32 + } + AbsoluteTime = { + DataSource = Timer + Type = uint64 + } + } + OutputSignals = { + Counter_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Time_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + AbsTimeSrc_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + + +CurrentTime_T1 = { + Class = SystemClockGAM + OutputSignals = { + AbsTimeT1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + + +TimeConverter = { + Class = AbsTimeConverterGAM + InputSignals = { + AbsTimeSrc_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + OutputSignals = { + AbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + // ------------------- // + + // ----- RX PATH ----- // + +MXIRead = { + Class = IOGAM + InputSignals = { + hl_tx_spi_done = { + DataSource = MXIRegistersRead + Type = bool + NumberOfElements = 1 + Trigger = 1 + } + hl_rx_spi_done = { + DataSource = MXIRegistersRead + Type = bool + NumberOfElements = 1 + } + dsc_ao_0_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_ao_1_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_ao_2_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_mo_0_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_mo_1_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_do_n_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_fs_0_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_fs_1_ctr_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_full_mod_out = { + DataSource = MXIRegistersRead + Type = uint8 + NumberOfElements = 1 + } + dsc_acq_en_out = { + DataSource = MXIRegistersRead + Type = bool + NumberOfElements = 1 + } + dsc_ts_status = { + DataSource = MXIRegistersRead + Type = bool + NumberOfElements = 1 + } + dsc_ts_out = { + DataSource = MXIRegistersRead + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + MXI_HL_TX_SPI_DONE_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_HL_RX_SPI_DONE_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_DSC_AO_0_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_AO_1_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_AO_2_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_MO_0_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_MO_1_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_DO_N_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_FS_0_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_FS_1_CTR_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_FULL_MOD_OUT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DSC_ACQ_EN_OUT_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_DSC_TS_STATUS_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_DSC_TS_OUT_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + } + } + + +MXIModuleFullFlagSplitter = { + Class = BitSplitterGAM + InputSignals = { + DigitalSignal = { + Alias = MXI_DSC_FULL_MOD_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Bit_0 = { + Alias = MXI_DSC_AO_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_1 = { + Alias = MXI_DSC_AO_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_2 = { + Alias = MXI_DSC_AO_2_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_3 = { + Alias = MXI_DSC_MO_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_4 = { + Alias = MXI_DSC_MO_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_5 = { + Alias = MXI_DSC_DO_N_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_6 = { + Alias = MXI_DSC_FS_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + Bit_7 = { + Alias = MXI_DSC_FS_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + } + } + } + + +MXIMasterTime = { + Class = TimeArrayGAM + TimePerTicks = 25 + TimeStep = 500 + InputSignals = { + MXI_DSC_TS_OUT_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + MXIAbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + + +PlcPacketRx = { + Class = IOGAM + InputSignals = { + PlcReceivedAbsTime = { + DataSource = SdnPlcSub + Alias = Header + NumberOfElements = 48 + Type = uint8 + Ranges = {{32, 39}} + Trigger = 1 + } + PLC_HEADER = { + DataSource = SdnPlcSub + Type = uint8 + NumberOfElements = 8 + } + ACK_CFG = { + DataSource = SdnPlcSub + Type = uint8 + NumberOfElements = 1 + } + ACK_SMC = { + DataSource = SdnPlcSub + Type = uint8 + NumberOfElements = 1 + } + STATE_CFG = { + DataSource = SdnPlcSub + Type = uint8 + NumberOfElements = 1 + } + STATE_SMC = { + DataSource = SdnPlcSub + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + PlcPacketRx_AbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + PlcPacketRx_HEADER_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 8 + NumberOfDimensions = 1 + } + PlcPacketRx_ACK_CFG_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcPacketRx_ACK_SMC_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcPacketRx_STATE_CFG_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcPacketRx_STATE_SMC_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + // ------------------- // + + // ---- CONST GAM ---- // + +AppStateMachineState = { + Class = ConstantGAM + OutputSignals = { + SMState_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + } + } + + +DANWriterWriteEnable = { + Class = ConstantGAM + OutputSignals = { + DANWriterEnable_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + } + } + + +MXISupervisorVariables = { + Class = ConstantGAM + OutputSignals = { + MXIConfigurationSupervisor_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + MXIConfigurationSupervisor_Mode_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + } + } + + +MXIBaseConfigurationVariables = { + Class = ConstantGAM + OutputSignals = { + MXI_RST_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + Default = 1 + } + MXI_HL_TX_1_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_TX_2_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_TX_3_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_TX_OPT_TRG_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + Default = 1 + } + MXI_HL_RX_1_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_2_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_3_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_4_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_5_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_6_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_7_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 4 + } + MXI_HL_RX_OPT_TRG_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + Default = 1 + } + MXI_DBG_EN_SEL_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + Default = 1 + } + MXI_DBG_EN_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + Default = 0 + } + } + } + + +MXIDsFifoAcqEnVariables = { + Class = ConstantGAM + OutputSignals = { + MXI_ACQ_EN_PAT_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + Default = 0xAAAAAAAAAAAAAAAA + } + } + } + + +PlcPacketTxVariables = { + Class = ConstantGAM + OutputSignals = { + PlcPacketTx_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 0 + } + PlcPacketTx_Select_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 0 + } + PlcPacketTx_HeaderNF_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 11 + } + PlcPacketTx_HeaderNI_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 10 + } + PlcPacketTx_HeaderNC_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 2 + } + PlcPacketTx_HeaderNS_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 0 + } + PlcPacketTx_HeaderNA_DDB1 = { + DataSource = DDB1 + Type = uint8 + Default = 0 + } + PlcPacketTx_HeaderS_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfDimensions = 1 + NumberOfElements = 3 + Default = {0 0 0} + } + } + } + + +StateMachineTasksDelay = { + Class = ConstantGAM + OutputSignals = { + CycleCounterReset_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + DelayCycles_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + Default = 50 + } + } + } + + +AcquisitionStatusDaq = { + Class = ConstantGAM + OutputSignals = { + AcquisitionStatusT2_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + } + } + + +AcquisitionStatusDbg = { + Class = ConstantGAM + OutputSignals = { + AcquisitionStatusT3_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + Default = 0 + } + } + } + // ------------------- // + + // ---- FLOW CTRL ---- // + +MXIConfigurationSupervisor = { + Class = MXIConfigurationSupervisorGAM + InputSignals = { + // --- Trigger Signals --- // + TriggerInput = { + Alias = MXIConfigurationSupervisor_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + ModeInput = { + Alias = MXIConfigurationSupervisor_Mode_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // --- Monitor Signals --- // + // Base Configuration + BaseDone = { + Alias = MXIBaseConfigurationDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + BaseStatus = { + Alias = MXIBaseConfigurationStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Acquisition Enable + AcqEnDone = { + Alias = MXIAcquisitionEnableDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AcqEnStatus = { + Alias = MXIAcquisitionEnableStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Triplet Configuration + TripletDone = { + Alias = MXITripletConfigurationDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TripletStatus = { + Alias = MXITripletConfigurationStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + // --- Trigger Signals --- // + // Base Configuration + BaseTrigger = { + Alias = MXIBaseConfiguration_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + BaseMode = { + Alias = MXIBaseConfiguration_Mode_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Acquisition Configuration + AcqTrigger = { + Alias = MXIAcquisitionEnable_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Triplet Configuration + TripletTrigger = { + Alias = MXITripletConfiguration_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Status Signals + CfgDone = { + Alias = MXIConfigurationSupervisor_Done_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgError = { + Alias = MXIConfigurationSupervisor_Error_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgStatus = { + Alias = MXIConfigurationSupervisor_Status_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +MXIBaseConfiguration = { + Class = MXIBaseConfigurationGAM + ConfigurationStepTimeOutMs = 50 + InputSignals = { + // Timer and activation signals + TimerAbsTimeUs = { + Alias = AbsTime_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + TriggerInput = { + Alias = MXIBaseConfiguration_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + ModeInput = { + Alias = MXIBaseConfiguration_Mode_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Monitoring Signals + HlTxDone = { + Alias = MXI_HL_TX_SPI_DONE_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + HlRxDone = { + Alias = MXI_HL_RX_SPI_DONE_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + DscStatus = { + Alias = MXI_DSC_TS_STATUS_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + // Trigger Signals + TriggerReset = { + Alias = Trigger_MXIWriteRst_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TriggerHotLink = { + Alias = Trigger_MXIWriteHlOpt_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TriggerEnable = { + Alias = Trigger_MXIWriteEn_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TriggerDebug = { + Alias = Trigger_MXIWriteDbg_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Data Signals + Enable = { + Alias = MXI_EN_IN_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + // Status Signals + CfgDone = { + Alias = MXIBaseConfigurationDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgStatus = { + Alias = MXIBaseConfigurationStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +MXIAcquisitionEnable = { + Class = MXIAcquisitionEnableGAM + ConfigurationStepTimeOutMs = 50 + InputSignals = { + // Timer and activation signals + TimerAbsTimeUs = { + Alias = AbsTime_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + TriggerInput = { + Alias = MXIAcquisitionEnable_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Monitoring Signals + AcqEnStatus = { + Alias = MXI_DSC_ACQ_EN_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + // Trigger Signals + TriggerAcquisition = { + Alias = Trigger_MXIWriteIDsFifoAcqEn_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Status Signals + CfgDone = { + Alias = MXIAcquisitionEnableDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgStatus = { + Alias = MXIAcquisitionEnableStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +MXITripletConfiguration = { + Class = MXITripletConfigurationGAM + ConfigurationStepTimeOutMs = 5000 + ReplayEvents = 3 + +Channels = { + Class = ReferenceContainer + +AnalogueOutput_0 = { + Class = TripletsContainer + Type = AnalogueOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 1, 0x3FFF0000, 0x2000}, + { 2, 5100000000, 0x00036FF2, 0x3ADA}, + { 3, 5200000000, 0x00036FF2, 0x2000} + } + } + +AnalogueOutput_1 = { + Class = TripletsContainer + Type = AnalogueOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 1, 0x3FFF0000, 0x2000}, + { 2, 5140000000, 0x00036FF2, 0x3FFF}, + { 3, 5150000000, 0x00036FF2, 0x2000} + } + } + +AnalogueOutput_2 = { + Class = TripletsContainer + Type = AnalogueOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 1, 0x3FFF0000, 0x2000}, + { 2, 5140000000, 0x00036FF2, 0x3FFF}, + { 3, 5150000000, 0x00036FF2, 0x2000} + } + } + +ModulationOutput_0 = { + Class = TripletsContainer + Type = ModulationOutput + StartTimeToTimeStampTicks = 25 + ParamTimeToTicks = 500 + Triplets = { + { 1, 1, 0, 0} + } + } + +ModulationOutput_1 = { + Class = TripletsContainer + Type = ModulationOutput + StartTimeToTimeStampTicks = 25 + ParamTimeToTicks = 500 + Triplets = { + { 1, 1, 0, 0} + } + } + +DigitalOutput_N = { + Class = TripletsContainer + Type = DigitalOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 5098000000, 0, 0, 0, 0, 1}, + { 2, 5202000000, 0, 0, 0, 0, 0} + } + } + +FastShutdownOutput_0 = { + Class = TripletsContainer + Type = FastShutdownOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 1, 0, 16, 8} + } + } + +FastShutdownOutput_1 = { + Class = TripletsContainer + Type = FastShutdownOutput + StartTimeToTimeStampTicks = 25 + Triplets = { + { 1, 1, 0, 16, 8} + } + } + } + InputSignals = { + TimerAbsTimeUs = { + Alias = MXIAbsTime_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + TriggerInput = { + Alias = MXITripletConfiguration_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AnalogueOutput_0_Counter = { + Alias = MXI_DSC_AO_0_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AnalogueOutput_0_Full = { + Alias = MXI_DSC_AO_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + AnalogueOutput_1_Counter = { + Alias = MXI_DSC_AO_1_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AnalogueOutput_1_Full = { + Alias = MXI_DSC_AO_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + AnalogueOutput_2_Counter = { + Alias = MXI_DSC_AO_2_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AnalogueOutput_2_Full = { + Alias = MXI_DSC_AO_2_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + ModulationOutput_0_Counter = { + Alias = MXI_DSC_MO_0_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + ModulationOutput_0_Full = { + Alias = MXI_DSC_MO_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + ModulationOutput_1_Counter = { + Alias = MXI_DSC_MO_1_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + ModulationOutput_1_Full = { + Alias = MXI_DSC_MO_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + DigitalOutput_N_Counter = { + Alias = MXI_DSC_DO_N_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + DigitalOutput_N_Full = { + Alias = MXI_DSC_DO_N_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + FastShutdown_0_Counter = { + Alias = MXI_DSC_FS_0_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + FastShutdown_0_Full = { + Alias = MXI_DSC_FS_0_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + FastShutdown_1_Counter = { + Alias = MXI_DSC_FS_1_CTR_OUT_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + FastShutdown_1_Full = { + Alias = MXI_DSC_FS_1_FULL_OUT_DDB1 + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + TriggerTriplets = { + Alias = Trigger_MXIWriteDsFifoConfig_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TripletsPacket = { + Alias = MXI_PCK_TRIPLETS_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 16 + NumberOfDimensions = 1 + } + CfgDone = { + Alias = MXITripletConfigurationDone_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgError = { + Alias = MXITripletConfigurationError_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgStatus = { + Alias = MXITripletConfigurationStatus_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +PlcConfigurationSupervisor = { + Class = PlcConfigurationSupervisorGAM + ReplyTimeOutMs = 10000 + +Configurations = { + Class = ReferenceContainer + +ConfigSet_0_Start = { + Class = ReferenceContainer + +ConfigStep_0_ChangeToState2 = { + Class = PlcConfigurationContainer + Floats = { 0.0 35.0 0.0 35.0 15.0 15.0 20.0 20.0 20000.0 0.0 0.2 } + Integers = { 1000 1000 1 1 0 1 1000 1 2 2 } + Commands = { 0 1 } + } + +ConfigStep_1_SetParameters = { + Class = PlcConfigurationContainer + Floats = { 0.0 35.0 0.0 35.0 15.0 15.0 20.0 20.0 20000.0 0.0 0.2 } + Integers = { 1000 1000 1 1 1 1 1000 1 0 2 } + Commands = { 1 0 } + } + +ConfigStep_2_SetParameters = { + Class = PlcConfigurationContainer + Floats = { 0.0 35.0 0.0 35.0 15.0 15.0 20.0 20.0 20000.0 0.0 0.2 } + Integers = { 1000 1000 1 1 0 1 1000 1 0 2 } + Commands = { 1 0 } + } + +ConfigStep_3_ChangeToState3 = { + Class = PlcConfigurationContainer + Floats = { 0.0 35.0 0.0 35.0 15.0 15.0 20.0 20.0 20000.0 0.0 0.2 } + Integers = { 1000 1000 1 1 0 1 1000 1 3 2 } + Commands = { 0 1 } + } + } + } + InputSignals = { + // Timer and activation signals + TimerAbsTimeUs = { + Alias = AbsTime_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + TriggerInput = { + Alias = PlcPacketTx_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + SelectInput = { + Alias = PlcPacketTx_Select_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Monitor Signals + PLCReadAbsTime = { + Alias = PlcPacketRx_AbsTime_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + PLCReadAckCfg = { + Alias = PlcPacketRx_ACK_CFG_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PLCReadAckSmc = { + Alias = PlcPacketRx_ACK_SMC_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PLCReadStateCfg = { + Alias = PlcPacketRx_STATE_CFG_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PLCReadStateSmc = { + Alias = PlcPacketRx_STATE_SMC_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + // Trigger Signals + TriggerOutput = { + Alias = PlcPacketTx_TrgOut_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // PLC Signals + VB1TREF = { + Alias = PlcPacketTx_VB1TREF_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB1 = { + Alias = PlcPacketTx_VB1_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB2TREF = { + Alias = PlcPacketTx_VB2TREF_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB2 = { + Alias = PlcPacketTx_VB2_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB1RR = { + Alias = PlcPacketTx_VB1RR_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB2RR = { + Alias = PlcPacketTx_VB2RR_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB1TH = { + Alias = PlcPacketTx_VB1TH_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB2TH = { + Alias = PlcPacketTx_VB2TH_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VKTH = { + Alias = PlcPacketTx_VKTH_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VK = { + Alias = PlcPacketTx_VK_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + PSKT = { + Alias = PlcPacketTx_PSKT_DDB1 + DataSource = DDB1 + Type = float32 + NumberOfElements = 1 + } + VB1UP = { + Alias = PlcPacketTx_VB1UP_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + VB2UP = { + Alias = PlcPacketTx_VB2UP_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + VB1TSEL = { + Alias = PlcPacketTx_VB1TSEL_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + VB2TSEL = { + Alias = PlcPacketTx_VB2TSEL_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + VKSEL = { + Alias = PlcPacketTx_VKSEL_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + BODR = { + Alias = PlcPacketTx_BODR_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + VKUP = { + Alias = PlcPacketTx_VKUP_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + MDKF = { + Alias = PlcPacketTx_MDKF_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + CSTAT = { + Alias = PlcPacketTx_CSTAT_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + COMOD = { + Alias = PlcPacketTx_COMOD_DDB1 + DataSource = DDB1 + Type = uint16 + NumberOfElements = 1 + } + CFG_MOD = { + Alias = PlcPacketTx_CFG_MOD_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + SM_MOD = { + Alias = PlcPacketTx_SM_MOD_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Status Flags + CfgDone = { + Alias = PlcConfigurationSupervisor_Done_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgError = { + Alias = PlcConfigurationSupervisor_Error_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + CfgStatus = { + Alias = PlcConfigurationSupervisor_Status_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + // ------------------- // + + // ----- TX PATH ----- // + +MXIWriteRst = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteRst_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_RST_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + rst_in = { + DataSource = MXIRegistersWriteRst + Type = bool + NumberOfElements = 1 + Trigger = 1 + } + } + } + + +MXIWriteHlOpt = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteHlOpt_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_TX_1_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_TX_2_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_TX_3_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_TX_OPT_TRG_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_HL_RX_1_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_2_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_3_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_4_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_5_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_6_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_7_OPT_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_HL_RX_OPT_TRG_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + hl_tx_1_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + Trigger = 1 + } + hl_tx_2_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_tx_3_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_tx_opt_trg = { + DataSource = MXIRegistersWriteHlOpt + Type = bool + NumberOfElements = 1 + } + hl_rx_1_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_2_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_3_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_4_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_5_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_6_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_7_opt = { + DataSource = MXIRegistersWriteHlOpt + Type = uint8 + NumberOfElements = 1 + } + hl_rx_opt_trg = { + DataSource = MXIRegistersWriteHlOpt + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIWriteEn = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteEn_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_EN_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + dsc_en_in = { + DataSource = MXIRegistersWriteEn + Type = bool + NumberOfElements = 1 + Trigger = 1 + } + } + } + + +MXIWriteDbg = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteDbg_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_DBG_EN_SEL_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + MXI_DBG_EN_IN_DDB1 = { + DataSource = DDB1 + Type = bool + NumberOfElements = 1 + } + } + OutputSignals = { + dbg_en_sel_in = { + DataSource = MXIRegistersDgbEn + Type = bool + NumberOfElements = 1 + Trigger = 1 + } + dbg_en_in = { + DataSource = MXIRegistersDgbEn + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIWriteDsFifoAcqEn = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteIDsFifoAcqEn_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_ACQ_EN_PAT_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + FIFO0_U64_WR = { + DataSource = MXIDsFifoAcqEn + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 1 + Trigger = 1 + } + } + } + + +MXIWriteDsFifoConfig = { + Class = TriggeredIOGAM + InputSignals = { + Trigger_MXIWriteDsFifoConfig_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXI_PCK_TRIPLETS_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 16 + NumberOfDimensions = 1 + } + } + OutputSignals = { + FIFO0_U64_WR = { + DataSource = MXIDsFifoConfig + Type = uint64 + NumberOfElements = 16 + NumberOfDimensions = 1 + Trigger = 1 + } + } + } + + +PlcPacketTx = { + Class = TriggeredIOGAM + InputSignals = { + PlcPacketTx_TrgOut_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderNF_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderNI_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderNC_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderNS_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderNA_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_HeaderS_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfDimensions = 1 + NumberOfElements = 3 + } + PlcPacketTx_VB1TREF_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB1_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB2TREF_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB2_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB1RR_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB2RR_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB1TH_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB2TH_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VKTH_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VK_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_PSKT_DDB1 = { + DataSource = DDB1 + Type = float32 + } + PlcPacketTx_VB1UP_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_VB2UP_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_VB1TSEL_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_VB2TSEL_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_VKSEL_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_BODR_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_VKUP_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_MDKF_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_CSTAT_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_COMOD_DDB1 = { + DataSource = DDB1 + Type = uint16 + } + PlcPacketTx_CFG_MOD_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + PlcPacketTx_SM_MOD_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + HeaderNF = { + DataSource = SdnPlcPub + Type = uint8 + Trigger = 1 + } + HeaderNI = { + DataSource = SdnPlcPub + Type = uint8 + } + HeaderNC = { + DataSource = SdnPlcPub + Type = uint8 + } + HeaderNS = { + DataSource = SdnPlcPub + Type = uint8 + } + HeaderNA = { + DataSource = SdnPlcPub + Type = uint8 + } + HeaderS = { + DataSource = SdnPlcPub + Type = uint8 + NumberOfElements = 3 + } + VB1TREF = { + DataSource = SdnPlcPub + Type = float32 + } + VB1 = { + DataSource = SdnPlcPub + Type = float32 + } + VB2TREF = { + DataSource = SdnPlcPub + Type = float32 + } + VB2 = { + DataSource = SdnPlcPub + Type = float32 + } + VB1RR = { + DataSource = SdnPlcPub + Type = float32 + } + VB2RR = { + DataSource = SdnPlcPub + Type = float32 + } + VB1TH = { + DataSource = SdnPlcPub + Type = float32 + } + VB2TH = { + DataSource = SdnPlcPub + Type = float32 + } + VKTH = { + DataSource = SdnPlcPub + Type = float32 + } + VK = { + DataSource = SdnPlcPub + Type = float32 + } + PSKT = { + DataSource = SdnPlcPub + Type = float32 + } + VB1UP = { + DataSource = SdnPlcPub + Type = uint16 + } + VB2UP = { + DataSource = SdnPlcPub + Type = uint16 + } + VB1TSEL = { + DataSource = SdnPlcPub + Type = uint16 + } + VB2TSEL = { + DataSource = SdnPlcPub + Type = uint16 + } + VKSEL = { + DataSource = SdnPlcPub + Type = uint16 + } + BODR = { + DataSource = SdnPlcPub + Type = uint16 + } + VKUP = { + DataSource = SdnPlcPub + Type = uint16 + } + MDKF = { + DataSource = SdnPlcPub + Type = uint16 + } + CSTAT = { + DataSource = SdnPlcPub + Type = uint16 + } + COMOD = { + DataSource = SdnPlcPub + Type = uint16 + } + CFG = { + DataSource = SdnPlcPub + Type = uint8 + } + SM = { + DataSource = SdnPlcPub + Type = uint8 + } + } + } + // ------------------- // + + // -- MON/STATE CTRL - // + +AppMonitor = { + Class = TestMonitorGAM + InputSignals = { + AbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + MXIAbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + SMState_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIConfigurationSupervisor_Status_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Status_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + ExtStateTransition_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AbortConfigurationState_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + TerminateRunningState_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +EventMessageBypassPreCfg = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // App Driven -> From PRE_CFG (1) send to MXI_CFG (2) + +AppMonitorTempBypass_PRE_CFG_GOTO_MXI_CFG = { + Class = EventConditionTrigger + EventTrigger = { + Command_SMState_DDB1 = 1 + } + +TST_PRE_CFG_GOTO_MXI_CFG = { + Class = Message + Destination = StateMachine + Function = GOTO_MXI_CFG + Mode = ExpectsReply + } + } + } + InputSignals = { + Command_SMState_DDB1 = { + Alias = SMState_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Clear_SMState_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + } + } + + +AcquisitionStatusMonitor = { + Class = MathExpressionGAM + Expression = " + AcqStatus_DDB1 = (uint8)( + (uint8)(AcquisitionStatusT2_DDB1) == (uint8)(1) && + (uint8)(AcquisitionStatusT3_DDB1) == (uint8)(1) + ); + " + InputSignals = { + AcquisitionStatusT2_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + AcquisitionStatusT3_DDB1 = { + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + AcqStatus_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +AcquisitionStatusMessages = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // App Driven -> From TEST_RUN (4) send to TEST_POST (5) + +TriggerStateTransition_TEST_RUN_GOTO_TEST_POST = { + Class = EventConditionTrigger + EventTrigger = { + Command_AcqStatus_DDB1 = 1 + } + +TST_TEST_RUN_GOTO_TEST_POST = { + Class = Message + Destination = StateMachine + Function = GOTO_TEST_POST + Mode = ExpectsReply + } + } + } + InputSignals = { + Command_AcqStatus_DDB1 = { + Alias = AcqStatus_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Clear_AcqStatus_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + } + } + + +CycleCounterT1 = { + Class = CycleCounterGAM + ResetOnStateChange = 1 + ZeroIfReset = 1 + Step = 1 + InputSignals = { + Reset = { + Alias = CycleCounterReset_DDB1 + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + CycleCounter = { + Alias = CycleCounter_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + } + } + + +TestPostTasksDelay = { + Class = MathExpressionGAM + Expression = " + Tasks_Trigger_DDB1 = (uint8)((uint64)(CycleCounter_DDB1) > (uint64)(DelayCycles_DDB1)); + " + InputSignals = { + CycleCounter_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + DelayCycles_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + Tasks_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +TestPostGotoTestDone = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // Application driven -> When in TEST_POST (5) go to TEST_DONE (7) + +AppMonitorTempBypass_TEST_POST_CALL_GOTO_TEST_DONE = { + Class = EventConditionTrigger + EventTrigger = { + Command_Tasks_Trigger_DDB1 = 1 + Signal_SMState_DDB1 = 5 + } + +TAF_TEST_POST_GOTO_TEST_DONE = { + Class = Message + Destination = StateMachine + Function = GOTO_TEST_DONE + Mode = ExpectsReply + } + } + } + InputSignals = { + Command_Tasks_Trigger_DDB1 = { + Alias = Tasks_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + } + Signal_SMState_DDB1 = { + Alias = SMState_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Clear_Tasks_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + } + } + + +TestDoneCallTasks = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // BYPASS AppMonitor -> When in TEST_DONE (7) call TEST_DONE_TASKS + +AppMonitorTempBypass_TEST_POST_CALL_TEST_DONE_TASKS = { + Class = EventConditionTrigger + EventTrigger = { + Command_Tasks_Trigger_DDB1 = 1 + Signal_SMState_DDB1 = 7 + } + +TAF_TEST_DONE_TEST_DONE_TASKS = { + Class = Message + Destination = StateMachine + Function = TEST_DONE_TASKS + Mode = ExpectsReply + } + } + } + InputSignals = { + Command_Tasks_Trigger_DDB1 = { + Alias = Tasks_Trigger_DDB1 + DataSource = DDB1 + Type = uint8 + } + Signal_SMState_DDB1 = { + Alias = SMState_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Clear_Tasks_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + } + } + + +EventMessages = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // Ext Driven -> From PRE_CFG (1) send to CFG_ERROR (6) + +TriggerStateTransition_PRE_CFG_GOTO_CFG_ERROR = { + Class = EventConditionTrigger + EventTrigger = { + Command_ExtStateTransition_DDB1 = 2 + Signal_SMState_DDB1 = 1 + } + +TST_PRE_CFG_GOTO_CFG_ERROR = { + Class = Message + Destination = StateMachine + Function = GOTO_CFG_ERROR + Mode = ExpectsReply + } + } + // App Driven ->From MXI_CFG (2) send to PLC_CFG (3) + +TriggerStateTransition_MXI_CFG_GOTO_PLC_CFG = { + Class = EventConditionTrigger + EventTrigger = { + Command_MXIConfigurationSupervisor_Done_DDB1 = 1 + Command_MXIConfigurationSupervisor_Error_DDB1 = 0 + Signal_SMState_DDB1 = 2 + } + +TST_MXI_CFG_GOTO_PLC_CFG = { + Class = Message + Destination = StateMachine + Function = GOTO_PLC_CFG + Mode = ExpectsReply + } + } + // App Driven ->From MXI_CFG (2) send to CFG_ERROR (6) + +TriggerStateTransition_MXI_CFG_GOTO_CFG_ERROR = { + Class = EventConditionTrigger + EventTrigger = { + Command_MXIConfigurationSupervisor_Error_DDB1 = 1 + Signal_SMState_DDB1 = 2 + } + +TST_MXI_CFG_GOTO_CFG_ERROR = { + Class = Message + Destination = StateMachine + Function = GOTO_CFG_ERROR + Mode = ExpectsReply + } + } + // App Driven ->From PLC_CFG (3) send to TEST_RUN (4) + +TriggerStateTransition_PLC_CFG_GOTO_TEST_RUN = { + Class = EventConditionTrigger + EventTrigger = { + Command_PlcConfigurationSupervisor_Done_DDB1 = 1 + Command_PlcConfigurationSupervisor_Error_DDB1 = 0 + Signal_SMState_DDB1 = 3 + } + +TST_PLC_CFG_GOTO_TEST_RUN = { + Class = Message + Destination = StateMachine + Function = GOTO_TEST_RUN + Mode = ExpectsReply + } + } + // App Driven ->From PLC_CFG (3) send to CFG_ERROR (6) + +TriggerStateTransition_PLC_CFG_GOTO_CFG_ERROR = { + Class = EventConditionTrigger + EventTrigger = { + Command_PlcConfigurationSupervisor_Error_DDB1 = 1 + Signal_SMState_DDB1 = 3 + } + +TST_PLC_CFG_GOTO_CFG_ERROR = { + Class = Message + Destination = StateMachine + Function = GOTO_CFG_ERROR + Mode = ExpectsReply + } + } + // Ext Driven -> From {PRE_CFG (1), MXI_CFG (2), PLC_CFG (3)} to CFG_ERROR (6) + +ForceStateTransition_ANY_GOTO_CFG_ERROR = { + Class = EventConditionTrigger + EventTrigger = { + Command_AbortConfigurationState_DDB1 = 1 + } + +FST_ANY_GOTO_CFG_ERROR = { + Class = Message + Destination = StateMachine + Function = GOTO_CFG_ERROR + Mode = ExpectsReply + } + } + // Ext Driven -> TEST_RUN (4) to TEST_POST (5) + +ForceStateTransition_TEST_RUN_GOTO_TEST_POST = { + Class = EventConditionTrigger + EventTrigger = { + Command_TerminateRunningState_DDB1 = 1 + } + +FST_TEST_RUN_GOTO_TEST_POST = { + Class = Message + Destination = StateMachine + Function = GOTO_TEST_POST + Mode = ExpectsReply + } + } + } + InputSignals = { + Command_ExtStateTransition_DDB1 = { + Alias = ExtStateTransition_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_AbortConfigurationState_DDB1 = { + Alias = AbortConfigurationState_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_TerminateRunningState_DDB1 = { + Alias = TerminateRunningState_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_MXIConfigurationSupervisor_Done_DDB1 = { + Alias = MXIConfigurationSupervisor_Done_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_MXIConfigurationSupervisor_Error_DDB1 = { + Alias = MXIConfigurationSupervisor_Error_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_PlcConfigurationSupervisor_Done_DDB1 = { + Alias = PlcConfigurationSupervisor_Done_DDB1 + DataSource = DDB1 + Type = uint8 + } + Command_PlcConfigurationSupervisor_Error_DDB1 = { + Alias = PlcConfigurationSupervisor_Error_DDB1 + DataSource = DDB1 + Type = uint8 + } + Signal_SMState_DDB1 = { + Alias = SMState_DDB1 + DataSource = DDB1 + Type = uint8 + } + } + OutputSignals = { + Clear_ExtStateTransition_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_AbortConfigurationState_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_TerminateRunningState_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_MXIConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_MXIConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_PlcConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + Clear_PlcConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint32 + } + } + } + // ------------------- // + + // ----- STORAGE ----- // + + + +StoreStartPulseTime_T1 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + ResetCycles = 1 + InputSignals = { + DANWriterEnable_DDB1 = { + Type = uint8 + DataSource = DDB1 + } + AbsTimeT1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + InitTime_1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + OutputSignals = { + InitTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + +StoreStopPulseTime_T1 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + Negated = 1 + ResetCycles = 1 + InputSignals = { + DANWriterEnable_DDB1 = { + Type = uint8 + DataSource = DDB1 + } + AbsTimeT1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + FinalTime_1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + OutputSignals = { + FinalTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + + +DANWriterWriteData = { + Class = IOGAM + InputSignals = { + DANWriterEnable_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Time Signals + TimeSamples_DDB1 = { + Alias = AbsTimeT1_DDB1 + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + AbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + MXIAbsTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + NumberOfElements = 1 + } + // State + SMState_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + AcqStatus_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor + MXIConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIConfigurationSupervisor_Status_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Base Configuration + MXIBaseConfiguration_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIBaseConfiguration_Mode_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIBaseConfigurationDone_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIBaseConfigurationStatus_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Acquisition Enable + MXIAcquisitionEnable_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIAcquisitionEnableDone_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXIAcquisitionEnableStatus_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Triplet Configuration + MXITripletConfiguration_Trigger_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXITripletConfigurationDone_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + MXITripletConfigurationError_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // PLC Supervisor + PlcPacketTx_TrgOut_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Done_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Error_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + PlcConfigurationSupervisor_Status_DDB1 = { + DataSource = DDB1 + Type = uint8 + NumberOfElements = 1 + } + // Statistics + T1_PreCfg_CycleTime = { + Alias = PreCfg.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_MxiCfg_CycleTime = { + Alias = MxiCfg.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_PlcCfg_CycleTime = { + Alias = PlcCfg.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_TestRun_CycleTime = { + Alias = TestRun.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_TestPost_CycleTime = { + Alias = TestPost.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_CfgError_CycleTime = { + Alias = CfgError.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_Error_CycleTime = { + Alias = Error.Thread1Cfg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_FirstGAM_ReadTime = { + Alias = TimeConverter_ReadTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + T1_LastGAM_ExecTime = { + Alias = EventMessages_ExecTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + } + InitTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + FinalTime_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + InitTime_Save_DDB1 = { + Alias = InitTime_DDB1 + DataSource = DDB1 + Type = uint64 + } + FinalTime_Save_DDB1 = { + Alias = FinalTime_DDB1 + DataSource = DDB1 + Type = uint64 + } + } + OutputSignals = { + DANWriterT1_Trigger = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_TimeSamples = { + DataSource = DANWriterT1 + Type = uint64 + NumberOfElements = 1 + } + DANWriterT1_Time = { + DataSource = DANWriterT1 + Type = uint64 + NumberOfElements = 1 + } + DANWriterT1_MXIAbsTime = { + DataSource = DANWriterT1 + Type = uint64 + NumberOfElements = 1 + } + DANWriterT1_SMState = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_AcqStatus = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor + DANWriterT1_MXICfgSupDone = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXICfgSupError = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXICfgSupStatus = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Base Configuration + DANWriterT1_MXIBaseCfgTrg = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXIBaseCfgMode = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXIBaseCfgDone = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXIBaseCfgStatus = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Acquisition Enable + DANWriterT1_MXIAcqEnTrg = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXIAcqEnDone = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXIAcqEnStatus = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // MXI Supervisor - Triplet Configuration + DANWriterT1_MXITrpCfgTrg = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXITrpCfgDone = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_MXITrpCfgError = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // PLC Supervisor + DANWriterT1_PlcCfgSupTxTrg = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_PlcCfgSupDone = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_PlcCfgSupError = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT1_PlcCfgSupStatus = { + DataSource = DANWriterT1 + Type = uint8 + NumberOfElements = 1 + } + // Statistics + DANWriterT1_PreCfg_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_MxiCfg_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_PlcCfg_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_TestRun_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_TestPost_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_CfgError_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_Error_CycleTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_FirstGAM_ReadTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + DANWriterT1_LastGAM_ExecTime = { + DataSource = DANWriterT1 + Type = uint32 + NumberOfElements = 1 + } + InitTime_L = { + DataSource = EpicsOutput_T1 + Type = uint32 + } + InitTime_H = { + DataSource = EpicsOutput_T1 + Type = uint32 + } + FinalTime_L = { + DataSource = EpicsOutput_T1 + Type = uint32 + } + FinalTime_H = { + DataSource = EpicsOutput_T1 + Type = uint32 + } + InitTime_1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + FinalTime_1_DDB1 = { + DataSource = DDB1 + Type = uint64 + } + } + } + // ------------------- // + // ------------ T1 END ------------ // + + // ----------- T2 START ----------- // + // Fast Thread - GET ACQ Data + WaveformMonitors + DANWriterWriter2 + // ----- RX PATH ----- // + +MxiDataUsFifoDataT2 = { + Class = IOGAM + InputSignals = { + MXIUpstreamData = { + DataSource = MXIUsFifoDataT2 + Type = uint64 + NumberOfElements = 3001 + NumberOfDimensions = 1 + Trigger = 1 + Frequency = 0 + } + MXIUpstreamDataErrorCheck = { + Alias = ErrorCheck + DataSource = MXIUsFifoDataT2 + Type = uint32 + NumberOfElements = 1 + } + } + OutputSignals = { + USC_TS_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + USC_AI_0_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_1_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_2_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_3_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_4_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_5_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_6_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_7_VALUE_NU_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DI_62_0_VALUES_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DATA_ERRORCHECK_DDB2 = { + DataSource = DDB2 + Type = uint32 + NumberOfElements = 1 + } + } + } + + +DigitalInputSplitterT2 = { + Class = BitSplitterGAM + InputSignals = { + DigitalInputs = { + Alias = USC_DI_62_0_VALUES_DDB2 + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + OutputSignals = { + DigitalInput_0 = { + Alias = USC_DI_0_VALUES_DDB2 + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_1 = { + Alias = USC_DI_1_VALUES_DDB2 + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +TimeConversionT2 = { + Class = TimeArrayGAM + TimePerTicks = 25 // 25 ns / tick + TimeStep = 500 // 500 ns + InputSignals = { + USC_TS_VALUE_DDB2 = { // FPGA Clock Ticks + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + TimeArrayNs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +TimeConversionT2_Abs = { + Class = TimeArrayGAM + TimePerTicks = 25 // 25 ns / tick + TimeStep = 500 // 500 ns + AbsoluteTime = 1 + InputSignals = { + USC_TS_VALUE_DDB2 = { // FPGA Clock Ticks + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + TimeArrayNs_Abs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +MXIMasterTimeT2 = { + Class = IOGAM + InputSignals = { + TimeArrayNs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0,0}} + } + } + OutputSignals = { + MXIAbsTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + // ------------------- // + + // ---- CONST GAM ---- // + +DANWriterWriteDataWindowLimitsT2 = { + Class = ConstantGAM + OutputSignals = { + DANWriterWriteDataWindowLowerLimit_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + Default = 5000000000 + } + DANWriterWriteDataWindowUpperLimit_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + Default = 6000000000 + } + } + } + // ------------------- // + + // ---- FLOW CTRL ---- // + +DANWriterWriteDataWindowT2 = { + Class = MathExpressionGAM + Expression = " + DANWriterWriterEnable_DDB2 = (uint8)(((uint64)(MXIAbsTime_DDB2) >= (uint64)(DANWriterWriteDataWindowLowerLimit_DDB2)) + && ((uint64)(MXIAbsTime_DDB2) <= (uint64)(DANWriterWriteDataWindowUpperLimit_DDB2))); + DANWriterWriterDone_DDB2 = (uint8)((uint64)(MXIAbsTime_DDB2) > (uint64)(DANWriterWriteDataWindowUpperLimit_DDB2)); + " + InputSignals = { + MXIAbsTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriteDataWindowLowerLimit_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriteDataWindowUpperLimit_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + DANWriterWriterEnable_DDB2 = { + DataSource = DDB2 + Type = uint8 + } + DANWriterWriterDone_DDB2 = { + DataSource = DDB2 + Type = uint8 + } + } + } + // ------------------- // + + // -- MON/STATE CTRL - // + +AppMonitorT2 = { + Class = TestMonitorGAM + InputSignals = { + MXIAbsTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriterDone_DDB2 = { + DataSource = DDB2 + Type = uint8 + NumberOfElements = 1 + } + } + OutputSignals = { + AbortRunningState_DDB2 = { + DataSource = DDB2 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +ExecutionMonitorT2 = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // App Driven -> Notify T1 that T2 acquisition/storage is completed + +StatusNotificationT2 = { + Class = EventConditionTrigger + EventTrigger = { + Command_DANWriterWriterDone_DDB2 = 1 + } + +NOTIFY_T1_STATUS_T2 = { + Class = Message + Destination = TbTestApp.Functions.AcquisitionStatusDaq + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = AcquisitionStatusT2_DDB1 + SignalValue = 1 + } + } + } + } + InputSignals = { + Command_DANWriterWriterDone_DDB2 = { + Alias = DANWriterWriterDone_DDB2 + DataSource = DDB2 + Type = uint8 + } + } + OutputSignals = { + Clear_DANWriterWriterDone_DDB2 = { + DataSource = DDB2 + Type = uint32 + } + } + } + // ------------------- // + + // ----- STORAGE ----- // + + +StoreStartPulseTime_T2 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + ResetCycles = 1 + InputSignals = { + DANWriterWriterEnable_DDB2 = { + Type = uint8 + DataSource = DDB2 + } + TimeArrayNs_Abs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + InitTime_1_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + } + OutputSignals = { + InitTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + } + } + +StoreStopPulseTime_T2 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + Negated = 1 + ResetCycles = 1 + InputSignals = { + DANWriterWriterEnable_DDB2 = { + Type = uint8 + DataSource = DDB2 + } + TimeArrayNs_Abs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + FinalTime_1_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + } + OutputSignals = { + FinalTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + } + } + + + +DANWriterWriteDataT2 = { + Class = IOGAM + InputSignals = { + DANWriterWriterEnable_DDB2 = { + DataSource = DDB2 + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + TimeArrayNs_Abs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + TimeArrayNs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_0_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_1_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_2_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_3_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_4_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_5_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_6_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DI_0_VALUES_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DI_1_VALUES_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DATA_ERRORCHECK_DDB2 = { + DataSource = DDB2 + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T2_PlcCfg_CycleTime = { + Alias = PlcCfg.Thread2Daq_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T2_TestRun_CycleTime = { + Alias = TestRun.Thread2Daq_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T2_TestPost_CycleTime = { + Alias = TestPost.Thread2Daq_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T2_FirstGAM_ReadTime = { + Alias = DigitalInputSplitterT2_ReadTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T2_LastGAM_ExecTime = { + Alias = ExecutionMonitorT2_ExecTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + InitTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + FinalTime_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + InitTime_Save_DDB2 = { + Alias = InitTime_DDB2 + DataSource = DDB2 + Type = uint64 + } + FinalTime_Save_DDB2 = { + Alias = FinalTime_DDB2 + DataSource = DDB2 + Type = uint64 + } + } + OutputSignals = { + DANWriterT2_Trigger = { + DataSource = DANWriterT2 + Type = uint8 + NumberOfElements = 1 + } + DANWriterT2_TimeSamples = { + DataSource = DANWriterT2 + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + DANWriterT2_Time = { + DataSource = DANWriterT2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_0_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_1_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_2_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_3_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_4_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_5_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_6_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_DI_0_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_DI_1_VALUE = { + DataSource = DANWriterT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_ERRORCHECK = { + DataSource = DANWriterT2 + Type = uint32 + } + DANWriterT2_PlcCfg_CycleTime = { + DataSource = DANWriterT2 + Type = uint32 + } + DANWriterT2_TestRun_CycleTime = { + DataSource = DANWriterT2 + Type = uint32 + } + DANWriterT2_TestPost_CycleTime = { + DataSource = DANWriterT2 + Type = uint32 + } + DANWriterT2_FirstGAM_ReadTime = { + DataSource = DANWriterT2 + Type = uint32 + } + DANWriterT2_LastGAM_ExecTime = { + DataSource = DANWriterT2 + Type = uint32 + } + InitTime_L = { + DataSource = EpicsOutput_T2 + Type = uint32 + } + InitTime_H = { + DataSource = EpicsOutput_T2 + Type = uint32 + } + FinalTime_L = { + DataSource = EpicsOutput_T2 + Type = uint32 + } + FinalTime_H = { + DataSource = EpicsOutput_T2 + Type = uint32 + } + InitTime_1_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + FinalTime_1_DDB2 = { + DataSource = DDB2 + Type = uint64 + } + } + } + + +FileWriterBufferDataT2 = { + Class = IOGAM + InputSignals = { + FileWriterBufferEnable_DDB2 = { + Alias = DANWriterWriterEnable_DDB2 + DataSource = DDB2 + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + TimeArrayNs_DDB2 = { + DataSource = DDB2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_0_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_1_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_AI_2_VALUE_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + USC_DI_0_VALUES_DDB2 = { + DataSource = DDB2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + OutputSignals = { + FileWriterT2_Trigger = { + DataSource = FileWriterBufferT2 + Type = uint8 + NumberOfElements = 1 + } + FileWriterT2_Time = { + DataSource = FileWriterBufferT2 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + FileWriterT2_USC_AI_0_VALUE = { + DataSource = FileWriterBufferT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + FileWriterT2_USC_AI_1_VALUE = { + DataSource = FileWriterBufferT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + FileWriterT2_USC_AI_2_VALUE = { + DataSource = FileWriterBufferT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + FileWriterT2_USC_DI_0_VALUE = { + DataSource = FileWriterBufferT2 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + // ------------------- // + // ------------ T2 END ------------ // + + // ----------- T3 START ----------- // + // Fast Thread - Get DEBUG Data + DANWriterWriter 3 + // ----- RX PATH ----- // + +MxiDataUsFifoDataT3 = { + Class = IOGAM + InputSignals = { + MXIUpstreamDebug = { + DataSource = MXIUsFifoDebugT3 + Type = uint64 + NumberOfElements = 2001 + NumberOfDimensions = 1 + Trigger = 1 + Frequency = 0 + } + MXIUpstreamDebugErrorCheck = { + Alias = ErrorCheck + DataSource = MXIUsFifoDebugT3 + Type = uint32 + NumberOfElements = 1 + } + } + OutputSignals = { + DBG_TS_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + DBG_AO_0_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_1_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_2_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_3_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_62_0_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DATA_ERRORCHECK_DDB3 = { + DataSource = DDB3 + Type = uint32 + NumberOfElements = 1 + } + } + } + + +DigitalInputSplitterT3 = { + Class = BitSplitterGAM + InputSignals = { + DigitalInputs = { + Alias = DBG_DO_62_0_VALUES_DDB3 + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + OutputSignals = { + DigitalInput_0 = { + Alias = DBG_MO_0_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_1 = { + Alias = DBG_MO_1_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_2 = { + Alias = DBG_DO_0_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_3 = { + Alias = DBG_DO_1_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_4 = { + Alias = DBG_DO_2_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_5 = { + Alias = DBG_DO_3_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_6 = { + Alias = DBG_DO_4_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_7 = { + Alias = DBG_MOD1_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_8 = { + Alias = DBG_MOD2_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_9 = { + Alias = DBG_FS1_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_10 = { + Alias = DBG_FS2_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DigitalInput_11 = { + Alias = DBG_PWON_VALUES_DDB3 + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +TimeConversionT3 = { + Class = TimeArrayGAM + TimePerTicks = 25 // 25 ns / tick + TimeStep = 500 // 500 ns + InputSignals = { + DBG_TS_VALUE_DDB3 = { // FPGA Clock Ticks + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + TimeArrayNs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +TimeConversionT3_Abs = { + Class = TimeArrayGAM + TimePerTicks = 25 // 25 ns / tick + TimeStep = 500 // 500 ns + AbsoluteTime = 1 + InputSignals = { + DBG_TS_VALUE_DDB3 = { // FPGA Clock Ticks + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + TimeArrayNs_Abs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + } + } + + +MXIMasterTimeT3 = { + Class = IOGAM + InputSignals = { + TimeArrayNs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0,0}} + } + } + OutputSignals = { + MXIAbsTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + // ------------------- // + + // ---- CONST GAM ---- // + +DANWriterWriteDataWindowLimitsT3 = { + Class = ConstantGAM + OutputSignals = { + DANWriterWriteDataWindowLowerLimit_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + Default = 5000000000 + } + DANWriterWriteDataWindowUpperLimit_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + Default = 6000000000 + } + } + } + // ------------------- // + + // ---- FLOW CTRL ---- // + +DANWriterWriteDataWindowT3 = { + Class = MathExpressionGAM + Expression = " + DANWriterWriterEnable_DDB3 = (uint8)(((uint64)(MXIAbsTime_DDB3) >= (uint64)(DANWriterWriteDataWindowLowerLimit_DDB3)) + && ((uint64)(MXIAbsTime_DDB3) <= (uint64)(DANWriterWriteDataWindowUpperLimit_DDB3))); + DANWriterWriterDone_DDB3 = (uint8)((uint64)(MXIAbsTime_DDB3) > (uint64)(DANWriterWriteDataWindowUpperLimit_DDB3)); + " + InputSignals = { + MXIAbsTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriteDataWindowLowerLimit_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriteDataWindowUpperLimit_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + } + OutputSignals = { + DANWriterWriterEnable_DDB3 = { + DataSource = DDB3 + Type = uint8 + } + DANWriterWriterDone_DDB3 = { + DataSource = DDB3 + Type = uint8 + } + } + } + // ------------------- // + + // -- MON/STATE CTRL - // + +AppMonitorT3 = { + Class = TestMonitorGAM + InputSignals = { + MXIAbsTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1 + } + DANWriterWriterEnable_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1 + } + DANWriterWriterDone_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1 + } + } + } + + +ExecutionMonitorT3 = { + Class = MessageGAM + TriggerOnChange = 1 + +Events = { + Class = ReferenceContainer + // App Driven -> Notify T1 that T3 acquisition/storage is completed + +StatusNotificationT3 = { + Class = EventConditionTrigger + EventTrigger = { + Command_DANWriterWriterDone_DDB3 = 1 + } + +NOTIFY_T1_STATUS_T3 = { + Class = Message + Destination = TbTestApp.Functions.AcquisitionStatusDbg + Function = SetOutput + +Parameters = { + Class = ConfigurationDatabase + SignalName = AcquisitionStatusT3_DDB1 + SignalValue = 1 + } + } + } + } + InputSignals = { + Command_DANWriterWriterDone_DDB3 = { + Alias = DANWriterWriterDone_DDB3 + DataSource = DDB3 + Type = uint8 + } + } + OutputSignals = { + Clear_DANWriterWriterDone_DDB3 = { + DataSource = DDB3 + Type = uint32 + } + } + } + // ------------------- // + + // ----- STORAGE ----- // + + +StoreStartPulseTime_T3 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + ResetCycles = 1 + InputSignals = { + DANWriterWriterEnable_DDB3 = { + Type = uint8 + DataSource = DDB3 + } + TimeArrayNs_Abs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + InitTime_1_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + } + OutputSignals = { + InitTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + } + } + +StoreStopPulseTime_T3 = { + Class = TriggerEnableGAM + NumberOfTriggers = 1 + Negated = 1 + ResetCycles = 1 + InputSignals = { + DANWriterWriterEnable_DDB3 = { + Type = uint8 + DataSource = DDB3 + } + TimeArrayNs_Abs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + FinalTime_1_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + } + OutputSignals = { + FinalTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + } + } + + +DANWriterWriteDataT3 = { + Class = IOGAM + InputSignals = { + DANWriterWriterEnable_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + TimeArrayNs_Abs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + Ranges = {{0, 0}} + } + TimeArrayNs_DDB3 = { + DataSource = DDB3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_0_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_1_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_AO_2_VALUE_DDB3 = { + DataSource = DDB3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_MO_0_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_MO_1_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_0_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_1_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_2_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_3_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DO_4_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_MOD1_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_MOD2_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_FS1_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_FS2_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_PWON_VALUES_DDB3 = { + DataSource = DDB3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DBG_DATA_ERRORCHECK_DDB3 = { + DataSource = DDB3 + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T3_PlcCfg_CycleTime = { + Alias = PlcCfg.Thread3Dbg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T3_TestRun_CycleTime = { + Alias = TestRun.Thread3Dbg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T3_TestPost_CycleTime = { + Alias = TestPost.Thread3Dbg_CycleTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T3_FirstGAM_ReadTime = { + Alias = DigitalInputSplitterT3_ReadTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + T3_LastGAM_ReadTime = { + Alias = ExecutionMonitorT3_ExecTime + DataSource = Timings + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + InitTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + FinalTime_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + InitTime_Save_DDB3 = { + Alias = InitTime_DDB3 + DataSource = DDB3 + Type = uint64 + } + FinalTime_Save_DDB3 = { + Alias = FinalTime_DDB3 + DataSource = DDB3 + Type = uint64 + } + } + OutputSignals = { + DANWriterT3_Trigger = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + DANWriterT3_TimeSamples = { + DataSource = DANWriterT3 + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + DANWriterT3_Time = { + DataSource = DANWriterT3 + Type = uint64 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_0_VALUE = { + DataSource = DANWriterT3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_1_VALUE = { + DataSource = DANWriterT3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_2_VALUE = { + DataSource = DANWriterT3 + Type = uint16 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MO_0_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MO_1_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_0_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_1_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_2_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_3_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_4_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MOD1_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MOD2_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_FS1_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_FS2_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_PWON_VALUE = { + DataSource = DANWriterT3 + Type = uint8 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_ERRORCHECK = { + DataSource = DANWriterT3 + Type = uint32 + } + DANWriterT3_PlcCfg_CycleTime = { + DataSource = DANWriterT3 + Type = uint32 + } + DANWriterT3_TestRun_CycleTime = { + DataSource = DANWriterT3 + Type = uint32 + } + DANWriterT3_TestPost_CycleTime = { + DataSource = DANWriterT3 + Type = uint32 + } + DANWriterT3_FirstGAM_ReadTime = { + DataSource = DANWriterT3 + Type = uint32 + } + DANWriterT3_LastGAM_ExecTime = { + DataSource = DANWriterT3 + Type = uint32 + } + InitTime_L = { + DataSource = EpicsOutput_T3 + Type = uint32 + } + InitTime_H = { + DataSource = EpicsOutput_T3 + Type = uint32 + } + FinalTime_L = { + DataSource = EpicsOutput_T3 + Type = uint32 + } + FinalTime_H = { + DataSource = EpicsOutput_T3 + Type = uint32 + } + InitTime_1_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + FinalTime_1_DDB3 = { + DataSource = DDB3 + Type = uint64 + } + } + } + // ------------------- // + + // ------------ T3 END ------------ // + } + +Data = { + Class = ReferenceContainer + DefaultDataSource = DDB1 + // ----------- T1 START ----------- // + // Slow Timer Thread - Configuration and monitoring + +DDB1 = { + Class = GAMDataSource + } + + +LoggerDataSource = { + Class = LoggerDataSource + } + + +Timings = { + Class = TimingDataSource + } + + +Timer = { + Class = LinuxTimer + ExecutionMode = RealTimeThread + SleepNature = Busy + SleepPercentage = 0 + Phase = 0 + CPUMask = 0x00000100 + Signals = { + Counter = { + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + Time = { + Type = uint32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + AbsoluteTime = { + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + + +MXIRegistersRead = { + Class = NI9157::NI9157MxiDataSource + RunNi = 0 + NI9157DevicePath = NiDevice + NumberOfPacketsInFIFO = 10 + BlockIfNotRunning = 0 + Signals = { + hl_tx_spi_done = { // TX SPI done (all) + Type = bool + NumberOfElements = 1 + } + hl_rx_spi_done = { // RX SPI done (all) + Type = bool + NumberOfElements = 1 + } + dsc_ao_0_ctr_out = { // AO 0 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_ao_1_ctr_out = { // AO 1 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_ao_2_ctr_out = { // AO 2 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_mo_0_ctr_out = { // MO 0 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_mo_1_ctr_out = { // MO 1 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_do_n_ctr_out = { // DO N Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_fs_0_ctr_out = { // FS 0 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_fs_1_ctr_out = { // FS 1 Accepted Triplet Counter + Type = uint8 + NumberOfElements = 1 + } + dsc_full_mod_out = { // Modules FIFO Full status flag + Type = uint8 + NumberOfElements = 1 + } + dsc_acq_en_out = { // USC Acquisition Enable + Type = bool + NumberOfElements = 1 + } + dsc_ts_status = { // Timestamp generation status + Type = bool + NumberOfElements = 1 + } + dsc_ts_out = { // Timestamp current value + Type = uint64 + NumberOfElements = 1 + } + } + } + + +MXIRegistersWriteRst = { + Class = NI9157::NI9157MxiDataSource + RunNi = 0 + NI9157DevicePath = NiDevice + NumberOfPacketsInFIFO = 10 + BlockIfNotRunning = 0 + Signals = { + rst_in = { // Reset Firmware (toggle switch) + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIRegistersWriteEn = { + Class = NI9157::NI9157MxiDataSource + RunNi = 0 + NI9157DevicePath = NiDevice + NumberOfPacketsInFIFO = 10 + BlockIfNotRunning = 0 + Signals = { + dsc_en_in = { // Enable DSC + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIRegistersDgbEn = { + Class = NI9157::NI9157MxiDataSource + RunNi = 0 + NI9157DevicePath = NiDevice + NumberOfPacketsInFIFO = 10 + BlockIfNotRunning = 0 + Signals = { + dbg_en_sel_in = { // DBG Enable Selector (0 -> dbg_en_in driven, 1-> dsc_acq_en_out driven) + Type = bool + NumberOfElements = 1 + } + dbg_en_in = { // DBG Enable Input (usable when dbg_en_sel_in <= 1'b0) + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIRegistersWriteHlOpt = { + Class = NI9157::NI9157MxiDataSource + RunNi = 0 + NI9157DevicePath = NiDevice + NumberOfPacketsInFIFO = 10 + BlockIfNotRunning = 0 + Signals = { + hl_tx_1_opt = { // HL TX 1 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_tx_2_opt = { // HL TX 2 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_tx_3_opt = { // HL TX 3 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_tx_opt_trg = { // Trigger HL TX configuration (toggle switch) + Type = bool + NumberOfElements = 1 + } + hl_rx_1_opt = { // HL RX 1 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_2_opt = { // HL RX 2 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_3_opt = { // HL RX 3 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_4_opt = { // HL RX 4 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_5_opt = { // HL RX 5 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_6_opt = { // HL RX 6 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_7_opt = { // HL RX 7 CFG + Type = uint8 + NumberOfElements = 1 + } + hl_rx_opt_trg = { // Trigger HL RX configuration (toggle switch) + Type = bool + NumberOfElements = 1 + } + } + } + + +MXIDsFifoAcqEn = { + Class = NI9157::NI9157MxiDataSource + NI9157DevicePath = NiDevice + RunNi = 0 + NumberOfPacketsInFIFO = 1 + BlockIfNotRunning = 0 + Signals = { + FIFO0_U64_WR = { + Type = uint64 + NumberOfElements = 1 + NumberOfDimensions = 1 + } + } + } + + +MXIDsFifoConfig = { + Class = NI9157::NI9157MxiDataSource + NI9157DevicePath = NiDevice + RunNi = 0 + NumberOfPacketsInFIFO = 1 + BlockIfNotRunning = 0 + Signals = { + FIFO0_U64_WR = { + Type = uint64 + NumberOfElements = 16 + NumberOfDimensions = 1 + } + } + } + + +SdnPlcPub = { + Class = SDN::SDNPublisher + Interface = "eno2" + Address = "10.0.0.20:2004" + Topic = 0 + NetworkByteOrder = 1 + Signals = { + // Header Signals + HeaderNF = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + HeaderNI = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + HeaderNC = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + HeaderNS = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + HeaderNA = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + HeaderS = { + Type = uint8 + NumberOfElements = 3 + NumberOfDimensions = 1 + } + // Float32 Signals + VB1TREF = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB1 = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2TREF = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2 = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB1RR = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2RR = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB1TH = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2TH = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VKTH = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VK = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + PSKT = { + Type = float32 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + // UInt16 Signals + VB1UP = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2UP = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB1TSEL = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VB2TSEL = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VKSEL = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + BODR = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + VKUP = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + MDKF = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + CSTAT = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + COMOD = { + Type = uint16 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + // UInt8 Commands + CFG = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + SM = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + + +SdnPlcSub = { + Class = SDN::SDNSubscriber + ExecutionMode = IndependentThread + Interface = "eno2" + Address = "10.0.0.22:2004" + CPUs = 0x00020000 + Topic = 0 + IgnoreTimeoutError = 1 + Timeout = 0 + Signals = { + Header = { + Type = uint8 + NumberOfElements = 48 + NumberOfDimensions = 1 + } + PLC_HEADER = { + Type = uint8 + NumberOfElements = 8 + NumberOfDimensions = 1 + } + ACK_CFG = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + ACK_SMC = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + STATE_CFG = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + STATE_SMC = { + Type = uint8 + NumberOfElements = 1 + NumberOfDimensions = 0 + } + } + } + + +DANWriterT1 = { + Class = DAN::DANSource + NumberOfBuffers = 300 + CPUMask = 0x00040000 + DanBufferMultiplier = 8 + StackSize = 10000000 + NumberOfPreTriggers = 0 + NumberOfPostTriggers = 0 + StoreOnTrigger = 1 + ICProgName = MARTeAppRun + Signals = { + DANWriterT1_Trigger = { + Type = uint8 + } + DANWriterT1_TimeSamples = { + Type = uint64 + TimeSignal = 1 + AbsoluteTime = 1 + } + DANWriterT1_Time = { + Type = uint64 + NodeName = "EC-GN-P5C:R_T1_Time" + Period = 10.0e-3 + } + DANWriterT1_MXIAbsTime = { + Type = uint64 + NodeName = "EC-GN-P5C:R_T1_MXIAbsTime" + Period = 10.0e-3 + } + DANWriterT1_SMState = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_SMState" + Period = 10.0e-3 + } + DANWriterT1_AcqStatus = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_AcqStatus" + Period = 10.0e-3 + } + DANWriterT1_MXICfgSupDone = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXICfgSupDone" + Period = 10.0e-3 + } + DANWriterT1_MXICfgSupError = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXICfgSupError" + Period = 10.0e-3 + } + DANWriterT1_MXICfgSupStatus = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXICfgSupStatus" + Period = 10.0e-3 + } + DANWriterT1_MXIBaseCfgTrg = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIBaseCfgTrg" + Period = 10.0e-3 + } + DANWriterT1_MXIBaseCfgMode = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIBaseCfgMode" + Period = 10.0e-3 + } + DANWriterT1_MXIBaseCfgDone = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIBaseCfgDone" + Period = 10.0e-3 + } + DANWriterT1_MXIBaseCfgStatus = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIBaseCfgStatus" + Period = 10.0e-3 + } + DANWriterT1_MXIAcqEnTrg = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIAcqEnTrg" + Period = 10.0e-3 + } + DANWriterT1_MXIAcqEnDone = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIAcqEnDone" + Period = 10.0e-3 + } + DANWriterT1_MXIAcqEnStatus = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXIAcqEnStatus" + Period = 10.0e-3 + } + DANWriterT1_MXITrpCfgTrg = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXITrpCfgTrg" + Period = 10.0e-3 + } + DANWriterT1_MXITrpCfgDone = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXITrpCfgDone" + Period = 10.0e-3 + } + DANWriterT1_MXITrpCfgError = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_MXITrpCfgError" + Period = 10.0e-3 + } + DANWriterT1_PlcCfgSupTxTrg = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_PlcCfgSupTxTrg" + Period = 10.0e-3 + } + DANWriterT1_PlcCfgSupDone = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_PlcCfgSupDone" + Period = 10.0e-3 + } + DANWriterT1_PlcCfgSupError = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_PlcCfgSupError" + Period = 10.0e-3 + } + DANWriterT1_PlcCfgSupStatus = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T1_PlcCfgSupStatus" + Period = 10.0e-3 + } + DANWriterT1_PreCfg_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_PreCfg_CT" + Period = 10.0e-3 + } + DANWriterT1_MxiCfg_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_MxiCfg_CT" + Period = 10.0e-3 + } + DANWriterT1_PlcCfg_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_PlcCfg_CT" + Period = 10.0e-3 + } + DANWriterT1_TestRun_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_TestRun_CT" + Period = 10.0e-3 + } + DANWriterT1_TestPost_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_TestPost_CT" + Period = 10.0e-3 + } + DANWriterT1_CfgError_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_CfgError_CT" + Period = 10.0e-3 + } + DANWriterT1_Error_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_Error_CT" + Period = 10.0e-3 + } + DANWriterT1_FirstGAM_ReadTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_FirstGAM_RT" + Period = 10.0e-3 + } + DANWriterT1_LastGAM_ExecTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T1_LastGAM_ET" + Period = 10.0e-3 + } + } + } + +EpicsOutput_T1 = { + Class = EPICSCA::EPICSCAOutput + CPUs = 0xFF + NumberOfBuffers = 50 + Signals = { + InitTime_L = { + PVName = EC-GN-P5C:R_T1_ONLINE_T_L + Type = uint32 + } + InitTime_H = { + PVName = EC-GN-P5C:R_T1_ONLINE_T_H + Type = uint32 + } + FinalTime_L = { + PVName = EC-GN-P5C:R_T1_OFFLINE_T_L + Type = uint32 + } + FinalTime_H = { + PVName = EC-GN-P5C:R_T1_OFFLINE_T_H + Type = uint32 + } + } + } + + // ------------ T1 END ------------ // + + // ----------- T2 START ----------- // + // Fast Thread - GET ACQ Data + WaveformMonitors + DANWriterWriter2 + +DDB2 = { + Class = GAMDataSource + } + + +MXIUsFifoDataT2 = { + Class = NI9157::NI9157CircularFifoReader + NumberOfBuffers = 300 + CpuMask = 0x00008000 + NI9157DevicePath = NiDevice + RunNi = 0 + NumberOfPacketsInFIFO = 3 + NonBlockSleepT = 1.0e-6 + TriggerAfterNPackets = 1 + Timeout = 1 + FifoName = FIFO1_U64_RD + GetFirst = 1 + CheckFrame = 1 + +Checker = { + Class = MarkerBitChecker + SampleSize = 8 + NumOfFrameForSync = 1 + MarkerBitMask = 0x8000000000000000 + ResetBitMask = 0xC000000000000000 + } + Signals = { + MXIUpstreamData = { + Type = uint64 + NumberOfDimensions = 1 + NumberOfElements = 3001 + HeaderSize = 8 + // AI3[63:48] AI2[47:32] AI1[31:16] AI0[15:0] + // NU[63:48] AI6[47:32] AI5[31:16] AI4[15:0] + // NU[63:2] DI0[1] DI0[0] + PacketMemberSizes = {2, 2, 2, 2, 2, 2, 2, 2, 8} + } + ErrorCheck = { + Type = uint32 + NumberOfElements = 1 + } + } + } + + +DANWriterT2 = { + Class = DAN::DANSource + NumberOfBuffers = 300 + CPUMask = 0x00080000 + DanBufferMultiplier = 8 + StackSize = 10000000 + NumberOfPreTriggers = 0 + NumberOfPostTriggers = 0 + StoreOnTrigger = 1 + ICProgName = MARTeAppRun + Signals = { + DANWriterT2_Trigger = { + Type = uint8 + } + DANWriterT2_TimeSamples = { + Type = uint64 + TimeSignal = 1 + AbsoluteTime = 1 + } + DANWriterT2_Time = { + Type = uint64 + NodeName = "EC-GN-P5C:R_T2_Time" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_0_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_0" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_1_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_2_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_2" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_3_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_3" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_4_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_4" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_5_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_5" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_AI_6_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_AI_6" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_DI_0_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_DI_0" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_USC_DI_1_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T2_USC_DI_1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT2_ERRORCHECK = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_ERRORCHECK" + Period = 500.0e-6 + } + DANWriterT2_PlcCfg_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_PlcCfg_CT" + Period = 500.0e-6 + } + DANWriterT2_TestRun_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_TestRun_CT" + Period = 500.0e-6 + } + DANWriterT2_TestPost_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_TestPost_CT" + Period = 500.0e-6 + } + DANWriterT2_FirstGAM_ReadTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_FirstGAM_RT" + Period = 500.0e-6 + } + DANWriterT2_LastGAM_ExecTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T2_LastGAM_ET" + Period = 500.0e-6 + } + } + } + + +FileWriterBufferT2 = { + Class = FileDataSource::FileWriter + NumberOfBuffers = 300 + CPUMask = 0x00400000 + StackSize = 10000000 + Filename = "/mnt/disktmpfs/AmpegonPsTb_Data/AmpegonPsTb_BinaryBuffers/TestRunBuffer_REGKEY_POST_BUILD_DAN_PREFIX5101001.bin" + Overwrite = "yes" + FileFormat = "binary" + StoreOnTrigger = 1 + RefreshContent = 0 + NumberOfPreTriggers = 0 + NumberOfPostTriggers = 0 + Signals = { + FileWriterT2_Trigger = { + Type = uint8 + } + FileWriterT2_Time = { + Type = uint64 + NumberOfElements = 1000 + } + FileWriterT2_USC_AI_0_VALUE = { + Type = uint16 + NumberOfElements = 1000 + } + FileWriterT2_USC_AI_1_VALUE = { + Type = uint16 + NumberOfElements = 1000 + } + FileWriterT2_USC_AI_2_VALUE = { + Type = uint16 + NumberOfElements = 1000 + } + FileWriterT2_USC_DI_0_VALUE = { + Type = uint16 + NumberOfElements = 1000 + } + } + } + + +EpicsOutput_T2 = { + Class = EPICSCA::EPICSCAOutput + CPUs = 0xFF + NumberOfBuffers = 50 + Signals = { + InitTime_L = { + PVName = EC-GN-P5C:R_T2_ONLINE_T_L + Type = uint32 + } + InitTime_H = { + PVName = EC-GN-P5C:R_T2_ONLINE_T_H + Type = uint32 + } + FinalTime_L = { + PVName = EC-GN-P5C:R_T2_OFFLINE_T_L + Type = uint32 + } + FinalTime_H = { + PVName = EC-GN-P5C:R_T2_OFFLINE_T_H + Type = uint32 + } + } + } + + // ------------ T2 END ------------ // + + // ----------- T3 START ----------- // + // Fast Thread - Get DEBUG Data + DANWriterWriter 3 + +DDB3 = { + Class = GAMDataSource + } + + +MXIUsFifoDebugT3 = { + Class = NI9157::NI9157CircularFifoReader + NumberOfBuffers = 300 + CpuMask = 0x00010000 + NI9157DevicePath = NiDevice + RunNi = 0 + NumberOfPacketsInFIFO = 3 + NonBlockSleepT = 1.0e-6 + TriggerAfterNPackets = 1 + Timeout = 1 + FifoName = FIFO2_U64_RD + GetFirst = 1 + CheckFrame = 1 + +Checker = { + Class = MarkerBitChecker + SampleSize = 8 + NumOfFrameForSync = 1 + MarkerBitMask = 0x8000000000000000 + ResetBitMask = 0xC000000000000000 + } + Signals = { + MXIUpstreamDebug = { + Type = uint64 + NumberOfDimensions = 1 + NumberOfElements = 2001 + HeaderSize = 8 + // NU[63:48] AO2[47:32] AO1[31:16] AO0[15:0]} + // NU[63:12] PWON[11] FS2[10] FS1[9] MOD2[8] + // MOD1[7] DO4[6] DO3[5] DO2[4] + // DO1[3] DO0[2] MO1[1] MO0[0] + PacketMemberSizes = {2, 2, 2, 2, 8} + } + ErrorCheck = { + Type = uint32 + NumberOfElements = 1 + } + } + } + + +DANWriterT3 = { + Class = DAN::DANSource + NumberOfBuffers = 300 + CPUMask = 0x00100000 + DanBufferMultiplier = 8 + StackSize = 10000000 + NumberOfPreTriggers = 0 + NumberOfPostTriggers = 0 + StoreOnTrigger = 1 + ICProgName = MARTeAppRun + Signals = { + DANWriterT3_Trigger = { + Type = uint8 + } + DANWriterT3_TimeSamples = { + Type = uint64 + TimeSignal = 1 + AbsoluteTime = 1 + } + DANWriterT3_Time = { + Type = uint64 + NodeName = "EC-GN-P5C:R_T3_Time" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_0_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T3_DBG_AO_0" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_1_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T3_DBG_AO_1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_AO_2_VALUE = { + Type = uint16 + NodeName = "EC-GN-P5C:R_T3_DBG_AO_2" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MO_0_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_MO_0" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MO_1_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_MO_1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_0_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_DO_0" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_1_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_DO_1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_2_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_DO_2" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_3_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_DO_3" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_DO_4_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_DO_4" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MOD1_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_MOD1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_MOD2_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_MOD2" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_FS1_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_FS1" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_FS2_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_FS2" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_DBG_PWON_VALUE = { + Type = uint8 + NodeName = "EC-GN-P5C:R_T3_DBG_PWON" + Period = 500.0e-9 + NumberOfElements = 1000 + NumberOfDimensions = 1 + } + DANWriterT3_ERRORCHECK = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_ERRORCHECK" + Period = 500.0e-6 + } + DANWriterT3_PlcCfg_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_PlcCfg_CT" + Period = 500.0e-6 + } + DANWriterT3_TestRun_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_TestRun_CT" + Period = 500.0e-6 + } + DANWriterT3_TestPost_CycleTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_TestPost_CT" + Period = 500.0e-6 + } + DANWriterT3_FirstGAM_ReadTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_FirstGAM_RT" + Period = 500.0e-6 + } + DANWriterT3_LastGAM_ExecTime = { + Type = uint32 + NodeName = "EC-GN-P5C:R_T3_LastGAM_ET" + Period = 500.0e-6 + } + } + } + +EpicsOutput_T3 = { + Class = EPICSCA::EPICSCAOutput + CPUs = 0xFF + NumberOfBuffers = 50 + Signals = { + InitTime_L = { + PVName = EC-GN-P5C:R_T3_ONLINE_T_L + Type = uint32 + } + InitTime_H = { + PVName = EC-GN-P5C:R_T3_ONLINE_T_H + Type = uint32 + } + FinalTime_L = { + PVName = EC-GN-P5C:R_T3_OFFLINE_T_L + Type = uint32 + } + FinalTime_H = { + PVName = EC-GN-P5C:R_T3_OFFLINE_T_H + Type = uint32 + } + } + } + // ------------ T3 END ------------ // + } + +States = { + Class = ReferenceContainer + +PreCfg = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, EventMessageBypassPreCfg, AcquisitionStatusMonitor, /*AcquisitionStatusMessages, + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + +MxiCfg = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages, + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + +PlcCfg = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages, + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + +Thread2Daq = { + Class = RealTimeThread + CPUs = 0x00000200 + Functions = { + // RX PATH + MxiDataUsFifoDataT2, DigitalInputSplitterT2, TimeConversionT2, TimeConversionT2_Abs, MXIMasterTimeT2, + // CONST GAM + DANWriterWriteDataWindowLimitsT2, + // FLOW CTRL + DANWriterWriteDataWindowT2, + // MON/STATE CTRL + AppMonitorT2, ExecutionMonitorT2, + // STORAGE + StoreStartPulseTime_T2, + StoreStopPulseTime_T2, + DANWriterWriteDataT2, FileWriterBufferDataT2 + } + } + +Thread3Dbg = { + Class = RealTimeThread + CPUs = 0x00000400 + Functions = { + // RX PATH + MxiDataUsFifoDataT3, DigitalInputSplitterT3, TimeConversionT3, TimeConversionT3_Abs, MXIMasterTimeT3, + // CONST GAM + DANWriterWriteDataWindowLimitsT3, + // FLOW CTRL + DANWriterWriteDataWindowT3, + // TX PATH + // NOOP, + // MON/STATE CTR + AppMonitorT3, ExecutionMonitorT3, + // STORAGE + StoreStartPulseTime_T3, + StoreStopPulseTime_T3, + DANWriterWriteDataT3 + } + } + } + } + +TestRun = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, AcquisitionStatusMessages, + /*CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + +Thread2Daq = { + Class = RealTimeThread + CPUs = 0x00000200 + Functions = { + // RX PATH + MxiDataUsFifoDataT2, DigitalInputSplitterT2, TimeConversionT2, TimeConversionT2_Abs, MXIMasterTimeT2, + // CONST GAM + DANWriterWriteDataWindowLimitsT2, + // FLOW CTRL + DANWriterWriteDataWindowT2, + // MON/STATE CTRL + AppMonitorT2, ExecutionMonitorT2, + // STORAGE + StoreStartPulseTime_T2, + StoreStopPulseTime_T2, + DANWriterWriteDataT2, FileWriterBufferDataT2 + } + } + +Thread3Dbg = { + Class = RealTimeThread + CPUs = 0x00000400 + Functions = { + // RX PATH + MxiDataUsFifoDataT3, DigitalInputSplitterT3, TimeConversionT3, TimeConversionT3_Abs, MXIMasterTimeT3, + // CONST GAM + DANWriterWriteDataWindowLimitsT3, + // FLOW CTRL + DANWriterWriteDataWindowT3, + // TX PATH + // NOOP, + // MON/STATE CTR + AppMonitorT3, ExecutionMonitorT3, + // STORAGE + StoreStartPulseTime_T3, + StoreStopPulseTime_T3, + DANWriterWriteDataT3 + } + } + } + } + +TestPost = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages,*/ + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, /*TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + +TestDone = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages,*/ + CycleCounterT1, TestPostTasksDelay, /*TestPostGotoTestDone,*/ TestDoneCallTasks, EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + +CfgError = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages, + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + +Error = { + Class = RealTimeState + +Threads = { + Class = ReferenceContainer + +Thread1Cfg = { + Class = RealTimeThread + CPUs = 0x00000100 + Functions = { + // TIMER + Timer, CurrentTime_T1, TimeConverter, + // RX PATH + MXIRead, MXIModuleFullFlagSplitter, MXIMasterTime, PlcPacketRx, + // CONST GAM + AppStateMachineState, DANWriterWriteEnable, MXISupervisorVariables, MXIBaseConfigurationVariables, + MXIDsFifoAcqEnVariables, PlcPacketTxVariables, StateMachineTasksDelay, + AcquisitionStatusDaq, AcquisitionStatusDbg, + // FLOW CTRL + MXIConfigurationSupervisor, MXIBaseConfiguration, + MXIAcquisitionEnable, MXITripletConfiguration, PlcConfigurationSupervisor, + // TX PATH + MXIWriteRst, MXIWriteHlOpt, MXIWriteEn, MXIWriteDbg, + MXIWriteDsFifoAcqEn, MXIWriteDsFifoConfig, PlcPacketTx, + // MON/STATE CTRL + AppMonitor, /*EventMessageBypassPreCfg,*/ AcquisitionStatusMonitor, /*AcquisitionStatusMessages, + CycleCounterT1, TestPostTasksDelay, TestPostGotoTestDone, TestDoneCallTasks,*/ EventMessages, + // STORAGE + StoreStartPulseTime_T1, + StoreStopPulseTime_T1, + DANWriterWriteData + } + } + } + } + } + +Scheduler = { + Class = GAMScheduler + TimingDataSource = Timings + } +} diff --git a/test/validator_signal_test.go b/test/validator_signal_test.go new file mode 100644 index 0000000..46ecab9 --- /dev/null +++ b/test/validator_signal_test.go @@ -0,0 +1,73 @@ +package integration + +import ( + "strings" + "testing" + + "github.com/marte-dev/marte-dev-tools/internal/index" + "github.com/marte-dev/marte-dev-tools/internal/parser" + "github.com/marte-dev/marte-dev-tools/internal/validator" +) + +func TestSignalValidation(t *testing.T) { + content := ` ++Data = { + Class = ReferenceContainer + +ValidDS = { + Class = DataSource + Signals = { + ValidSig = { + Type = uint32 + } + } + } + +MissingTypeDS = { + Class = DataSource + Signals = { + InvalidSig = { + // Missing Type + Dummy = 1 + } + } + } + +InvalidTypeDS = { + Class = DataSource + Signals = { + InvalidSig = { + Type = invalid_type + } + } + } +} +` + p := parser.NewParser(content) + config, err := p.Parse() + if err != nil { + t.Fatalf("Parse failed: %v", err) + } + + idx := index.NewProjectTree() + idx.AddFile("signal_test.marte", config) + + v := validator.NewValidator(idx, ".") + v.ValidateProject() + + foundMissing := false + foundInvalid := false + + for _, d := range v.Diagnostics { + if strings.Contains(d.Message, "missing mandatory field 'Type'") { + foundMissing = true + } + if strings.Contains(d.Message, "Invalid Type 'invalid_type'") { + foundInvalid = true + } + } + + if !foundMissing { + t.Error("Expected error for missing Type field in Signal") + } + if !foundInvalid { + t.Error("Expected error for invalid Type value in Signal") + } +} diff --git a/test/validator_signals_content_test.go b/test/validator_signals_content_test.go new file mode 100644 index 0000000..e1c944a --- /dev/null +++ b/test/validator_signals_content_test.go @@ -0,0 +1,59 @@ +package integration + +import ( + "strings" + "testing" + + "github.com/marte-dev/marte-dev-tools/internal/index" + "github.com/marte-dev/marte-dev-tools/internal/parser" + "github.com/marte-dev/marte-dev-tools/internal/validator" +) + +func TestSignalsContentValidation(t *testing.T) { + content := ` ++Data = { + Class = ReferenceContainer + +BadDS = { + Class = DataSource + Signals = { + BadField = 1 + BadArray = { 1 2 } + // Valid signal + ValidSig = { + Type = uint32 + } + } + } +} +` + p := parser.NewParser(content) + config, err := p.Parse() + if err != nil { + t.Fatalf("Parse failed: %v", err) + } + + idx := index.NewProjectTree() + idx.AddFile("signals_content.marte", config) + + v := validator.NewValidator(idx, ".") + v.ValidateProject() + + foundBadField := false + foundBadArray := false + + for _, d := range v.Diagnostics { + if strings.Contains(d.Message, "Field 'BadField' is not allowed") { + foundBadField = true + } + if strings.Contains(d.Message, "Field 'BadArray' is not allowed") { + foundBadArray = true + } + } + + if !foundBadField { + t.Error("Expected error for BadField in Signals") + } + if !foundBadArray { + t.Error("Expected error for BadArray in Signals") + } +}