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/py2bitexpr.py

    r460 r512  
    952952    return res
    953953
    954 def gen_output(var_dic, int_carry):
     954def gen_output(var_dic):
    955955        s = ''
    956956        for i in var_dic['bitblock']:
     
    975975
    976976        for i in  var_dic['int']:
    977                 if int_carry:
    978                         s+="CarryType %s = Carry0;\n"%i
    979                 else:
    980                         s+="CarryType %s = Carry0;\n"%i
     977                s+="CarryType %s = Carry0;\n"%i
     978
    981979
    982980
     
    10111009        return vd
    10121010
    1013 def gen_declarations(s, int_carry):
     1011def gen_declarations(s):
    10141012    vd = gen_var_dic(s)
    1015     return gen_output(vd, int_carry)
     1013    return gen_output(vd)
    10161014#################################################################################################################
    10171015## This class replaces all occurrences of a reduced variable to its value --- Pass 7
     
    12961294    return loop, carries
    12971295
    1298 def process_while_loops(code, int_carry):
     1296def process_while_loops(code):
    12991297    all = []
    13001298    update = {}
    13011299   
    1302     if int_carry:
    1303         carry_type = "int"
    1304     else:
    1305         carry_type = "vector"
     1300    carry_type = "int"
     1301
    13061302   
    13071303    for index, loc in enumerate(code):
     
    14611457        assert (1==0)
    14621458
    1463 def print_block_stmts(s, int_carry, indent = 0):
     1459def print_block_stmts(s, indent = 0):
    14641460    indent_unit = 4
    14651461    code = ""
     
    14681464    if isinstance(s[0], bitexpr.If):
    14691465        code = generate_statement(s[0].control_expr, indent, "if")
    1470         code += print_block_stmts(s[0].true_branch, int_carry, indent+indent_unit)
     1466        code += print_block_stmts(s[0].true_branch, indent+indent_unit)
    14711467        code += " "*indent+"}\n"
    14721468        code += " "*indent+"else {\n"
    1473         code += print_block_stmts(s[0].false_branch, int_carry, indent+indent_unit)
     1469        code += print_block_stmts(s[0].false_branch, indent+indent_unit)
    14741470        code += " "*indent+"}\n"
    14751471
    14761472    elif isinstance(s[0], bitexpr.WhileLoop):
    14771473        code = "\n%s((%s)||(test_carry(%s))) {\n"%(" "*indent+"while"+" ", generate_condition(s[0].control_expr), s[0].carry_expr.var.varname)
    1478         code += print_block_stmts(s[0].stmts, int_carry, indent+indent_unit)
     1474        code += print_block_stmts(s[0].stmts, indent+indent_unit)
    14791475        code += " "*indent+"}\n"
    14801476    elif (isinstance(s[0].RHS, bitexpr.Const)):
     
    15381534                code += ");\n"
    15391535    s.pop(0)
    1540     return code+print_block_stmts(s, int_carry, indent)
     1536    return code+print_block_stmts(s, indent)
    15411537
    15421538
Note: See TracChangeset for help on using the changeset viewer.