Changeset 1271 for proto/Compiler


Ignore:
Timestamp:
Aug 4, 2011, 5:04:35 AM (8 years ago)
Author:
cameron
Message:

Add --IDISA option to generate new IDISA operation calls.

Location:
proto/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/config.py

    r1195 r1271  
    3737                          )
    3838       
     39        parser.add_option('-i', '--IDISA',
     40                          dest='use_IDISA',
     41                          action='store_true',
     42                          default=False,
     43                          help='use new IDISA ops for output',
     44                          )
     45       
    3946        # Group options
    4047        # 'dump'
  • proto/Compiler/pablo.py

    r1219 r1271  
    88import ast, copy, sys
    99import Cgen
     10
     11name_substitution_map = {}
    1012
    1113def is_BuiltIn_Call(fncall, builtin_fnname, builtin_arg_cnt, builtin_fnmod_noprefix='bitutil'):
     
    2224
    2325def mkCall(fn_name, args):
    24   if isinstance(fn_name, str): fn_name = ast.Name(fn_name, ast.Load())
     26  if isinstance(fn_name, str):
     27        if name_substitution_map.has_key(fn_name): fn_name = name_substitution_map[fn_name]
     28        fn_name = ast.Name(fn_name, ast.Load())
    2529  return ast.Call(fn_name, args, [], None, None)
    2630
  • proto/Compiler/pablomain.py

    r1210 r1271  
    8383        input_string = readfile(input_file)
    8484               
     85        if options.use_IDISA:
     86                pablo.name_substitution_map = {'bitblock_has_bit' : 'bitblock::any',
     87                                             'simd_const_1' : 'mvmd<1>::fill'}
     88               
    8589        # Compiler modes
    8690        if options.struct_decs:
Note: See TracChangeset for help on using the changeset viewer.