simbricks-enso-sim-bm-py 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ Metadata-Version: 2.4
2
+ Name: simbricks-enso-sim-bm-py
3
+ Version: 0.6.0
4
+ Summary: Ensō NIC behavioral model integration into SimBricks
5
+ Author: Team SimBricks
6
+ Author-email: team@simbricks.io
7
+ Requires-Python: >=3.12
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.12
10
+ Classifier: Programming Language :: Python :: 3.13
11
+ Classifier: Programming Language :: Python :: 3.14
12
+ Classifier: Programming Language :: Python :: 3.15
13
+ Requires-Dist: simbricks-enso-sys-py (>=0.6.0)
14
+ Requires-Dist: simbricks-orchestration (>=0.6.0)
15
+ Requires-Dist: simbricks-utils (>=0.6.0)
16
+ Project-URL: Homepage, https://www.simbricks.io/
@@ -0,0 +1,46 @@
1
+ # MIT License
2
+ #
3
+ # Copyright (c) 2026 SimBricks
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ [tool.black]
24
+ line-length = 100
25
+
26
+ [build-system]
27
+ requires = ["poetry-core>=1.0.0"]
28
+ build-backend = "poetry.core.masonry.api"
29
+
30
+ [tool.poetry]
31
+ name = "simbricks-enso-sim-bm-py"
32
+ version = "0.6.0"
33
+ description = "Ensō NIC behavioral model integration into SimBricks"
34
+ authors = [
35
+ "Team SimBricks <team@simbricks.io>"
36
+ ]
37
+ homepage = "https://www.simbricks.io/"
38
+ packages = [
39
+ { include = "simbricks" }
40
+ ]
41
+
42
+ [tool.poetry.dependencies]
43
+ python = ">=3.12"
44
+ simbricks-orchestration = ">=0.6.0"
45
+ simbricks-utils = ">=0.6.0"
46
+ simbricks-enso-sys-py = ">=0.6.0"
@@ -0,0 +1,26 @@
1
+ # Copyright 2026 Max Planck Institute for Software Systems,
2
+ # National University of Singapore, Carnegie Mellon University,
3
+ # and SimBricks UG (haftungsbeschränkt)
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ from .enso import EnsoNicSim
25
+
26
+ __all__ = ["EnsoNicSim"]
@@ -0,0 +1,71 @@
1
+ # Copyright 2026 Max Planck Institute for Software Systems,
2
+ # National University of Singapore, Carnegie Mellon University,
3
+ # and SimBricks UG (haftungsbeschränkt)
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining
6
+ # a copy of this software and associated documentation files (the
7
+ # "Software"), to deal in the Software without restriction, including
8
+ # without limitation the rights to use, copy, modify, merge, publish,
9
+ # distribute, sublicense, and/or sell copies of the Software, and to
10
+ # permit persons to whom the Software is furnished to do so, subject to
11
+ # the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be
14
+ # included in all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ from __future__ import annotations
25
+
26
+ import typing_extensions as tpe
27
+
28
+ from simbricks.components.enso.system import enso as enso_sys
29
+ from simbricks.orchestration.instantiation import base as inst_base
30
+ from simbricks.orchestration.simulation import base as sim_base
31
+ from simbricks.orchestration.simulation import pcidev
32
+ from simbricks.utils import base as utils_base
33
+
34
+
35
+ class EnsoNicSim(pcidev.NICSim):
36
+ """Behavioral model of the Ensō NIC.
37
+
38
+ Runs the ``simb_enso_bm`` binary from ``simbricks-enso-sim-bm-bin``, which
39
+ is resolved through ``PATH``.
40
+ """
41
+
42
+ def __init__(self, simulation: sim_base.Simulation):
43
+ super().__init__(
44
+ simulation=simulation,
45
+ executable="simb_enso_bm",
46
+ )
47
+ self.name = f"EnsoNicSim-{self._id}"
48
+
49
+ def resreq_mem(self) -> int:
50
+ return 2048
51
+
52
+ def add(self, nic: enso_sys.EnsoNIC):
53
+ utils_base.has_expected_type(nic, enso_sys.EnsoNIC)
54
+ super().add(nic)
55
+
56
+ def run_cmd(self, inst: inst_base.Instantiation) -> str:
57
+ cmd = super().run_cmd(inst)
58
+ if self.mac:
59
+ cmd += " " + ("".join(reversed(self.mac.split(":"))))
60
+ if self.log_file:
61
+ cmd += f" {self.log_file}"
62
+ return cmd
63
+
64
+ def toJSON(self) -> dict:
65
+ json_obj = super().toJSON()
66
+ return json_obj
67
+
68
+ @classmethod
69
+ def fromJSON(cls, simulation: sim_base.Simulation, json_obj: dict) -> tpe.Self:
70
+ instance = super().fromJSON(simulation, json_obj)
71
+ return instance