Coverage for tsfpga/build_step_tcl_hook.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-29 20:01 +0000

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the tsfpga project, a project platform for modern FPGA development. 

5# https://tsfpga.com 

6# https://gitlab.com/tsfpga/tsfpga 

7# -------------------------------------------------------------------------------------------------- 

8 

9 

10class BuildStepTclHook: 

11 

12 """ 

13 Represent a TCL file that shall be used as hook in one of the build steps. 

14 """ 

15 

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 

24 

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() 

31 

32 def __str__(self): 

33 result = str(self.__class__.__name__) + ":" 

34 return result + f"{self.hook_step}:{self.tcl_file}"