Coverage for tsfpga/build_step_tcl_hook.py: 100%
10 statements
« prev ^ index » next coverage.py v6.4, created at 2022-05-28 04:01 +0000
« prev ^ index » next coverage.py v6.4, created at 2022-05-28 04:01 +0000
1# --------------------------------------------------------------------------------------------------
2# Copyright (c) Lukas Vik. All rights reserved.
3#
4# This file is part of the tsfpga project.
5# https://tsfpga.com
6# https://gitlab.com/tsfpga/tsfpga
7# --------------------------------------------------------------------------------------------------
10class BuildStepTclHook:
12 """
13 Represent a TCL file that shall be used as hook in one of the build steps.
14 """
16 def __init__(self, tcl_file, hook_step):
17 """
18 Arguments:
19 tcl_file (pathlib.Path): Path to a TCL file.
20 hook_step (str): Name of a build step, e.g. "STEPS.ROUTE_DESIGN.TCL.PRE".
21 """
22 self.tcl_file = tcl_file
23 self.hook_step = hook_step
25 @property
26 def step_is_synth(self):
27 """
28 True if the build step is in synthesis. False otherwise.
29 """
30 return "synth" in self.hook_step.lower()
32 def __str__(self):
33 result = str(self.__class__.__name__) + ":"
34 return result + f"{self.hook_step}:{self.tcl_file}"