DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
hermesmodules.hermescoreapp_gen Namespace Reference

Functions

 group_by_key (coll, key)
 Move to utility module.
 
 get_hermescore_app (name, host, addrtab, dro_map)
 

Variables

 default_load_path
 

Function Documentation

◆ get_hermescore_app()

hermesmodules.hermescoreapp_gen.get_hermescore_app ( name,
host,
addrtab,
dro_map )
Here the configuration for an entire daq_application instance using DAQModules from hermesmodules is generated.

Definition at line 33 of file hermescoreapp_gen.py.

38 ):
39 """
40 Here the configuration for an entire daq_application instance using DAQModules from hermesmodules is generated.
41 """
42
43 # UDP port - hardocoded for now
44 UDP_PORT=0x4444
45
46 # addrtab = "file://${HERMESMODULES_SHARE}/config/hermes_wib_v0.9.1/tx_mux_wib.xml"
47
48 # Crete a list of relevant stream parameters only
49 tx_infos = list(set([
50 (
51 s.geo_id.det_id,
52 s.geo_id.crate_id,
53 s.geo_id.slot_id,
54 s.parameters.tx_host,
55 int(s.geo_id.stream_id > 63), # hack
56 s.parameters.tx_ip,
57 s.parameters.tx_mac,
58 s.parameters.rx_ip,
59 s.parameters.rx_mac
60 ) for s in dro_map.streams if s.kind == 'eth'
61 ]))
62
63 # group the by actual cores using geoid and host
64 hermes_cores = group_by_key(tx_infos, lambda x: (x[0], x[1], x[2], x[3]))
65
66 modules = []
67 for (det, crate, slot, ctrl_ept), links in hermes_cores.items():
68 d = hermescontroller.Device(name=f"hermes_{det}_{crate}_{slot}", uri=f"ipbusudp-2.0://{ctrl_ept}:50001", addrtab=addrtab)
69 g = hermescontroller.GeoInfo(det_id=det, crate_id=crate, slot_id=slot)
70 lm = hermescontroller.LinkConfMap(
71 [hermescontroller.LinkConf(
72 id=link,
73 src_mac = tx_mac,
74 src_ip = tx_ip,
75 dst_mac = rx_mac,
76 dst_ip= rx_ip
77 ) for _,_,_,_,link,tx_ip,tx_mac,rx_ip,rx_mac in links]
78 )
79
80 modules += [DAQModule(name = f"hermes_{det}_{crate}_{slot}",
81 plugin = "HermesModule",
82 conf = hermescontroller.Conf(
83 device = d,
84 geo_info = g,
85 port = UDP_PORT,
86 links = lm
87 )
88 )]
89
90 mgraph = ModuleGraph(modules)
91 hermesmodules_app = App(modulegraph = mgraph, host = host, name = name)
92
93 return hermesmodules_app

◆ group_by_key()

hermesmodules.hermescoreapp_gen.group_by_key ( coll,
key )

Move to utility module.

 

Definition at line 22 of file hermescoreapp_gen.py.

22def group_by_key(coll, key):
23 """
24 """
25 m = {}
26 s = sorted(coll, key=key)
27 for k, g in groupby(s, key):
28 m[k] = list(g)
29 return m
30
31
32

Variable Documentation

◆ default_load_path

hermesmodules.hermescoreapp_gen.default_load_path

Definition at line 7 of file hermescoreapp_gen.py.