Beispiel #1
0
 def _gen_behavioral_trans_metadata(s, m):
     m.apply(BehavioralRTLIRGenL2Pass())
     m.apply(BehavioralRTLIRTypeCheckL2Pass())
     s.behavioral.rtlir[m] = m._pass_behavioral_rtlir_gen.rtlir_upblks
     s.behavioral.freevars[m] = \
         m._pass_behavioral_rtlir_type_check.rtlir_freevars
     s.behavioral.tmpvars[m] = \
         m._pass_behavioral_rtlir_type_check.rtlir_tmpvars
Beispiel #2
0
 def _gen_behavioral_trans_metadata( s, m ):
   m.apply( BehavioralRTLIRGenL2Pass( s.tr_top ) )
   m.apply( BehavioralRTLIRTypeCheckL2Pass( s.tr_top ) )
   s.behavioral.rtlir[m] = \
       m.get_metadata( BehavioralRTLIRGenL2Pass.rtlir_upblks )
   s.behavioral.freevars[m] = \
       m.get_metadata( BehavioralRTLIRTypeCheckL2Pass.rtlir_freevars )
   s.behavioral.tmpvars[m] = \
       m.get_metadata( BehavioralRTLIRTypeCheckL2Pass.rtlir_tmpvars )
Beispiel #3
0
def local_do_test(m):
    """Check if generated behavioral RTLIR is the same as reference."""
    m.elaborate()
    m.apply(BehavioralRTLIRGenL2Pass())
    m.apply(BehavioralRTLIRTypeCheckL2Pass())

    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
def local_do_test(m):
    """Check if generated behavioral RTLIR is the same as reference."""
    if isinstance(m, type):
        m = m.DUT()
    m.elaborate()
    m.apply(BehavioralRTLIRGenL2Pass(m))
    m.apply(BehavioralRTLIRTypeCheckL2Pass(m))

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