Skip to content

Commit

Permalink
Merge pull request #48 from gts-bzi/feature/enhanced_debug
Browse files Browse the repository at this point in the history
Print actual data when adding configurations to a project
  • Loading branch information
rodrigomelo9 committed Aug 29, 2024
2 parents e87cde8 + 93d1bb0 commit 0139c4b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pyfpga/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def set_part(self, name):
:param name: FPGA part name
:type name: str
"""
self.logger.debug('Executing set_part')
self.logger.debug(f'Executing set_part: {name}')
self.data['part'] = name

def add_include(self, path):
Expand All @@ -72,7 +72,7 @@ def add_include(self, path):
:type name: str
:raises NotADirectoryError: if path is not a directory
"""
self.logger.debug('Executing add_include')
self.logger.debug(f'Executing add_include: {path}')
path = Path(path).resolve()
if not path.is_dir():
raise NotADirectoryError(path)
Expand All @@ -98,7 +98,7 @@ def add_slog(self, pathname):
:type pathname: str
:raises FileNotFoundError: when pathname is not found
"""
self.logger.debug('Executing add_slog')
self.logger.debug(f'Executing add_slog: {pathname}')
self._add_file(pathname, 'slog')

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

def add_vlog(self, pathname):
Expand All @@ -120,7 +121,7 @@ def add_vlog(self, pathname):
:type pathname: str
:raises FileNotFoundError: when pathname is not found
"""
self.logger.debug('Executing add_vlog')
self.logger.debug(f'Executing add_vlog: {pathname}')
self._add_file(pathname, 'vlog')

def add_cons(self, path):
Expand All @@ -130,7 +131,7 @@ def add_cons(self, path):
:type pathname: str
:raises FileNotFoundError: if path is not found
"""
self.logger.debug('Executing add_cons')
self.logger.debug(f'Executing add_cons: {path}')
path = Path(path).resolve()
if not path.is_file():
raise FileNotFoundError(path)
Expand All @@ -145,7 +146,7 @@ def add_param(self, name, value):
:param value: parameter/generic value
:type name: str
"""
self.logger.debug('Executing add_param')
self.logger.debug(f'Executing add_param: {name} : {value}')
self.data.setdefault('params', {})[name] = value

def add_define(self, name, value):
Expand All @@ -156,7 +157,7 @@ def add_define(self, name, value):
:param value: define value
:type name: str
"""
self.logger.debug('Executing add_define')
self.logger.debug(f'Executing add_define: {name} : {value}')
self.data.setdefault('defines', {})[name] = value

def add_fileset(self, pathname):
Expand All @@ -166,7 +167,7 @@ def add_fileset(self, pathname):
:type pathname: str
:raises FileNotFoundError: when pathname is not found
"""
self.logger.debug('Executing add_fileset')
self.logger.debug(f'Executing add_fileset: {pathname}')
if not os.path.exists(pathname):
raise FileNotFoundError(pathname)
raise NotImplementedError()
Expand All @@ -177,7 +178,7 @@ def set_top(self, name):
:param name: top-level name
:type name: str
"""
self.logger.debug('Executing set_top')
self.logger.debug(f'Executing set_top: {name}')
self.data['top'] = name

def add_hook(self, stage, hook):
Expand All @@ -191,7 +192,7 @@ def add_hook(self, stage, hook):
:type hook: str
:raises ValueError: when stage is invalid
"""
self.logger.debug('Executing add_hook')
self.logger.debug(f'Executing add_hook: {stage} : {hook}')
stages = [
'precfg', 'postcfg', 'presyn', 'postsyn',
'prepar', 'postpar', 'prebit', 'postbit'
Expand Down

0 comments on commit 0139c4b

Please sign in to comment.