Ejemplo n.º 1
0
def local_do_test( m ):
  """Check if generated behavioral RTLIR is the same as reference."""
  m.apply( BehavioralRTLIRGenPass() )
  m.apply( BehavioralRTLIRTypeCheckPass() )
  m.apply( BehavioralRTLIRVisualizationPass() )
  ref = m._rtlir_tmpvar_ref
  ns = m._pass_behavioral_rtlir_type_check

  for tvar_name in ref.keys():
    assert tvar_name in ns.rtlir_tmpvars
    assert ns.rtlir_tmpvars[tvar_name] == ref[tvar_name]
Ejemplo n.º 2
0
def local_do_test(m):
    """Check if generated behavioral RTLIR is the same as reference."""
    m.apply(BehavioralRTLIRGenPass(m))
    m.apply(BehavioralRTLIRTypeCheckPass(m))
    m.apply(BehavioralRTLIRVisualizationPass())
    ref = m._rtlir_tmpvar_ref
    rtlir_tmpvars = m.get_metadata(BehavioralRTLIRTypeCheckPass.rtlir_tmpvars)

    for tvar_name in ref.keys():
        assert tvar_name in rtlir_tmpvars
        assert rtlir_tmpvars[tvar_name] == ref[tvar_name]
Ejemplo n.º 3
0
def local_do_test(m):
    """Check if generated behavioral RTLIR is the same as reference."""

    ref = m._rtlir_test_ref
    m.elaborate()
    m.apply(BehavioralRTLIRGenPass())
    m.apply(BehavioralRTLIRTypeCheckPass())
    m.apply(BehavioralRTLIRVisualizationPass())

    for blk in m.get_update_blocks():
        assert\
          m._pass_behavioral_rtlir_gen.rtlir_upblks[ blk ] == ref[ blk.__name__ ]
Ejemplo n.º 4
0
def local_do_test(m):
    """Check if generated behavioral RTLIR is the same as reference."""
    m.elaborate()
    m.apply(BehavioralRTLIRGenL5Pass())
    m.apply(BehavioralRTLIRTypeCheckL5Pass())
    m.apply(BehavioralRTLIRVisualizationPass())

    try:
        ref = m._rtlir_test_ref
        for blk in m.get_update_blocks():
            upblk = m._pass_behavioral_rtlir_gen.rtlir_upblks[blk]
            assert upblk == ref[blk.__name__]
    except AttributeError:
        pass