Ignore:
Timestamp:
Dec 11, 2010, 6:35:42 AM (9 years ago)
Author:
cameron
Message:

SIMD register dump facility for debugging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r787 r810  
    334334
    335335
     336#
     337# Adding Debugging Statements
     338#
     339class Add_SIMD_Register_Dump(ast.NodeTransformer):
     340  def xfrm(self, t):
     341    return self.generic_visit(t)
     342  def visit_Assign(self, t):
     343    self.generic_visit(t)
     344    v = t.targets[0]
     345    dump_stmt = mkCallStmt('print_simd_register', [ast.Str(Cgen.py2C().gen(v)), v])
     346    return [t, dump_stmt]
     347   
     348
    336349#  Translate a function
    337350#
     
    380393    if self.carry_count > 0: self.Cinits += "CarryInit(%s, %i);\n" % (self.carry_var, self.carry_count)
    381394    self.Cinits += StreamInitializations().xfrm(self.main_module)
    382   def xfrm_block_stmts(self):
     395  def xfrm_block_stmts(self, add_dump_stmts=False):
    383396    AugAssignRemoval().xfrm(self.main_fn)
    384397    Bitwise_to_SIMD().xfrm(self.main_fn)
    385398    CarryIntro().xfrm_fndef(self.main_fn)
     399    if add_dump_stmts: Add_SIMD_Register_Dump().xfrm(self.main_fn)
    386400  def add_loop_carryQ_adjust(self):
    387401    self.main_fn.body += [mkCallStmt('CarryQ_Adjust', [ast.Name(self.carry_var, ast.Load()), ast.Num(self.carry_count)])]
Note: See TracChangeset for help on using the changeset viewer.