hwtBuildsystem.fakeTool package¶
This module contains a wrapper for a tool controller which records the commands and outputs and records them. It could then replay these commands and effictively act like the original tool. It also handles the changes of the selected files.
Submodules¶
hwtBuildsystem.fakeTool.recordingExecutor module¶
- class hwtBuildsystem.fakeTool.recordingExecutor.RecordingExecutor(executor: ToolExecutor, filesToWatch: List[str], traceFile: str, pwd=None, removeAllTracedFilesFirst=True)[source]¶
Bases:
ToolExecutor
- QUARTUS_INFO_TIMES = [(re.compile('(?<=Info: Peak virtual memory: )\\d+(?= \\S+)'), '{% RecordingExecutor.QUARTUS_PEAK_VIRT_MEM %}'), (re.compile('(?<=Info: Elapsed time: )\\d{2}:\\d{2}:\\d{2}'), '{% RecordingExecutor.QUARTUS_ELAPSED_TIME %}'), (re.compile('(?<=Info: Total CPU time \\(on all processors\\): )\\d{2}:\\d{2}:\\d{2}'), '{% RecordingExecutor.QUARTUS_TOTAL_CPU_TIME %}')]¶
- RE_DATE = re.compile('[a-zA-Z]{3} [a-zA-Z]{3} \\d+ \\d+:\\d+:\\d+ \\d{4}')¶
- RE_VIVADO_HELPER_PROC_PID = re.compile('(?<=\\[Synth 8-7075\\] Helper process launched with PID )(\\d+)')¶
- RE_VIVADO_MACHINE_RESOURCES = re.compile('Time \\(s\\): cpu = \\d{2}:\\d{2}:\\d{2} ; elapsed = \\d{2}:\\d{2}:\\d{2} . Memory \\(MB\\): peak = \\d+.\\d+ ; gain = \\d+.\\d+ ; free physical = \\d+ ; free virtual = \\d+')¶
- RE_VIVADO_PROJECT_ID = re.compile('(?<=<Option Name=\\\\"Id\\\\" Val=\\\\")[a-f0-9]{32}(?=\\\\"/>)')¶
- VAR_NAME_DATE = '{% RecordingToolController.NAME_DATE %}'¶
- VAR_NAME_PWD = '{% RecordingToolController.PWD %}'¶
- VAR_NAME_VIVADO_HELPER_PROC_PID = '{% RecordingExecutor.VIVADO_HELPER_PROC_PID %}'¶
- VAR_NAME_VIVADO_MACHINE_RESOURCES = '{% RecordingToolController.VIVADO_MACHINE_RESOURCES %}'¶
- VAR_NAME_VIVADO_PROJECT_ID = '{% RecordingExecutor.VIVADO_PROJECT_ID %}'¶
- exeCmd(cmd) TclCmdResult [source]¶
- project(root, name: str) SynthesisToolProject [source]¶
hwtBuildsystem.fakeTool.replayingExecutor module¶
- class hwtBuildsystem.fakeTool.replayingExecutor.ReplayingExecutor(traceFile: str, pwd=None)[source]¶
Bases:
ToolExecutor
Replays the responses on commands as if it was a real tool. Also handles the update of previously traced files.
- exeCmd(cmd) TclCmdResult [source]¶
- project(root, name: str) SynthesisToolProject [source]¶
hwtBuildsystem.fakeTool.utils module¶
- class hwtBuildsystem.fakeTool.utils.FileOp(mode, text)[source]¶
Bases:
object
An container of file operation for command history.
- class hwtBuildsystem.fakeTool.utils.RecordingExecutorEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
- default(o)[source]¶
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)