syspaths.py
来自「M5,一个功能强大的多处理器系统模拟器.很多针对处理器架构,性能的研究都使用它作」· Python 代码 · 共 44 行
PY
44 行
import os, sysfrom os.path import isdir, join as joinpathfrom os import environ as envconfig_path = os.path.dirname(os.path.abspath(__file__))config_root = os.path.dirname(config_path)def disk(file): system() return joinpath(disk.dir, file)def binary(file): system() return joinpath(binary.dir, file)def script(file): system() return joinpath(script.dir, file)def system(): if not system.dir: try: path = env['M5_PATH'].split(':') except KeyError: path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system' ] for system.dir in path: if os.path.isdir(system.dir): break else: raise ImportError, "Can't find a path to system files." if not binary.dir: binary.dir = joinpath(system.dir, 'binaries') if not disk.dir: disk.dir = joinpath(system.dir, 'disks') if not script.dir: script.dir = joinpath(config_root, 'boot')system.dir = Nonebinary.dir = Nonedisk.dir = Nonescript.dir = None
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?