Changeset 401 for soft/giet_vm


Ignore:
Timestamp:
Aug 26, 2014, 4:11:33 PM (10 years ago)
Author:
cfuguet
Message:

genmap: importing dynamically the applications module

  • Adding option in the genmap script to only generate the hard_config.h file.
  • Importing dynamically the applications module to avoid errors when these modules are not needed and then not defined.
Location:
soft/giet_vm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/convol/convol.py

    r384 r401  
    9999            for p in xrange( procs_max ):
    100100                trdid = (((x * y_size) + y) * procs_max) + p
    101                 mapping.addTask( vspace, 'sort_%d_%d_%d' % (x,y,p), trdid, x, y, p,
     101                mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p), trdid, x, y, p,
    102102                                 'conv_stack_%d_%d_%d' % (x,y,p),
    103103                                 'conv_heap_%d_%d' % (x,y), 0 )
  • soft/giet_vm/giet_python/genmap

    r371 r401  
    3232
    3333from optparse import OptionParser
    34 
    3534from mapping import *
    36 
    37 from transpose import *
    38 from sort import *
    39 from convol import *
    4035
    4136import sys
     
    7570                   help = 'define pathname for the map.bin & vsegs.ld file ' )
    7671
     72parser.add_option( '--hard', type = 'string', dest = 'hard_path',
     73                   help = 'define pathname for the hard_config.h file ' )
     74
    7775parser.add_option( '--xml', type = 'string', dest = 'xml_path',
    7876                   help = 'define pathname for the map.xml file' )
     
    107105almos_path    = options.almos_path  # path for arch.bib file
    108106giet_path     = options.giet_path   # path for map.bin & vsegs.ld files
     107hard_path     = options.hard_path   # path for the hard_config.h file
    109108
    110109arch_path     = options.arch_path   # path to selected architecture
     
    138137######################################################################################
    139138
    140 if ( map_transpose ):
    141     transpose( mapping )
     139if ( map_transpose ):
     140    app = __import__( 'transpose' )
     141    app.transpose( mapping )
    142142    print '[genmap] application "transpose" loaded'
    143143
    144144if ( map_sort ):     
    145     sort( mapping )
     145    app = __import__( 'sort' )
     146    app.sort( mapping )
    146147    print '[genmap] application "sort" loaded'
    147148
    148149if ( map_convol ):     
    149     convol( mapping )
     150    app = __import__( 'convol' )
     151    app.convol( mapping )
    150152    print '[genmap] application "convol" loaded'
    151153
     
    205207    print '[genmap] %s generated for giet_vm' % pathname
    206208
     209######################################################################################
     210#   Generate hard_config.h file if required.
     211######################################################################################
     212
     213if ( hard_path != None ):
     214
     215    pathname = hard_path + '/hard_config.h'
     216    f = open ( pathname, 'w' )
     217    f.write( mapping.hard_config() )
     218    print '[genmap] %s generated for %s' % (pathname, arch_path)
     219
Note: See TracChangeset for help on using the changeset viewer.