siliconcompiler 0.32.3__py3-none-any.whl → 0.33.1__py3-none-any.whl
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.
- siliconcompiler/__init__.py +19 -2
- siliconcompiler/_common.py +5 -0
- siliconcompiler/_metadata.py +1 -1
- siliconcompiler/apps/sc.py +2 -2
- siliconcompiler/apps/sc_install.py +10 -3
- siliconcompiler/apps/sc_issue.py +1 -1
- siliconcompiler/apps/sc_remote.py +10 -5
- siliconcompiler/apps/sc_show.py +2 -2
- siliconcompiler/apps/utils/replay.py +5 -3
- siliconcompiler/asic.py +120 -0
- siliconcompiler/checklist.py +150 -0
- siliconcompiler/core.py +299 -299
- siliconcompiler/flowgraph.py +803 -515
- siliconcompiler/fpga.py +84 -0
- siliconcompiler/metric.py +479 -0
- siliconcompiler/optimizer/vizier.py +2 -3
- siliconcompiler/package/__init__.py +29 -6
- siliconcompiler/pdk.py +415 -0
- siliconcompiler/record.py +453 -0
- siliconcompiler/remote/client.py +15 -5
- siliconcompiler/remote/schema.py +116 -112
- siliconcompiler/remote/server.py +9 -6
- siliconcompiler/report/dashboard/cli/__init__.py +14 -721
- siliconcompiler/report/dashboard/cli/board.py +899 -0
- siliconcompiler/report/dashboard/web/__init__.py +10 -10
- siliconcompiler/report/dashboard/web/components/__init__.py +5 -4
- siliconcompiler/report/dashboard/web/components/flowgraph.py +3 -3
- siliconcompiler/report/dashboard/web/components/graph.py +6 -3
- siliconcompiler/report/dashboard/web/state.py +1 -1
- siliconcompiler/report/dashboard/web/utils/__init__.py +4 -3
- siliconcompiler/report/html_report.py +2 -3
- siliconcompiler/report/report.py +22 -11
- siliconcompiler/report/summary_image.py +1 -1
- siliconcompiler/report/summary_table.py +3 -3
- siliconcompiler/report/utils.py +21 -14
- siliconcompiler/scheduler/__init__.py +234 -1206
- siliconcompiler/scheduler/run_node.py +2 -1
- siliconcompiler/scheduler/send_messages.py +11 -5
- siliconcompiler/scheduler/slurm.py +11 -44
- siliconcompiler/scheduler/taskscheduler.py +320 -0
- siliconcompiler/schema/__init__.py +19 -2
- siliconcompiler/schema/baseschema.py +493 -0
- siliconcompiler/schema/cmdlineschema.py +250 -0
- siliconcompiler/{sphinx_ext → schema/docs}/__init__.py +3 -1
- siliconcompiler/{sphinx_ext → schema/docs}/dynamicgen.py +63 -81
- siliconcompiler/{sphinx_ext → schema/docs}/schemagen.py +73 -85
- siliconcompiler/{sphinx_ext → schema/docs}/utils.py +12 -13
- siliconcompiler/schema/editableschema.py +136 -0
- siliconcompiler/schema/journalingschema.py +238 -0
- siliconcompiler/schema/namedschema.py +41 -0
- siliconcompiler/schema/packageschema.py +101 -0
- siliconcompiler/schema/parameter.py +791 -0
- siliconcompiler/schema/parametertype.py +323 -0
- siliconcompiler/schema/parametervalue.py +736 -0
- siliconcompiler/schema/safeschema.py +37 -0
- siliconcompiler/schema/schema_cfg.py +109 -1789
- siliconcompiler/schema/utils.py +5 -68
- siliconcompiler/schema_obj.py +119 -0
- siliconcompiler/tool.py +1416 -0
- siliconcompiler/tools/_common/__init__.py +6 -10
- siliconcompiler/tools/_common/asic.py +5 -5
- siliconcompiler/tools/_common/sdc/sc_constraints.sdc +1 -1
- siliconcompiler/tools/bluespec/convert.py +9 -8
- siliconcompiler/tools/builtin/_common.py +9 -2
- siliconcompiler/tools/builtin/concatenate.py +7 -3
- siliconcompiler/tools/builtin/minimum.py +7 -2
- siliconcompiler/tools/builtin/mux.py +8 -2
- siliconcompiler/tools/builtin/nop.py +7 -2
- siliconcompiler/tools/builtin/verify.py +11 -5
- siliconcompiler/tools/chisel/convert.py +10 -10
- siliconcompiler/tools/genfasm/bitstream.py +3 -3
- siliconcompiler/tools/ghdl/convert.py +1 -1
- siliconcompiler/tools/icarus/compile.py +4 -4
- siliconcompiler/tools/icepack/bitstream.py +6 -1
- siliconcompiler/tools/klayout/convert_drc_db.py +5 -0
- siliconcompiler/tools/klayout/drc.py +2 -2
- siliconcompiler/tools/klayout/klayout_export.py +0 -1
- siliconcompiler/tools/klayout/klayout_show.py +6 -6
- siliconcompiler/tools/klayout/klayout_utils.py +15 -22
- siliconcompiler/tools/netgen/count_lvs.py +2 -2
- siliconcompiler/tools/netgen/lvs.py +1 -1
- siliconcompiler/tools/nextpnr/apr.py +6 -1
- siliconcompiler/tools/nextpnr/nextpnr.py +4 -4
- siliconcompiler/tools/openroad/_apr.py +15 -2
- siliconcompiler/tools/openroad/rdlroute.py +3 -3
- siliconcompiler/tools/openroad/scripts/apr/postamble.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/apr/preamble.tcl +5 -5
- siliconcompiler/tools/openroad/scripts/apr/sc_antenna_repair.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_clock_tree_synthesis.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_placement.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_detailed_route.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_endcap_tapcell_insertion.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_fillercell_insertion.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_fillmetal_insertion.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_global_placement.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_global_route.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_init_floorplan.tcl +3 -9
- siliconcompiler/tools/openroad/scripts/apr/sc_macro_placement.tcl +3 -3
- siliconcompiler/tools/openroad/scripts/apr/sc_metrics.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_pin_placement.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_power_grid.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_design.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_repair_timing.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/apr/sc_write_data.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/common/procs.tcl +75 -1
- siliconcompiler/tools/openroad/scripts/common/read_input_files.tcl +1 -7
- siliconcompiler/tools/openroad/scripts/common/screenshot.tcl +2 -2
- siliconcompiler/tools/openroad/scripts/common/write_images.tcl +28 -3
- siliconcompiler/tools/openroad/scripts/sc_rcx.tcl +1 -1
- siliconcompiler/tools/openroad/scripts/sc_rdlroute.tcl +3 -3
- siliconcompiler/tools/openroad/scripts/sc_show.tcl +6 -6
- siliconcompiler/tools/opensta/scripts/sc_timing.tcl +10 -0
- siliconcompiler/tools/opensta/timing.py +11 -0
- siliconcompiler/tools/slang/__init__.py +13 -13
- siliconcompiler/tools/slang/elaborate.py +6 -6
- siliconcompiler/tools/slang/lint.py +1 -3
- siliconcompiler/tools/surelog/parse.py +4 -4
- siliconcompiler/tools/sv2v/convert.py +20 -3
- siliconcompiler/tools/verilator/compile.py +2 -2
- siliconcompiler/tools/verilator/verilator.py +3 -3
- siliconcompiler/tools/vpr/_xml_constraint.py +8 -8
- siliconcompiler/tools/vpr/place.py +1 -1
- siliconcompiler/tools/vpr/route.py +4 -4
- siliconcompiler/tools/vpr/screenshot.py +1 -1
- siliconcompiler/tools/vpr/show.py +5 -5
- siliconcompiler/tools/vpr/vpr.py +24 -24
- siliconcompiler/tools/xdm/convert.py +2 -2
- siliconcompiler/tools/xyce/simulate.py +1 -1
- siliconcompiler/tools/yosys/prepareLib.py +2 -2
- siliconcompiler/tools/yosys/sc_synth_asic.tcl +111 -63
- siliconcompiler/tools/yosys/screenshot.py +1 -1
- siliconcompiler/tools/yosys/syn_asic.py +7 -7
- siliconcompiler/toolscripts/_tools.json +12 -10
- siliconcompiler/toolscripts/rhel8/install-chisel.sh +9 -2
- siliconcompiler/toolscripts/rhel8/install-icarus.sh +10 -3
- siliconcompiler/toolscripts/rhel8/install-klayout.sh +8 -1
- siliconcompiler/toolscripts/rhel8/install-magic.sh +9 -2
- siliconcompiler/toolscripts/rhel8/install-montage.sh +1 -1
- siliconcompiler/toolscripts/rhel8/install-netgen.sh +9 -2
- siliconcompiler/toolscripts/rhel8/install-slang.sh +11 -4
- siliconcompiler/toolscripts/rhel8/install-surelog.sh +9 -2
- siliconcompiler/toolscripts/rhel8/install-sv2v.sh +11 -4
- siliconcompiler/toolscripts/rhel8/install-verible.sh +11 -3
- siliconcompiler/toolscripts/rhel8/install-verilator.sh +10 -3
- siliconcompiler/toolscripts/rhel8/install-xyce.sh +15 -10
- siliconcompiler/toolscripts/rhel9/install-chisel.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-ghdl.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-gtkwave.sh +10 -3
- siliconcompiler/toolscripts/rhel9/install-icarus.sh +10 -3
- siliconcompiler/toolscripts/rhel9/install-klayout.sh +8 -1
- siliconcompiler/toolscripts/rhel9/install-magic.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-montage.sh +1 -1
- siliconcompiler/toolscripts/rhel9/install-netgen.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-openroad.sh +16 -3
- siliconcompiler/toolscripts/rhel9/install-opensta.sh +17 -5
- siliconcompiler/toolscripts/rhel9/install-slang.sh +11 -4
- siliconcompiler/toolscripts/rhel9/install-surelog.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-sv2v.sh +11 -4
- siliconcompiler/toolscripts/rhel9/install-verible.sh +11 -3
- siliconcompiler/toolscripts/rhel9/install-verilator.sh +10 -3
- siliconcompiler/toolscripts/rhel9/install-vpr.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-xdm.sh +10 -2
- siliconcompiler/toolscripts/rhel9/install-xyce.sh +15 -10
- siliconcompiler/toolscripts/rhel9/install-yosys-moosic.sh +9 -2
- siliconcompiler/toolscripts/rhel9/install-yosys-parmys.sh +10 -3
- siliconcompiler/toolscripts/rhel9/install-yosys-slang.sh +10 -2
- siliconcompiler/toolscripts/rhel9/install-yosys.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-bambu.sh +10 -2
- siliconcompiler/toolscripts/ubuntu20/install-bluespec.sh +10 -3
- siliconcompiler/toolscripts/ubuntu20/install-chisel.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-ghdl.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-gtkwave.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-icarus.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-icepack.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-klayout.sh +8 -1
- siliconcompiler/toolscripts/ubuntu20/install-magic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-montage.sh +1 -1
- siliconcompiler/toolscripts/ubuntu20/install-netgen.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-nextpnr.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-openroad.sh +16 -3
- siliconcompiler/toolscripts/ubuntu20/install-opensta.sh +16 -5
- siliconcompiler/toolscripts/ubuntu20/install-slang.sh +11 -4
- siliconcompiler/toolscripts/ubuntu20/install-slurm.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-surelog.sh +10 -2
- siliconcompiler/toolscripts/ubuntu20/install-sv2v.sh +11 -4
- siliconcompiler/toolscripts/ubuntu20/install-verible.sh +11 -3
- siliconcompiler/toolscripts/ubuntu20/install-verilator.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-xdm.sh +10 -2
- siliconcompiler/toolscripts/ubuntu20/install-xyce.sh +13 -8
- siliconcompiler/toolscripts/ubuntu20/install-yosys-moosic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu20/install-yosys.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-bambu.sh +10 -2
- siliconcompiler/toolscripts/ubuntu22/install-bluespec.sh +10 -3
- siliconcompiler/toolscripts/ubuntu22/install-chisel.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-ghdl.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-gtkwave.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-icarus.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-icepack.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-klayout.sh +8 -1
- siliconcompiler/toolscripts/ubuntu22/install-magic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-montage.sh +1 -1
- siliconcompiler/toolscripts/ubuntu22/install-netgen.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-nextpnr.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-openroad.sh +16 -3
- siliconcompiler/toolscripts/ubuntu22/install-opensta.sh +17 -5
- siliconcompiler/toolscripts/ubuntu22/install-slang.sh +11 -4
- siliconcompiler/toolscripts/ubuntu22/install-slurm.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-surelog.sh +10 -2
- siliconcompiler/toolscripts/ubuntu22/install-sv2v.sh +11 -4
- siliconcompiler/toolscripts/ubuntu22/install-verible.sh +11 -3
- siliconcompiler/toolscripts/ubuntu22/install-verilator.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-vpr.sh +9 -4
- siliconcompiler/toolscripts/ubuntu22/install-xdm.sh +10 -2
- siliconcompiler/toolscripts/ubuntu22/install-xyce.sh +13 -8
- siliconcompiler/toolscripts/ubuntu22/install-yosys-moosic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu22/install-yosys-parmys.sh +10 -3
- siliconcompiler/toolscripts/ubuntu22/install-yosys-slang.sh +10 -2
- siliconcompiler/toolscripts/ubuntu22/install-yosys.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-bambu.sh +12 -4
- siliconcompiler/toolscripts/ubuntu24/install-bluespec.sh +10 -3
- siliconcompiler/toolscripts/ubuntu24/install-chisel.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-ghdl.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-gtkwave.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-icarus.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-icepack.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-klayout.sh +8 -1
- siliconcompiler/toolscripts/ubuntu24/install-magic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-montage.sh +1 -1
- siliconcompiler/toolscripts/ubuntu24/install-netgen.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-nextpnr.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-openroad.sh +16 -3
- siliconcompiler/toolscripts/ubuntu24/install-opensta.sh +17 -5
- siliconcompiler/toolscripts/ubuntu24/install-slang.sh +11 -4
- siliconcompiler/toolscripts/ubuntu24/install-slurm.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-surelog.sh +10 -2
- siliconcompiler/toolscripts/ubuntu24/install-sv2v.sh +11 -4
- siliconcompiler/toolscripts/ubuntu24/install-verible.sh +11 -3
- siliconcompiler/toolscripts/ubuntu24/install-verilator.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-vpr.sh +9 -4
- siliconcompiler/toolscripts/ubuntu24/install-xdm.sh +10 -2
- siliconcompiler/toolscripts/ubuntu24/install-xyce.sh +13 -8
- siliconcompiler/toolscripts/ubuntu24/install-yosys-moosic.sh +9 -2
- siliconcompiler/toolscripts/ubuntu24/install-yosys-parmys.sh +10 -3
- siliconcompiler/toolscripts/ubuntu24/install-yosys-slang.sh +10 -2
- siliconcompiler/toolscripts/ubuntu24/install-yosys.sh +9 -2
- siliconcompiler/utils/__init__.py +19 -112
- siliconcompiler/utils/flowgraph.py +244 -0
- siliconcompiler/{issue.py → utils/issue.py} +18 -25
- siliconcompiler/utils/logging.py +3 -4
- {siliconcompiler-0.32.3.dist-info → siliconcompiler-0.33.1.dist-info}/METADATA +9 -8
- siliconcompiler-0.33.1.dist-info/RECORD +488 -0
- {siliconcompiler-0.32.3.dist-info → siliconcompiler-0.33.1.dist-info}/WHEEL +1 -1
- {siliconcompiler-0.32.3.dist-info → siliconcompiler-0.33.1.dist-info}/entry_points.txt +8 -8
- siliconcompiler/schema/schema_obj.py +0 -1936
- siliconcompiler/toolscripts/ubuntu20/install-vpr.sh +0 -29
- siliconcompiler/toolscripts/ubuntu20/install-yosys-parmys.sh +0 -61
- siliconcompiler-0.32.3.dist-info/RECORD +0 -470
- /siliconcompiler/{templates → data/templates}/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/email/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/email/general.j2 +0 -0
- /siliconcompiler/{templates → data/templates}/email/summary.j2 +0 -0
- /siliconcompiler/{templates → data/templates}/issue/README.txt +0 -0
- /siliconcompiler/{templates → data/templates}/issue/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/issue/run.sh +0 -0
- /siliconcompiler/{templates → data/templates}/replay/replay.py.j2 +0 -0
- /siliconcompiler/{templates → data/templates}/replay/replay.sh.j2 +0 -0
- /siliconcompiler/{templates → data/templates}/replay/requirements.txt +0 -0
- /siliconcompiler/{templates → data/templates}/replay/setup.sh +0 -0
- /siliconcompiler/{templates → data/templates}/report/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/report/bootstrap.min.css +0 -0
- /siliconcompiler/{templates → data/templates}/report/bootstrap.min.js +0 -0
- /siliconcompiler/{templates → data/templates}/report/bootstrap_LICENSE.md +0 -0
- /siliconcompiler/{templates → data/templates}/report/sc_report.j2 +0 -0
- /siliconcompiler/{templates → data/templates}/slurm/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/slurm/run.sh +0 -0
- /siliconcompiler/{templates → data/templates}/tcl/__init__.py +0 -0
- /siliconcompiler/{templates → data/templates}/tcl/manifest.tcl.j2 +0 -0
- /siliconcompiler/{units.py → utils/units.py} +0 -0
- {siliconcompiler-0.32.3.dist-info → siliconcompiler-0.33.1.dist-info}/licenses/LICENSE +0 -0
- {siliconcompiler-0.32.3.dist-info → siliconcompiler-0.33.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
# Copyright 2025 Silicon Compiler Authors. All Rights Reserved.
|
|
2
|
+
|
|
3
|
+
import distro
|
|
4
|
+
import getpass
|
|
5
|
+
import platform
|
|
6
|
+
import psutil
|
|
7
|
+
import shlex
|
|
8
|
+
import socket
|
|
9
|
+
|
|
10
|
+
from datetime import datetime, timezone
|
|
11
|
+
from enum import Enum
|
|
12
|
+
|
|
13
|
+
from siliconcompiler.schema import BaseSchema
|
|
14
|
+
from siliconcompiler.schema import EditableSchema, Parameter, PerNode, Scope
|
|
15
|
+
from siliconcompiler.schema.utils import trim
|
|
16
|
+
|
|
17
|
+
from siliconcompiler import _metadata
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class RecordTime(Enum):
|
|
21
|
+
START = "starttime"
|
|
22
|
+
END = "endtime"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RecordTool(Enum):
|
|
26
|
+
EXITCODE = "toolexitcode"
|
|
27
|
+
VERSION = "toolversion"
|
|
28
|
+
PATH = "toolpath"
|
|
29
|
+
ARGS = "toolargs"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class RecordSchema(BaseSchema):
|
|
33
|
+
__TIMEFORMAT = "%Y-%m-%d %H:%M:%S"
|
|
34
|
+
|
|
35
|
+
def __init__(self):
|
|
36
|
+
super().__init__()
|
|
37
|
+
|
|
38
|
+
schema_record(self)
|
|
39
|
+
|
|
40
|
+
def clear(self, step, index, keep=None):
|
|
41
|
+
'''
|
|
42
|
+
Clear all saved metrics for a given step and index
|
|
43
|
+
|
|
44
|
+
Args:
|
|
45
|
+
step (str): Step name to clear.
|
|
46
|
+
index (str): Index name to clear.
|
|
47
|
+
keep (list of str): list of records to keep.
|
|
48
|
+
'''
|
|
49
|
+
|
|
50
|
+
if not keep:
|
|
51
|
+
keep = []
|
|
52
|
+
|
|
53
|
+
for record in self.getkeys():
|
|
54
|
+
if record in keep:
|
|
55
|
+
continue
|
|
56
|
+
param = self.get(record, field=None)
|
|
57
|
+
|
|
58
|
+
if param.get(field='pernode').is_never():
|
|
59
|
+
param.unset()
|
|
60
|
+
else:
|
|
61
|
+
param.unset(step=step, index=index)
|
|
62
|
+
|
|
63
|
+
def record_python_packages(self):
|
|
64
|
+
'''
|
|
65
|
+
Record the python packages currently available in the environment.
|
|
66
|
+
'''
|
|
67
|
+
try:
|
|
68
|
+
from pip._internal.operations.freeze import freeze
|
|
69
|
+
except: # noqa E722
|
|
70
|
+
freeze = None
|
|
71
|
+
|
|
72
|
+
if freeze:
|
|
73
|
+
# clear record
|
|
74
|
+
self.set('pythonpackage', [])
|
|
75
|
+
|
|
76
|
+
for pkg in freeze():
|
|
77
|
+
self.add('pythonpackage', pkg)
|
|
78
|
+
|
|
79
|
+
def record_version(self, step, index):
|
|
80
|
+
'''
|
|
81
|
+
Records the versions for SiliconCompiler and python.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
step (str): Step name to associate.
|
|
85
|
+
index (str): Index name to associate.
|
|
86
|
+
'''
|
|
87
|
+
self.set('scversion', _metadata.version, step=step, index=index)
|
|
88
|
+
self.set('pythonversion', platform.python_version(), step=step, index=index)
|
|
89
|
+
|
|
90
|
+
@staticmethod
|
|
91
|
+
def get_cloud_information():
|
|
92
|
+
'''
|
|
93
|
+
Return information about the cloud environment.
|
|
94
|
+
|
|
95
|
+
Return format: {
|
|
96
|
+
"region": str
|
|
97
|
+
}
|
|
98
|
+
'''
|
|
99
|
+
# TODO: add logic to figure out if we're running on a remote cluster and
|
|
100
|
+
# extract the region in a provider-specific way.
|
|
101
|
+
return {"region": "local"}
|
|
102
|
+
|
|
103
|
+
@staticmethod
|
|
104
|
+
def get_ip_information():
|
|
105
|
+
'''
|
|
106
|
+
Return information about the ip and mac address of this machine.
|
|
107
|
+
|
|
108
|
+
Return format: {
|
|
109
|
+
"ip": str,
|
|
110
|
+
"mac": str
|
|
111
|
+
}
|
|
112
|
+
'''
|
|
113
|
+
try:
|
|
114
|
+
for interface, addrs in psutil.net_if_addrs().items():
|
|
115
|
+
if interface == 'lo':
|
|
116
|
+
# don't consider loopback device
|
|
117
|
+
continue
|
|
118
|
+
|
|
119
|
+
if not addrs:
|
|
120
|
+
# skip missing addrs
|
|
121
|
+
continue
|
|
122
|
+
|
|
123
|
+
use_addr = False
|
|
124
|
+
for addr in addrs:
|
|
125
|
+
if addr.family == socket.AF_INET:
|
|
126
|
+
if not addr.address.startswith('127.'):
|
|
127
|
+
use_addr = True
|
|
128
|
+
break
|
|
129
|
+
if addr.family == socket.AF_INET6:
|
|
130
|
+
if addr.address != "::1":
|
|
131
|
+
use_addr = True
|
|
132
|
+
break
|
|
133
|
+
|
|
134
|
+
if use_addr:
|
|
135
|
+
ipaddr = None
|
|
136
|
+
macaddr = None
|
|
137
|
+
for addr in addrs:
|
|
138
|
+
if not ipaddr and addr.family == socket.AF_INET:
|
|
139
|
+
ipaddr = addr.address
|
|
140
|
+
if not ipaddr and addr.family == socket.AF_INET6:
|
|
141
|
+
ipaddr = addr.address
|
|
142
|
+
if not macaddr and addr.family == psutil.AF_LINK:
|
|
143
|
+
macaddr = addr.address
|
|
144
|
+
|
|
145
|
+
return {"ip": ipaddr, "mac": macaddr}
|
|
146
|
+
except: # noqa E722
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
return {"ip": None, "mac": None}
|
|
150
|
+
|
|
151
|
+
@staticmethod
|
|
152
|
+
def get_machine_information():
|
|
153
|
+
'''
|
|
154
|
+
Return information about the machine.
|
|
155
|
+
|
|
156
|
+
Return format: {
|
|
157
|
+
"machine": str,
|
|
158
|
+
"system": str,
|
|
159
|
+
"distro": str,
|
|
160
|
+
"osversion": str,
|
|
161
|
+
"kernelversion": str,
|
|
162
|
+
"arch": str
|
|
163
|
+
}
|
|
164
|
+
'''
|
|
165
|
+
system = platform.system()
|
|
166
|
+
if system == 'Darwin':
|
|
167
|
+
lower_sys_name = 'macos'
|
|
168
|
+
else:
|
|
169
|
+
lower_sys_name = system.lower()
|
|
170
|
+
|
|
171
|
+
if system == 'Linux':
|
|
172
|
+
distro_name = distro.id()
|
|
173
|
+
else:
|
|
174
|
+
distro_name = None
|
|
175
|
+
|
|
176
|
+
if system == 'Darwin':
|
|
177
|
+
osversion, _, _ = platform.mac_ver()
|
|
178
|
+
elif system == 'Linux':
|
|
179
|
+
osversion = distro.version()
|
|
180
|
+
else:
|
|
181
|
+
osversion = platform.release()
|
|
182
|
+
|
|
183
|
+
kernelversion = None
|
|
184
|
+
if system == 'Linux':
|
|
185
|
+
kernelversion = platform.release()
|
|
186
|
+
elif system == 'Windows':
|
|
187
|
+
kernelversion = platform.version()
|
|
188
|
+
elif system == 'Darwin':
|
|
189
|
+
kernelversion = platform.release()
|
|
190
|
+
|
|
191
|
+
return {'name': platform.node(),
|
|
192
|
+
'system': lower_sys_name,
|
|
193
|
+
'distro': distro_name,
|
|
194
|
+
'osversion': osversion,
|
|
195
|
+
'kernelversion': kernelversion,
|
|
196
|
+
'arch': platform.machine()}
|
|
197
|
+
|
|
198
|
+
@staticmethod
|
|
199
|
+
def get_user_information():
|
|
200
|
+
'''
|
|
201
|
+
Return information about the user.
|
|
202
|
+
|
|
203
|
+
Return format: {"username": str}
|
|
204
|
+
'''
|
|
205
|
+
return {'username': getpass.getuser()}
|
|
206
|
+
|
|
207
|
+
def record_userinformation(self, step, index):
|
|
208
|
+
'''
|
|
209
|
+
Records information about the current machine and user.
|
|
210
|
+
Uses information from :meth:`get_machine_information`, :meth:`get_user_information`,
|
|
211
|
+
:meth:`get_cloud_information`, and :meth:`get_ip_information`.
|
|
212
|
+
|
|
213
|
+
Args:
|
|
214
|
+
step (str): Step name to associate.
|
|
215
|
+
index (str): Index name to associate.
|
|
216
|
+
'''
|
|
217
|
+
machine_info = RecordSchema.get_machine_information()
|
|
218
|
+
user_info = RecordSchema.get_user_information()
|
|
219
|
+
cloud_info = RecordSchema.get_cloud_information()
|
|
220
|
+
ip_information = RecordSchema.get_ip_information()
|
|
221
|
+
|
|
222
|
+
self.set('platform', machine_info['system'], step=step, index=index)
|
|
223
|
+
if machine_info['distro']:
|
|
224
|
+
self.set('distro', machine_info['distro'], step=step, index=index)
|
|
225
|
+
self.set('osversion', machine_info['osversion'], step=step, index=index)
|
|
226
|
+
if machine_info['kernelversion']:
|
|
227
|
+
self.set('kernelversion', machine_info['kernelversion'], step=step, index=index)
|
|
228
|
+
self.set('arch', machine_info['arch'], step=step, index=index)
|
|
229
|
+
self.set('machine', machine_info['name'], step=step, index=index)
|
|
230
|
+
self.set('userid', user_info['username'], step=step, index=index)
|
|
231
|
+
self.set('region', cloud_info['region'], step=step, index=index)
|
|
232
|
+
|
|
233
|
+
if ip_information['ip']:
|
|
234
|
+
self.set('ipaddr', ip_information['ip'], step=step, index=index)
|
|
235
|
+
if ip_information['mac']:
|
|
236
|
+
self.set('macaddr', ip_information['mac'], step=step, index=index)
|
|
237
|
+
|
|
238
|
+
def record_time(self, step, index, type):
|
|
239
|
+
'''
|
|
240
|
+
Record the time of the record.
|
|
241
|
+
|
|
242
|
+
Returns:
|
|
243
|
+
time recorded.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
step (str): Step name to associate.
|
|
247
|
+
index (str): Index name to associate.
|
|
248
|
+
type (:class:`RecordTime`): type of time to record
|
|
249
|
+
'''
|
|
250
|
+
type = RecordTime(type)
|
|
251
|
+
|
|
252
|
+
now = datetime.now(timezone.utc)
|
|
253
|
+
|
|
254
|
+
self.set(type.value,
|
|
255
|
+
now.strftime(RecordSchema.__TIMEFORMAT),
|
|
256
|
+
step=step, index=index)
|
|
257
|
+
|
|
258
|
+
return now.timestamp()
|
|
259
|
+
|
|
260
|
+
def get_recorded_time(self, step, index, type):
|
|
261
|
+
'''
|
|
262
|
+
Returns the time recorded for a given record, or None if nothing is recorded.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
step (str): Step name to associate.
|
|
266
|
+
index (str): Index name to associate.
|
|
267
|
+
type (:class:`RecordTime`): type of time to record
|
|
268
|
+
'''
|
|
269
|
+
type = RecordTime(type)
|
|
270
|
+
record_time = self.get(type.value, step=step, index=index)
|
|
271
|
+
if record_time is None:
|
|
272
|
+
return None
|
|
273
|
+
|
|
274
|
+
return datetime.strptime(
|
|
275
|
+
record_time+"+0000",
|
|
276
|
+
RecordSchema.__TIMEFORMAT+"%z").timestamp()
|
|
277
|
+
|
|
278
|
+
def record_tool(self, step, index, info, type):
|
|
279
|
+
'''
|
|
280
|
+
Record information about the tool used during this record.
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
step (str): Step name to associate.
|
|
284
|
+
index (str): Index name to associate.
|
|
285
|
+
info (any): Information to record.
|
|
286
|
+
type (:class:`RecordTool`): type of tool information being recorded
|
|
287
|
+
'''
|
|
288
|
+
if type == RecordTool.ARGS:
|
|
289
|
+
info = shlex.join(info)
|
|
290
|
+
self.set(type.value, info, step=step, index=index)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
###########################################################################
|
|
294
|
+
# Run Record
|
|
295
|
+
###########################################################################
|
|
296
|
+
def schema_record(schema):
|
|
297
|
+
schema = EditableSchema(schema)
|
|
298
|
+
records = {'userid': ['userid',
|
|
299
|
+
'wiley',
|
|
300
|
+
''],
|
|
301
|
+
'publickey': ['public key',
|
|
302
|
+
'<key>',
|
|
303
|
+
''],
|
|
304
|
+
'machine': ['machine name',
|
|
305
|
+
'carbon',
|
|
306
|
+
'(myhost, localhost, ...'],
|
|
307
|
+
'macaddr': ['MAC address',
|
|
308
|
+
'<addr>',
|
|
309
|
+
''],
|
|
310
|
+
'ipaddr': ['IP address',
|
|
311
|
+
'<addr>',
|
|
312
|
+
''],
|
|
313
|
+
'platform': ['platform name',
|
|
314
|
+
'linux',
|
|
315
|
+
'(linux, windows, freebsd)'],
|
|
316
|
+
'distro': ['distro name',
|
|
317
|
+
'ubuntu',
|
|
318
|
+
'(ubuntu, redhat, centos)'],
|
|
319
|
+
'arch': ['hardware architecture',
|
|
320
|
+
'x86_64',
|
|
321
|
+
'(x86_64, rv64imafdc)'],
|
|
322
|
+
'starttime': ['start time',
|
|
323
|
+
'\"2021-09-06 12:20:20\"',
|
|
324
|
+
'Time is reported in the ISO 8601 format YYYY-MM-DD HR:MIN:SEC'],
|
|
325
|
+
'endtime': ['end time',
|
|
326
|
+
'\"2021-09-06 12:20:20\"',
|
|
327
|
+
'Time is reported in the ISO 8601 format YYYY-MM-DD HR:MIN:SEC'],
|
|
328
|
+
'region': ['cloud region',
|
|
329
|
+
'\"US Gov Boston\"',
|
|
330
|
+
"""Recommended naming methodology:
|
|
331
|
+
|
|
332
|
+
* local: node is the local machine
|
|
333
|
+
* onprem: node in on-premises IT infrastructure
|
|
334
|
+
* public: generic public cloud
|
|
335
|
+
* govcloud: generic US government cloud
|
|
336
|
+
* <region>: cloud and entity specific region string name
|
|
337
|
+
"""],
|
|
338
|
+
'scversion': ['software version',
|
|
339
|
+
'1.0',
|
|
340
|
+
"""Version number for the SiliconCompiler software."""],
|
|
341
|
+
'toolversion': ['tool version',
|
|
342
|
+
'1.0',
|
|
343
|
+
"""The tool version captured corresponds to the 'tool'
|
|
344
|
+
parameter within the 'tool' dictionary."""],
|
|
345
|
+
'toolpath': ['tool path',
|
|
346
|
+
'/usr/bin/openroad',
|
|
347
|
+
"""Full path to tool executable used to run this
|
|
348
|
+
task."""],
|
|
349
|
+
'toolargs': ['tool CLI arguments',
|
|
350
|
+
'\"-I include/ foo.v\"',
|
|
351
|
+
'Arguments passed to tool via CLI.'],
|
|
352
|
+
'pythonversion': ['Python version',
|
|
353
|
+
'3.12.3',
|
|
354
|
+
"""Version of python used to run this task."""],
|
|
355
|
+
'osversion': ['O/S version',
|
|
356
|
+
'20.04.1-Ubuntu',
|
|
357
|
+
"""Since there is not standard version system for operating
|
|
358
|
+
systems, extracting information from is platform dependent.
|
|
359
|
+
For Linux based operating systems, the 'osversion' is the
|
|
360
|
+
version of the distro."""],
|
|
361
|
+
'kernelversion': ['O/S kernel version',
|
|
362
|
+
'5.11.0-34-generic',
|
|
363
|
+
"""Used for platforms that support a distinction
|
|
364
|
+
between os kernels and os distributions."""]}
|
|
365
|
+
|
|
366
|
+
for key, (shorthelp, example, longhelp) in records.items():
|
|
367
|
+
schema.insert(
|
|
368
|
+
key,
|
|
369
|
+
Parameter(
|
|
370
|
+
"str",
|
|
371
|
+
scope=Scope.JOB,
|
|
372
|
+
shorthelp=f"Record: {shorthelp}",
|
|
373
|
+
switch=f"-record_{key} 'step index <str>'",
|
|
374
|
+
example=[
|
|
375
|
+
f"cli: -record_{key} 'dfm 0 {example}'",
|
|
376
|
+
f"api: chip.set('record', '{key}', '{example}', step='dfm', index=0)"],
|
|
377
|
+
pernode=PerNode.REQUIRED,
|
|
378
|
+
help=f'Record tracking the {shorthelp} per step and index basis.'
|
|
379
|
+
f'{" " + trim(longhelp) if longhelp else ""}'
|
|
380
|
+
))
|
|
381
|
+
|
|
382
|
+
schema.insert(
|
|
383
|
+
"toolexitcode",
|
|
384
|
+
Parameter(
|
|
385
|
+
"int",
|
|
386
|
+
scope=Scope.JOB,
|
|
387
|
+
shorthelp="Record: tool exit code",
|
|
388
|
+
switch="-record_toolexitcode 'step index <int>'",
|
|
389
|
+
example=[
|
|
390
|
+
"cli: -record_toolexitcode 'dfm 0 0'",
|
|
391
|
+
"api: chip.set('record', 'toolexitcode', 0, step='dfm', index=0)"],
|
|
392
|
+
pernode=PerNode.REQUIRED,
|
|
393
|
+
help='Record tracking the tool exit code per step and index basis.'
|
|
394
|
+
))
|
|
395
|
+
|
|
396
|
+
# Non-per-node records.
|
|
397
|
+
schema.insert(
|
|
398
|
+
"remoteid",
|
|
399
|
+
Parameter(
|
|
400
|
+
"str",
|
|
401
|
+
scope=Scope.JOB,
|
|
402
|
+
shorthelp="Record: remote job ID",
|
|
403
|
+
switch="-record_remoteid '<str>'",
|
|
404
|
+
example=[
|
|
405
|
+
"cli: -record_remoteid '0123456789abcdeffedcba9876543210'",
|
|
406
|
+
"api: chip.set('record', 'remoteid', '0123456789abcdeffedcba9876543210')"],
|
|
407
|
+
help='Record tracking the job ID for a remote run.'
|
|
408
|
+
))
|
|
409
|
+
|
|
410
|
+
schema.insert(
|
|
411
|
+
"pythonpackage",
|
|
412
|
+
Parameter(
|
|
413
|
+
"[str]",
|
|
414
|
+
scope=Scope.JOB,
|
|
415
|
+
shorthelp="Record: python packages",
|
|
416
|
+
switch="-record_pythonpackage '<str>'",
|
|
417
|
+
example=[
|
|
418
|
+
"cli: -record_pythonpackage 'siliconcompiler==0.28.0'",
|
|
419
|
+
"api: chip.set('record', 'pythonpackage', 'siliconcompiler==0.28.0')"],
|
|
420
|
+
help='Record tracking for the python packages installed.'
|
|
421
|
+
))
|
|
422
|
+
|
|
423
|
+
# flowgraph status
|
|
424
|
+
schema.insert(
|
|
425
|
+
"status",
|
|
426
|
+
Parameter(
|
|
427
|
+
"<pending,queued,running,success,error,skipped,timeout>", # sync with NodeStatus
|
|
428
|
+
pernode=PerNode.REQUIRED,
|
|
429
|
+
scope=Scope.JOB,
|
|
430
|
+
shorthelp="Record: node execution status",
|
|
431
|
+
switch="-record_status 'step index <str>'",
|
|
432
|
+
example=[
|
|
433
|
+
"cli: -record_status 'syn 0 success'",
|
|
434
|
+
"api: chip.set('record', 'status', 'success', step='syn', index='0')"],
|
|
435
|
+
help="""Record tracking for the status of a node."""
|
|
436
|
+
))
|
|
437
|
+
|
|
438
|
+
# flowgraph select
|
|
439
|
+
schema.insert(
|
|
440
|
+
"inputnode",
|
|
441
|
+
Parameter(
|
|
442
|
+
"[(str,str)]",
|
|
443
|
+
pernode=PerNode.REQUIRED,
|
|
444
|
+
scope=Scope.JOB,
|
|
445
|
+
shorthelp="Record: node inputs",
|
|
446
|
+
switch="-record_inputnode 'step index <(str,str)>'",
|
|
447
|
+
example=[
|
|
448
|
+
"cli: -record_inputnode 'cts 0 (place,42)'",
|
|
449
|
+
"api: chip.set('record', 'inputnode', ('place', '42'), step='syn', index='0')"],
|
|
450
|
+
help=trim("""
|
|
451
|
+
List of selected inputs for the current step/index specified as
|
|
452
|
+
(in_step, in_index) tuple.""")
|
|
453
|
+
))
|
siliconcompiler/remote/client.py
CHANGED
|
@@ -13,9 +13,10 @@ import multiprocessing
|
|
|
13
13
|
from siliconcompiler import utils, SiliconCompilerError, NodeStatus
|
|
14
14
|
from siliconcompiler import NodeStatus as SCNodeStatus
|
|
15
15
|
from siliconcompiler._metadata import default_server
|
|
16
|
-
from siliconcompiler.flowgraph import nodes_to_execute
|
|
17
16
|
from siliconcompiler.remote import JobStatus
|
|
18
17
|
from siliconcompiler.report.dashboard import DashboardType
|
|
18
|
+
from siliconcompiler.flowgraph import RuntimeFlowgraph
|
|
19
|
+
from siliconcompiler.schema import JournalingSchema
|
|
19
20
|
|
|
20
21
|
# Step name to use while logging
|
|
21
22
|
remote_step_name = 'remote'
|
|
@@ -504,7 +505,7 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
|
|
|
504
505
|
# Redirected POST requests are translated to GETs. This is actually
|
|
505
506
|
# part of the HTTP spec, so we need to manually follow the trail.
|
|
506
507
|
post_params = {
|
|
507
|
-
'chip_cfg': self.__chip.schema.
|
|
508
|
+
'chip_cfg': self.__chip.schema.getdict(),
|
|
508
509
|
'params': self.__get_post_params(include_job_id=True)
|
|
509
510
|
}
|
|
510
511
|
|
|
@@ -546,8 +547,11 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
|
|
|
546
547
|
key_type = self.__chip.get(*key, field='type')
|
|
547
548
|
|
|
548
549
|
if 'dir' in key_type or 'file' in key_type:
|
|
549
|
-
for _, step, index in self.__chip.schema.
|
|
550
|
+
for _, step, index in self.__chip.schema.get(*key, field=None).getvalues(
|
|
551
|
+
return_defvalue=False):
|
|
550
552
|
packages = self.__chip.get(*key, field='package', step=step, index=index)
|
|
553
|
+
if not isinstance(packages, list):
|
|
554
|
+
packages = [packages]
|
|
551
555
|
force_copy = False
|
|
552
556
|
for package in packages:
|
|
553
557
|
if not package:
|
|
@@ -587,7 +591,7 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
|
|
|
587
591
|
f'{self.__chip.design}.pkg.json')
|
|
588
592
|
if os.path.exists(manifest):
|
|
589
593
|
try:
|
|
590
|
-
self.__chip.schema.read_journal(manifest)
|
|
594
|
+
JournalingSchema(self.__chip.schema).read_journal(manifest)
|
|
591
595
|
node_info["imported"] = True
|
|
592
596
|
changed = True
|
|
593
597
|
except: # noqa E722
|
|
@@ -615,7 +619,13 @@ service, provided by SiliconCompiler, is not intended to process proprietary IP.
|
|
|
615
619
|
self.__check_interval = check_info['progress_interval']
|
|
616
620
|
|
|
617
621
|
self.__node_information = {}
|
|
618
|
-
|
|
622
|
+
runtime = RuntimeFlowgraph(
|
|
623
|
+
self.__chip.schema.get("flowgraph", self.__chip.get('option', 'flow'), field='schema'),
|
|
624
|
+
from_steps=self.__chip.get('option', 'from'),
|
|
625
|
+
to_steps=self.__chip.get('option', 'to'),
|
|
626
|
+
prune_nodes=self.__chip.get('option', 'prune'))
|
|
627
|
+
|
|
628
|
+
for step, index in runtime.get_nodes():
|
|
619
629
|
done = SCNodeStatus.is_done(self.__chip.get('record', 'status', step=step, index=index))
|
|
620
630
|
node_info = {
|
|
621
631
|
"step": step,
|