Skip to content
This repository has been archived by the owner on Aug 24, 2020. It is now read-only.

Commit

Permalink
feat: Optimization for the global environment access.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerzy Jamroz committed May 7, 2020
1 parent 44cfb2c commit 3119cea
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 23 deletions.
24 changes: 24 additions & 0 deletions cmds/test/st-evg.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .cmd
require "mrfioc2" "2.2.1rc1"

epicsEnvSet "TOP" "$(E3_CMD_TOP)/../.."
epicsEnvSet "PEVG" "MTCA5U-EVG"

#epicsEnvSet "EVT_PMORTEM" "66"

# Load environment
iocshLoad "$(TOP)/iocsh/mtca.iocsh"
#iocshLoad "$(TOP)/iocsh/ts.iocsh"

## Load record instances
iocshLoad "$(TOP)/iocsh/evm.iocsh" "P=$(PEVG), OBJ=EVG, PCIID=$(MTCA_5U_PCIID7)"

iocInit

iocshLoad "$(TOP)/iocsh/evgr.iocsh" "P=$(PEVG), INTRF=, INTPPS="
iocshLoad "$(TOP)/iocsh/evgasynr.iocsh" "P=$(PEVG), EVT_PMORTEM=$(EVT_PMORTEM=40), EVT_PMORTEMI=$(EVT_PMORTEMI=41), EVT_DOD=$(EVT_DOD=42), EVT_DODI=$(EVT_DODI=43)"

# EOF



20 changes: 10 additions & 10 deletions iocsh/evgasynr.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# ==========

# Trigger embedded EVR U with the post-mortem upstream input event
dbpf $(P)$(R=)$(U=U:)DlyGen0-Evt-Trig0-SP $(EVT_PMORTEMI)
dbpf $(P)$(R=)$(U=U:)DlyGen0-Width-SP 1
dbpf $(P)$(R=)$(U=U:)OutFP0-Src-Pulse-SP "Pulser 0"
dbpf $(P)$(R=)$(U=":EVRU-")DlyGen0-Evt-Trig0-SP $(EVT_PMORTEMI)
dbpf $(P)$(R=)$(U=":EVRU-")DlyGen0-Width-SP 1
dbpf $(P)$(R=)$(U=":EVRU-")OutFP0-Src-Pulse-SP "Pulser 0"
# Broadcast the post-mortemevent
dbpf $(P)$(R=)$(S=:)TrigEvt2-EvtCode-SP $(EVT_PMORTEM)
dbpf $(P)$(R=)$(S=:)TrigEvt2-TrigSrc-Cont-Sel "Univ8"
dbpf $(P)$(R=)$(S=":")TrigEvt2-EvtCode-SP $(EVT_PMORTEM)
dbpf $(P)$(R=)$(S=":")TrigEvt2-TrigSrc-Cont-Sel "Univ8"

# Trigger embedded EVR U with the data-on-demand upstream input event
dbpf $(P)$(R=)$(U=U:)DlyGen1-Evt-Trig0-SP $(EVT_DODI)
dbpf $(P)$(R=)$(U=U:)DlyGen1-Width-SP 1
dbpf $(P)$(R=)$(U=U:)OutFP1-Src-Pulse-SP "Pulser 1"
dbpf $(P)$(R=)$(U=":EVRU-")DlyGen1-Evt-Trig0-SP $(EVT_DODI)
dbpf $(P)$(R=)$(U=":EVRU-")DlyGen1-Width-SP 1
dbpf $(P)$(R=)$(U=":EVRU-")OutFP1-Src-Pulse-SP "Pulser 1"
# Broadcast the data-on-demand event
dbpf $(P)$(R=)$(S=:)TrigEvt3-EvtCode-SP $(EVT_DOD)
dbpf $(P)$(R=)$(S=:)TrigEvt3-TrigSrc-Cont-Sel "Univ9"
dbpf $(P)$(R=)$(S=":")TrigEvt3-EvtCode-SP $(EVT_DOD)
dbpf $(P)$(R=)$(S=":")TrigEvt3-TrigSrc-Cont-Sel "Univ9"

#EOF
26 changes: 13 additions & 13 deletions iocsh/evgr.iocsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
# ==========

# Set EVM as master (EVG) and run sequences
dbpf $(P)$(R=)$(S=:)Enable-Sel "Ena Master"
dbpf $(P)$(R=)$(S=":")Enable-Sel "Ena Master"
# Select the RF input
$(INTRF="#")dbpf $(P)$(R=)$(S=:)EvtClk-Source-Sel "FracSyn (Int)"
$(EXTRF="#")dbpf $(P)$(R=)$(S=:)EvtClk-Source-Sel "RF (Ext)"
$(INTRF="#")dbpf $(P)$(R=)$(S=":")EvtClk-Source-Sel "FracSyn (Int)"
$(EXTRF="#")dbpf $(P)$(R=)$(S=":")EvtClk-Source-Sel "RF (Ext)"
# Change to PPS once connected
$(INTPPS="#")dbpf $(P)$(R=)$(S=:)1ppsInp-Sel "Sys Clk"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=:)1ppsInp-Sel "Front0"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=:)1ppsInp-MbbiDir_.TPRO "1"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=:)TrigEvt4-TrigSrc-Sel "Front0"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=:)TrigEvt4-EvtCode-SP "$(EVT_PPS=125)"
$(INTPPS="#")dbpf $(P)$(R=)$(S=":")1ppsInp-Sel "Sys Clk"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=":")1ppsInp-Sel "Front0"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=":")1ppsInp-MbbiDir_.TPRO "1"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=":")TrigEvt4-TrigSrc-Sel "Front0"
$(EXTPPS="#")dbpf $(P)$(R=)$(S=":")TrigEvt4-EvtCode-SP "$(EVT_PPS=125)"
epicsThreadSleep "1"

dbpf $(P)$(R=)$(S=:)SyncTimestamp-Cmd "1"
dbpf $(P)$(R=)$(S=":")SyncTimestamp-Cmd "1"

# Heartbeat 1Hz
dbpf $(P)$(R=)$(S=:)Mxc7-Polarity-Sel "Orginal"
dbpf $(P)$(R=)$(S=:)Mxc7-Prescaler-SP "$(MXC_1HZ=88052500)"
dbpf $(P)$(R=)$(S=:)TrigEvt7-EvtCode-SP "$(EVT_HBEAT=122)"
dbpf $(P)$(R=)$(S=:)TrigEvt7-TrigSrc-Sel "Mxc7"
dbpf $(P)$(R=)$(S=":")Mxc7-Polarity-Sel "Orginal"
dbpf $(P)$(R=)$(S=":")Mxc7-Prescaler-SP "$(MXC_1HZ=88052500)"
dbpf $(P)$(R=)$(S=":")TrigEvt7-EvtCode-SP "$(EVT_HBEAT=122)"
dbpf $(P)$(R=)$(S=":")TrigEvt7-TrigSrc-Sel "Mxc7"

#EOF

0 comments on commit 3119cea

Please sign in to comment.