Skip to content

Commit 0139c4b

Browse files
authored
Merge pull request #48 from gts-bzi/feature/enhanced_debug
Print actual data when adding configurations to a project
2 parents e87cde8 + 93d1bb0 commit 0139c4b

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

pyfpga/project.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_part(self, name):
6060
:param name: FPGA part name
6161
:type name: str
6262
"""
63-
self.logger.debug('Executing set_part')
63+
self.logger.debug(f'Executing set_part: {name}')
6464
self.data['part'] = name
6565

6666
def add_include(self, path):
@@ -72,7 +72,7 @@ def add_include(self, path):
7272
:type name: str
7373
:raises NotADirectoryError: if path is not a directory
7474
"""
75-
self.logger.debug('Executing add_include')
75+
self.logger.debug(f'Executing add_include: {path}')
7676
path = Path(path).resolve()
7777
if not path.is_dir():
7878
raise NotADirectoryError(path)
@@ -98,7 +98,7 @@ def add_slog(self, pathname):
9898
:type pathname: str
9999
:raises FileNotFoundError: when pathname is not found
100100
"""
101-
self.logger.debug('Executing add_slog')
101+
self.logger.debug(f'Executing add_slog: {pathname}')
102102
self._add_file(pathname, 'slog')
103103

104104
def add_vhdl(self, pathname, lib=None):
@@ -110,7 +110,8 @@ def add_vhdl(self, pathname, lib=None):
110110
:type lib: str, optional
111111
:raises FileNotFoundError: when pathname is not found
112112
"""
113-
self.logger.debug('Executing add_vhdl')
113+
lib_str = 'default library' if lib is None else lib
114+
self.logger.debug(f'Executing add_vhdl: {lib_str} : {pathname}')
114115
self._add_file(pathname, 'vhdl', lib)
115116

116117
def add_vlog(self, pathname):
@@ -120,7 +121,7 @@ def add_vlog(self, pathname):
120121
:type pathname: str
121122
:raises FileNotFoundError: when pathname is not found
122123
"""
123-
self.logger.debug('Executing add_vlog')
124+
self.logger.debug(f'Executing add_vlog: {pathname}')
124125
self._add_file(pathname, 'vlog')
125126

126127
def add_cons(self, path):
@@ -130,7 +131,7 @@ def add_cons(self, path):
130131
:type pathname: str
131132
:raises FileNotFoundError: if path is not found
132133
"""
133-
self.logger.debug('Executing add_cons')
134+
self.logger.debug(f'Executing add_cons: {path}')
134135
path = Path(path).resolve()
135136
if not path.is_file():
136137
raise FileNotFoundError(path)
@@ -145,7 +146,7 @@ def add_param(self, name, value):
145146
:param value: parameter/generic value
146147
:type name: str
147148
"""
148-
self.logger.debug('Executing add_param')
149+
self.logger.debug(f'Executing add_param: {name} : {value}')
149150
self.data.setdefault('params', {})[name] = value
150151

151152
def add_define(self, name, value):
@@ -156,7 +157,7 @@ def add_define(self, name, value):
156157
:param value: define value
157158
:type name: str
158159
"""
159-
self.logger.debug('Executing add_define')
160+
self.logger.debug(f'Executing add_define: {name} : {value}')
160161
self.data.setdefault('defines', {})[name] = value
161162

162163
def add_fileset(self, pathname):
@@ -166,7 +167,7 @@ def add_fileset(self, pathname):
166167
:type pathname: str
167168
:raises FileNotFoundError: when pathname is not found
168169
"""
169-
self.logger.debug('Executing add_fileset')
170+
self.logger.debug(f'Executing add_fileset: {pathname}')
170171
if not os.path.exists(pathname):
171172
raise FileNotFoundError(pathname)
172173
raise NotImplementedError()
@@ -177,7 +178,7 @@ def set_top(self, name):
177178
:param name: top-level name
178179
:type name: str
179180
"""
180-
self.logger.debug('Executing set_top')
181+
self.logger.debug(f'Executing set_top: {name}')
181182
self.data['top'] = name
182183

183184
def add_hook(self, stage, hook):
@@ -191,7 +192,7 @@ def add_hook(self, stage, hook):
191192
:type hook: str
192193
:raises ValueError: when stage is invalid
193194
"""
194-
self.logger.debug('Executing add_hook')
195+
self.logger.debug(f'Executing add_hook: {stage} : {hook}')
195196
stages = [
196197
'precfg', 'postcfg', 'presyn', 'postsyn',
197198
'prepar', 'postpar', 'prebit', 'postbit'

0 commit comments

Comments
 (0)