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

Functions

None generate_hwmap (str oksfile, int n_streams, int n_apps=1, int det_id=3, str app_host="localhost", str eth_protocol="udp", str flx_mode="fix_rate", int crate_id_offset=1, int slot_id=0)

Variables

 n_apps

Function Documentation

◆ generate_hwmap()

None generate_hwmap ( str oksfile,
int n_streams,
int n_apps = 1,
int det_id = 3,
str app_host = "localhost",
str eth_protocol = "udp",
str flx_mode = "fix_rate",
int crate_id_offset = 1,
int slot_id = 0 )

Definition at line 8 of file generate_hwmap.py.

18) -> None:
19
20 schemafiles = [
21 "schema/confmodel/dunedaq.schema.xml",
22 "schema/appmodel/application.schema.xml",
23 "schema/appmodel/fdmodules.schema.xml",
24 "schema/appmodel/wiec.schema.xml",
25 ]
26 dal = conffwk.dal.module("generated", schemafiles[-1])
27 db = conffwk.Configuration("oksconflibs")
28 db.create_db(oksfile, schemafiles)
29
30 group_name = os.path.basename(oksfile).removesuffix(".data.xml")
31 groups = []
32 streams = []
33 senders = []
34 source_id = 0
35
36 for app in range(n_apps):
37 print (f"Generating {app=}")
38 print(f"New nic adding nic with id nic-{app}")
39 nic_dal = dal.NetworkInterface(f"nic-{app}")
40 db.update_dal(nic_dal)
41
42 for stream_no in range(n_streams):
43 print (f"Generating {stream_no=}")
44
45 # 28-May-2025, KAB: hack(?) to get DAPHNE TPs to have unique channel numbers
46 # within a single ReadoutApp. This involves setting DAPHNE slot numbers to
47 # unique values. There is probably more work to be done to get the DAPHNE
48 # and WIBEth crate/slot/stream numbers that we use in fake-data-playback and
49 # integration tests to better match real electronics, but hopefully this is
50 # sufficient for now.
51 if det_id in [2, 8, 9]:
52 geo_dal = dal.GeoId(
53 f"geioId-{source_id}",
54 detector_id=det_id,
55 crate_id=app+crate_id_offset,
56 slot_id=stream_no,
57 stream_id=1,
58 )
59 else:
60 geo_dal = dal.GeoId(
61 f"geioId-{source_id}",
62 detector_id=det_id,
63 crate_id=app+crate_id_offset,
64 slot_id=slot_id,
65 stream_id=stream_no,
66 )
67 db.update_dal(geo_dal)
68 stream = dal.DetectorStream(
69 f"stream-{source_id}",
70 source_id=source_id,
71 geo_id=geo_dal,
72 )
73 db.update_dal(stream)
74 streams.append(stream)
75 db.commit()
76
77 sender_dal = dal.FakeDataSender(
78 f"sender-{source_id}",
79 streams=[stream],
80 uses=nic_dal
81 )
82 db.update_dal(sender_dal)
83 senders.append(sender_dal)
84 db.commit()
85
86 source_id = source_id + 1
87
88 rec_dal = dal.FakeDataReceiver(
89 f"dataRec-{app}",
90 uses=nic_dal
91 )
92 db.update_dal(rec_dal)
93 detconn_dal = dal.NetworkDetectorToDaqConnection(
94 f"det-conn-{app}",
95 net_receiver=rec_dal,
96 net_senders=senders
97 )
98 db.update_dal(detconn_dal)
99 groups.append(detconn_dal)
100 senders = []
101
102 db.commit()
103
module(name, schema, other_dals=[], backend='oksconflibs', db=None)
Definition dal.py:695

Variable Documentation

◆ n_apps

generate_hwmap.n_apps

Definition at line 105 of file generate_hwmap.py.