Example #1
0
 static
 void 
 utilization_weighted( Container &c,
                       MappingContainer  &mapping,
                       const std::size_t cores )
 {
    if( simple_check( c, mapping, cores ) )
    {
       return;
    }
    /** else use queue weights **/
    auto weight_func(
       []( PortInfo &a, PortInfo &b, void *weight_data ) -> std::int32_t
       {
           const auto size( a.getFIFO()->size() );
           if( size > 0 )
           {
             return( size );
           }
           else
           {
             return( 1 );
           }
       }
    );
    run_scotch( c, 
                mapping, 
                cores, 
                weight_func, 
                nullptr );
    return;
 }
Example #2
0
void _memory_init(struct multiboot_info *info) {
	// Use whatever information the bootloader gave us to figure out what
	// lives where in our address space and which parts of it we can use.
	if (info->flags & 1<<6) {
		// We have a BIOS memory map.
		struct memory_map *mmap = (struct memory_map*)info->memory_map_addr;
		map_check(mmap, info->memory_map_length);
	} else if (info->flags & 1<<0) {
		// We know how large the upper and lower memory banks are.
		simple_check(info->mem_lower * 1024, info->mem_upper * 1024);
	}
	if (IMAGE_BASE < memory_end && IMAGE_END > memory_base) {
		// The beginning of our memory region is already home to our
		// executable image and bootstrap stack. Move the allocation pointer
		// past it so we don't accidentally reuse it.
		memory_break = IMAGE_END;
	} else {
		memory_break = memory_base;
	}
	if (IMAGE_BASE > memory_base && IMAGE_BASE < memory_end) {
		// Truncate the memory region so it no longer overlaps the executable.
		memory_end = IMAGE_BASE;
	}
}
Example #3
0
 static 
 void  
 simple( Container         &c, 
         MappingContainer  &mapping,
         const std::size_t cores )
 {
    if( simple_check( c, mapping, cores ) )
    {
       return;
    }
    auto weight_func( 
       []( PortInfo &a, PortInfo &b, void *weight_data ) -> std::int32_t
       {
          /** simple weight to start **/
          return( 1 );
       }
    );
    run_scotch( c, 
                mapping, 
                cores, 
                weight_func, 
                nullptr );
    return;
 }