def test_caravel(self, gl=False):
    conf = self.config['caravel_test']
    self.copy_project_to_caravel_rtl()
    user_project_wrapper_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'user_project_wrapper.v')
    caravel_includes_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'uprj_netlists.v')
    user_project_includes_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'user_project_includes.v')
    interface_definitions = {**self.system_config['interfaces']['required'], **self.system_config['interfaces']['optional']}
    generate_openlane_files([self], interface_definitions, user_project_wrapper_path, user_project_includes_path, caravel_includes_path, self.args.openram)
    src = os.path.join(self.directory, conf['directory'])
    dst = os.path.join(self.system_config['caravel']['test_dir'], conf['directory'])
    try_copy_tree(src, dst, self.args.force_delete)
    test_env = os.environ.copy()
    test_env['GCC_PATH'] = self.system_config['env']['GCC_PATH']
    test_env['GCC_PREFIX'] = self.system_config['env']['GCC_PREFIX']
    test_env['PDK_PATH'] = self.system_config['env']['PDK_PATH']
    test_env['CARAVEL_ROOT'] = os.path.join(self.system_config['caravel']['root'], 'caravel')
    cwd = os.path.join(self.system_config['caravel']['test_dir'], conf['directory'])
    cmd = ['make', conf['recipe']]
    if gl:
        cmd = ['make', conf['gl_recipe']]
    logging.info(('attempting to run %s in %s' % (cmd, cwd)))
    try:
        subprocess.run(cmd, cwd=cwd, env=test_env, check=True)
    except subprocess.CalledProcessError as e:
        logging.error(e)
        exit(1)
    logging.info('caravel test pass')
def test_caravel(self, gl=False):
    conf = self.config['caravel_test']
    self.copy_project_to_caravel_rtl()
    user_project_wrapper_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'user_project_wrapper.v')
    caravel_includes_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'uprj_netlists.v')
    user_project_includes_path = os.path.join(self.system_config['caravel']['rtl_dir'], 'user_project_includes.v')
    interface_definitions = {**self.system_config['interfaces']['required'], **self.system_config['interfaces']['optional']}
    generate_openlane_files([self], interface_definitions, user_project_wrapper_path, user_project_includes_path, caravel_includes_path, self.args.openram)
    src = os.path.join(self.directory, conf['directory'])
    dst = os.path.join(self.system_config['caravel']['test_dir'], conf['directory'])
    try_copy_tree(src, dst, self.args.force_delete)
    test_env = os.environ.copy()
    test_env['GCC_PATH'] = self.system_config['env']['GCC_PATH']
    test_env['GCC_PREFIX'] = self.system_config['env']['GCC_PREFIX']
    test_env['PDK_PATH'] = self.system_config['env']['PDK_PATH']
    test_env['CARAVEL_ROOT'] = os.path.join(self.system_config['caravel']['root'], 'caravel')
    cwd = os.path.join(self.system_config['caravel']['test_dir'], conf['directory'])
    cmd = ['make', conf['recipe']]
    if gl:
        cmd = ['make', conf['gl_recipe']]
    logging.info(('attempting to run %s in %s' % (cmd, cwd)))
    try:
        subprocess.run(cmd, cwd=cwd, env=test_env, check=True)
    except subprocess.CalledProcessError as e:
        logging.error(e)
        exit(1)
    logging.info('caravel test pass')