__init__.py 541 Bytes
Newer Older
1 2 3 4 5 6
import os.path
__dir__ = os.path.split(os.path.abspath(os.path.realpath(__file__)))[0]
data_location = os.path.join(__dir__, "rtl")
src = "https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-simplertc"

def data_file(f):
7
    """Get absolute path for file inside pythondata_cpu_simplertc."""
8 9 10 11 12
    fn = os.path.join(data_location, f)
    fn = os.path.abspath(fn)
    if not os.path.exists(fn):
        raise IOError("File {f} doesn't exist in pythondata_peripheral_simplertc".format(f))
    return fn