示例#1
0
def main(argv):
    options, args = get_options(argv)
    command = options['command']
    if command == 'amazon':
        amazon.main(args)
    elif command == 'yahoo':
        yahoo.main(args)
    elif command == 'jancode':
        jancode.main(args)
    elif command == 'cache':
        cache.main(args)
    elif command == 'id':
        identifiers.main(args)
示例#2
0
 def app_pyLauncher(self, fname):
     print('Launch %s...' % uos.getcwd() + '/' + fname)
     lcd.setCursor(self.upleft[0] + 1, self.upleft[1] + 1)
     lcd.println('Now loading...')
     with open(fname, 'rb') as o:
         code = o.read()
     with open(PATH_CACHE, 'wb') as o:
         o.write(code)
     if 'cache' in sys.modules.keys():
         del sys.modules['cache']
     lcd.clear()
     import cache
     if code[:18] == b'# -*- advanced -*-':
         print('-*- This is an advanced program -*-')
         cache.Main().run()
     else:
         cache.main()
            results = 'time per pixel (ns),energy per pixel (nJ),rows,ways,l1_size\n'
            for rows in rows_of_parallelism:
                for l1_size in l1_sizes:
                    break_now = False
                    for ways in degrees_of_associativity:

                        config = "rows=%s, ways=%s; l1_size=%s" % (rows, ways, l1_size)
                        print(config)
                        try:
                            time_pp, energy_pp = main(kernel=kernel,
                                                      image_size=size,
                                                      n_images=n_images,
                                                      l1_ways=ways,
                                                      l2_ways=ways,
                                                      l1_block_size=64,
                                                      l2_block_size=64,
                                                      l1_size=l1_size,
                                                      l2_size=2097152,
                                                      parallelism=rows,
                                                      store_to_cache=store_to_cache,
                                                      dram_multiplier=dram_multiplier,
                                                      verbose=False)
                        except Exception as e:
                            time_pp, energy_pp = 'error', 'error'
                            print("Exception encountered w/ config=%s\nException:\n%s"
                                  "" % (config, e))
                            break_now = True
                        if break_now:
                            break

                        results += ('%s,%s,%s,%s,%s\n'