Ignore:
Timestamp:
Jul 16, 2010, 6:28:29 AM (9 years ago)
Author:
cameron
Message:

Eliminate int_carry parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/bitstream_compiler.py

    r434 r512  
    3434        f.close()
    3535
    36     def generate_code(self, s, file_path, int_carry):
     36    def generate_code(self, s, file_path):
    3737        # FRONT END
    3838        s = ast.parse(s)
     
    5151        all_lives, s = py2bitexpr.eliminate_dead_code(s, set(livelist))
    5252        s = py2bitexpr.factor_out(s)
    53         s, livelist = py2bitexpr.process_while_loops(s, int_carry)
     53        s, livelist = py2bitexpr.process_while_loops(s)
    5454       
    5555
    5656        # BACK END
    57         declarations = py2bitexpr.gen_declarations(s, int_carry)
     57        declarations = py2bitexpr.gen_declarations(s)
    5858        templ = self.read_template(file_path)
    5959
    60         templ = self.output(declarations, py2bitexpr.print_stream_stmts(copy.deepcopy(s)), py2bitexpr.print_block_stmts(s, int_carry), templ)
     60        templ = self.output(declarations, py2bitexpr.print_stream_stmts(copy.deepcopy(s)), py2bitexpr.print_block_stmts(s), templ)
    6161        self.write_final_code(templ)
    6262        return s
    6363
    6464OPTION_TEMPLATE_NAME = '-t'
    65 OPTION_INT_CARRY = '-int_carry'
    66 OPTION_SIMD_CARRY = '-simd-carry'
    6765
    6866
     
    8381
    8482    return flags, non_flags
    85 
    86 def option_carry(flags):
    87     l = len(flags)
    88     for i in range(l):
    89         if flags[i] == OPTION_SIMD_CARRY:
    90             return False, i
    91         if flags[i] == OPTION_INT_CARRY:
    92             return True, i
    93     return True, -1 #default carry type is int
    9483
    9584def option_template(flags):
     
    116105
    117106def read_options(flags):
    118     carry_option, index = option_carry(flags)
    119     if index >= 0:
    120         del flags[index]
    121    
    122107    template_name, index = option_template(flags)
    123108    if index >= 0:
     
    128113        print "WARNING: Unrecognized/duplicated options found!"
    129114   
    130     return carry_option, template_name
     115    return template_name
    131116###############################################################
    132117
     
    145130            out_file = non_flags[2]
    146131       
    147         carry_option, template_name = read_options(flags)
     132        template_name = read_options(flags)
    148133       
    149         s = Program(out_file, template_name).generate_code(read_input(non_flags[1]), file_path, carry_option)
     134        s = Program(out_file, template_name).generate_code(read_input(non_flags[1]), file_path)
Note: See TracChangeset for help on using the changeset viewer.