1818from jinja2 import Environment , FileSystemLoader
1919
2020
21- STEPS = {
22- 'cfg' : 'Project Creation' ,
23- 'syn' : 'Synthesis' ,
24- 'par' : 'Place and Route' ,
25- 'bit' : 'Bitstream generation'
26- }
27-
28-
2921class Project :
3022 """Base class to manage an FPGA project.
3123
@@ -35,6 +27,13 @@ class Project:
3527 :type odir: str, optional
3628 """
3729
30+ STEPS = {
31+ 'cfg' : 'Project Creation' ,
32+ 'syn' : 'Synthesis' ,
33+ 'par' : 'Place and Route' ,
34+ 'bit' : 'Bitstream generation'
35+ }
36+
3837 def __init__ (self , project = None , odir = 'results' ):
3938 """Class constructor."""
4039 self .conf = {}
@@ -220,17 +219,17 @@ def make(self, first='cfg', last='bit'):
220219 .. note:: valid steps are ``cfg``, ``syn``, ``par`` and ``bit``.
221220 """
222221 self .logger .debug ('Executing make' )
223- if last not in STEPS :
222+ if last not in Project . STEPS :
224223 raise ValueError ('Invalid last step.' )
225- if first not in STEPS :
224+ if first not in Project . STEPS :
226225 raise ValueError ('Invalid first step.' )
227- keys = list (STEPS .keys ())
226+ keys = list (Project . STEPS .keys ())
228227 index = [keys .index (first ), keys .index (last )]
229228 if index [0 ] > index [1 ]:
230229 raise ValueError ('Invalid steps combination.' )
231- message = f'from { STEPS [first ]} to { STEPS [last ]} '
230+ message = f'from { Project . STEPS [first ]} to { Project . STEPS [last ]} '
232231 if first == last :
233- message = STEPS [first ]
232+ message = Project . STEPS [first ]
234233 self .logger .info ('Running %s' , message )
235234 self .data ['steps' ] = keys [index [0 ]:index [1 ]+ 1 ]
236235 self ._make_custom ()
0 commit comments