def get_top_module(self):
    paths = self.get_module_source_paths(absolute=False)
    top_instance = ('module %s' % self.config['caravel_test']['module_name'])
    for path in paths:
        abs_path = os.path.abspath(os.path.join(self.directory, path))
        with open(abs_path) as fh:
            if (top_instance in fh.read()):
                return path
    else:
        logging.error(("couldn't find top module for %s" % self))
        exit(1)
def get_top_module(self):
    paths = self.get_module_source_paths(absolute=False)
    top_instance = ('module %s' % self.config['caravel_test']['module_name'])
    for path in paths:
        abs_path = os.path.abspath(os.path.join(self.directory, path))
        with open(abs_path) as fh:
            if (top_instance in fh.read()):
                return path
    else:
        logging.error(("couldn't find top module for %s" % self))
        exit(1)