Ejemplo n.º 1
0
 def end_of_simulation(self, run_epilogue=True) :
   'Wrapper for epilogue'
   message.debug('End of Simulation')
   if run_epilogue :
     try :
       self.epilogue()
     except :
       exc = sys.exc_info()
       message.error('epilogue failed because ' + str(exc[0]))
       self.traceback(exc[2])
     # remove fatal callback
     message.terminate_cbs.rm(self.name)
   else :
     message.note('Not running epilogue due to early terminate')
   # tidy up
   mdb.finalize_all()
   # coverage
   if self.coverage :
     database.insert.write(self.coverage, self.mdb.log_id, database.upload.RESULT)
   # remove callbacks
   verilog.callback.remove_all()
Ejemplo n.º 2
0
 def end_of_simulation(self, run_epilogue=True):
     'Wrapper for epilogue'
     message.debug('End of Simulation')
     if run_epilogue:
         try:
             self.epilogue()
         except:
             exc = sys.exc_info()
             message.error('epilogue failed because ' + str(exc[0]))
             self.traceback(exc[2])
         # remove fatal callback
         message.terminate_cbs.rm(self.name)
     else:
         message.note('Not running epilogue due to early terminate')
     # tidy up
     mdb.finalize_all()
     # coverage
     if self.coverage:
         database.insert.write(self.coverage, self.mdb.log_id,
                               database.upload.RESULT)
     # remove callbacks
     verilog.callback.remove_all()
Ejemplo n.º 3
0
    # location of static data
    static = os.path.join(options.root, 'static')
    message.debug('Using %(path)s for static data', path=static)

    @bottle.get('/static/<filename:path>')
    def server_static(filename):
        return bottle.static_file(filename, root=static)

    @bottle.route('/')
    @bottle.route('/index.html')
    def index_html():
        return bottle.static_file('/index.html', root=static)

    if options.gevent:
        import gevent
        from gevent import monkey
        monkey.patch_all()

        class wsgi_log:
            @classmethod
            def write(cls, msg):
                message.note(msg)

        bottle_opts.update(server='gevent', log=wsgi_log)

    message.information('Starting bottle server')
    bottle.run(**bottle_opts)

    # keyboardInterrupt gets us here ...
    mdb.finalize_all()
Ejemplo n.º 4
0
  order = ordering[0]
  message.note('Iteration %(iter_cnt)d uses "%(order)s"', **locals())
  if xml :
    opt = database.optimize.options[order](xml=xml, **optimize_opts)
  else :
    opt = database.optimize.options[order](regressions, tests, **optimize_opts)
  run = opt.run()
  optimize_opts['previous'] = opt
  if len(ordering) > 1 :
    return iteration(ordering[1:], iter_cnt+1, run)
  # always return last optimization run
  return opt, run

opt, xml = iteration(options.order)
# annotate optimized coverage result to this invocation
opt.insert(mdb_conn.log_id)

################################################################################

if options.xml :
  try :
    outfile = options.xml % (regressions[0] if regressions else tests[0])
  except :
    outfile = options.xml
  message.information('dumping optimize to ' + outfile)
  with open(outfile, 'w') as desc :
    xml.write(desc)

message.success('optimizing ends')
mdb.finalize_all()