def local_do_test( m ):
  """Check if generated behavioral RTLIR is the same as reference."""
  m.apply( BehavioralRTLIRGenPass() )
  m.apply( BehavioralRTLIRTypeCheckPass() )
  ref = m._rtlir_freevar_ref
  ns = m._pass_behavioral_rtlir_type_check

  for fvar_name in ref.keys():
    assert fvar_name in ns.rtlir_freevars
    assert ns.rtlir_freevars[fvar_name] == ref[ fvar_name ]
Esempio 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))
    ref = m._rtlir_freevar_ref
    rtlir_freevars = m.get_metadata(
        BehavioralRTLIRTypeCheckPass.rtlir_freevars)

    for fvar_name in ref.keys():
        assert fvar_name in rtlir_freevars
        assert rtlir_freevars[fvar_name] == ref[fvar_name]
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__ ]