Beispiel #1
0
class System:
    def __init__(self, system_file):
        logger.debug('__init__() *Entered*' +
                     '\n    system_file=' + str(system_file)
                    )
        self.backend_name = None

        system_root = os.path.dirname(system_file)
        self.config = OrpsocConfigParser(system_file)

        self.name = os.path.basename(system_file).split('.')[0]

        if self.config.has_option('main', 'backend'):
            self.backend_name = self.config.get('main','backend')
            if self.backend_name and self.config.has_section(self.backend_name):
                self.backend = dict(self.config.items(self.backend_name))

        logger.debug('__init__() -Done-')

    def info(self):
        logger.debug('info() *Entered*')
        print("\nSYSTEM INFO")
        print("Name:                   " + self.name)

        show_list = lambda s: "\n                        ".join(s.split('\n'))

        if self.backend_name:
            print("Backend name:           " + self.backend_name)
            print("    family:             " + self.backend['family'])
            print("    device:             " + self.backend['device'])

            print("\n    tcl_files:          " + show_list(self.backend['tcl_files']))
            print("\n    sdc_files:          " + show_list(self.backend['sdc_files']))
            logger.debug('info() -Done-')
Beispiel #2
0
class System:
    def __init__(self, system_file):
        logger.debug('__init__() *Entered*' +
                     '\n    system_file=' + str(system_file)
                    )
        self.backend_name = None

        system_root = os.path.dirname(system_file)

        self.config = OrpsocConfigParser(system_file)

        self.name = os.path.basename(system_file).split('.')[0]

        if self.config.has_option('main', 'backend'):
            self.backend_name = self.config.get('main','backend')
            if self.backend_name and self.config.has_section(self.backend_name):
                self.backend = dict(self.config.items(self.backend_name))

        logger.debug('__init__() -Done-')

    def info(self):
        logger.debug('info() *Entered*')
        # TODO: finish and make look better
        print("SYSTEM INFO")
        print("Name                  :" + self.name)
        #print "Backend               :", self.backend
        #print "Backend name          :", self.backend['name']
        if self.backend_name:
            print("Backend name          :" + self.backend_name)
            print("        family        :"+ self.backend['family'])
            print("        tcl_files     :"+ self.backend['tcl_files'])
            print("        sdc_files     :"+ self.backend['sdc_files'])
            print("        cores         :"+ self.backend['cores'])
            print("        device        :"+ self.backend['device'])
            print("        include files :"+ self.backend['include_files'])
            print("        src files     :"+ self.backend['src_files'])
            print("        tb files      :"+ self.backend['tb_files'])
            print("        backend       :"+ self.backend['backend'])
Beispiel #3
0
    def __init__(self, core_file=None, name=None, core_root=None):
        logger.debug('__init__() *Entered*' +
                     '\n    core_file=' + str(core_file) +
                     '\n    name=' + str(name) + 
                     '\n    core_root=' + str(core_root)
                    )
        if core_file:
            basename = os.path.basename(core_file)
        self.depend = []
        self.simulators = []

        self.plusargs = None
        self.provider = None
        self.system   = None
        self.verilog  = None
        self.vpi = None
        if core_file:
            config = OrpsocConfigParser(core_file)

            if config.has_option('main', 'name'):
                self.name = config.get('main','name')
            else:
                self.name = basename.split('.core')[0]

            self.depend     = config.get_list('main', 'depend')
            self.simulators = config.get_list('main', 'simulators')

            #FIXME : Make simulators part of the core object
            self.simulator        = config.get_section('simulator')
            self.iverilog_options = config.get_list('icarus','iverilog_options')
            self.vlog_options     = config.get_list('modelsim','vlog_options')
            self.vsim_options     = config.get_list('modelsim','vsim_options')
            self.verilator = config.get_section('verilator')

            logger.debug('name=' + str(self.name))
            self.core_root = os.path.dirname(core_file)

            if config.has_section('plusargs'):
                self.plusargs = Plusargs(dict(config.items('plusargs')))
            if config.has_section('provider'):
                self.cache_dir = os.path.join(Config().cache_root, self.name)
                self.files_root = self.cache_dir
                items    = config.items('provider')
                self.provider = ProviderFactory(dict(items))
            else:
                self.files_root = self.core_root

            if config.has_section('verilog'):
                self.verilog = Verilog()
                items = config.items('verilog')
                self.verilog.load_items((dict(items)))
                logger.debug('verilog.src_files=' + str(self.verilog.src_files))
                logger.debug('verilog.include_files=' + str(self.verilog.include_files))
                logger.debug('verilog.include_dirs=' + str(self.verilog.include_dirs))
            if config.has_section('vpi'):
                items = config.items('vpi')
                self.vpi = VPI(dict(items))
            system_file = os.path.join(self.core_root, self.name+'.system')
            if os.path.exists(system_file):
                self.system = System(system_file)
        else:
            self.name = name

            self.core_root = core_root
            self.cache_root = core_root
            self.files_root = core_root

            self.provider = None
        logger.debug('__init__() -Done-')