本文整理汇总了Python中chiptools.core.project.Project.get_simulation_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_simulation_directory方法的具体用法?Python Project.get_simulation_directory怎么用?Python Project.get_simulation_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chiptools.core.project.Project
的用法示例。
在下文中一共展示了Project.get_simulation_directory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSimulationDirectory
# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import get_simulation_directory [as 别名]
def testSimulationDirectory(self):
project = Project()
XmlProjectParser.load_project(self.project_path, project)
abs_path = os.path.join(
os.path.abspath(self.root),
self.simulation_directory
)
self.assertEqual(project.get_simulation_directory(), abs_path)
示例2: CommandLine
# 需要导入模块: from chiptools.core.project import Project [as 别名]
# 或者: from chiptools.core.project.Project import get_simulation_directory [as 别名]
#.........这里部分代码省略.........
running on your file correctly. Preprocessors are called automatically
when you run synthesis"""
log.info('Running preprocessors...')
self.project.run_preprocessors()
log.info('...done')
@wraps_do_commands
def do_simulate(self, command):
"""Compile the given entity in the given library using the chosen
simulator and invoke the simulator GUI.
Example: (Cmd) simulate my_library.my_entity"""
command_elems = command.split(' ')
if len(command_elems) == 2:
target, tool_name = command_elems
else:
target = command_elems[0]
tool_name = None
try:
library, entity = target.split('.')
except ValueError:
log.error('Command \"' + command + '\" not understood.')
log.error(
"Please specify a library and entity.\n" +
"Example: (Cmd) simulate my_library.my_entity [tool_name]"
)
return
self.project.simulate(library, entity, gui=True, tool_name=tool_name)
@wraps_do_commands
def do_clean(self, command):
"""Clear the file cache"""
# Delete libraries from the simulation area
simpath = self.project.get_simulation_directory()
if simpath is None:
log.error('No simulation path is set, aborting operation.')
return
log.info('Cleaning simulation folder: ' + simpath)
for tool_name in self.project.cache.get_tool_names():
for libname in self.project.cache.get_libraries(tool_name):
path = os.path.join(simpath, libname)
if os.path.exists(path):
log.info('Removing ' + path)
shutil.rmtree(path)
log.info('...done')
self.project.cache.initialise_cache()
@wraps_do_commands
def do_pwd(self, command):
print(
term.colourise('Working directory: ', fg='yellow') +
term.colourise('{0}', fg='green').format(os.getcwd())
)
@wraps_do_commands
def do_plugins(self, command):
simulators = self.project.get_available_simulators()
synthesisers = self.project.get_available_synthesisers()
for i, plugin_registry in enumerate([simulators, synthesisers]):
print(term.yellow(['Simulator Plugins:', 'Synthesis Plugins:'][i]))
for name, inst in plugin_registry.items():
plugin_path = sys.modules[inst.__module__].__file__
plugin_file = os.path.basename(plugin_path)
print(
SEP * 1 + term.darkgray(plugin_file) + '\n' +
SEP * 2 + '{:<15}: {:<35}'.format(