@@ -24,28 +24,28 @@ def make_binary():
2424 return prog_bin
2525
2626
27- def test_tvm_get_section_size (binary ):
27+ def test_tvm_callback_get_section_size (binary ):
2828 tmp_dir = util .tempdir ()
2929 tmp_bin = tmp_dir .relpath ("obj.bin" )
3030 with open (tmp_bin , "wb" ) as f :
3131 f .write (binary )
3232 def verify ():
33- print ("Text section size: %d" % tvm_get_section_size (tmp_bin , "text" ))
34- print ("Data section size: %d" % tvm_get_section_size (tmp_bin , "data" ))
35- print ("Bss section size: %d" % tvm_get_section_size (tmp_bin , "bss" ))
33+ print ("Text section size: %d" % tvm_callback_get_section_size (tmp_bin , "text" ))
34+ print ("Data section size: %d" % tvm_callback_get_section_size (tmp_bin , "data" ))
35+ print ("Bss section size: %d" % tvm_callback_get_section_size (tmp_bin , "bss" ))
3636 print
3737 verify ()
3838
3939
40- def test_tvm_relocate_binary (binary ):
40+ def test_tvm_callback_relocate_binary (binary ):
4141 tmp_dir = util .tempdir ()
4242 tmp_bin = tmp_dir .relpath ("obj.bin" )
4343 with open (tmp_bin , "wb" ) as f :
4444 f .write (binary )
4545 def verify ():
46- rel_bin = tvm_relocate_binary (tmp_bin , "0x0" , "0x10000" , "0x20000" )
46+ rel_bin = tvm_callback_relocate_binary (tmp_bin , "0x0" , "0x10000" , "0x20000" )
4747 print ("Relocated binary section sizes" )
48- test_tvm_get_section_size (rel_bin )
48+ test_tvm_callback_get_section_size (rel_bin )
4949 relf = tmp_dir .relpath ("rel.bin" )
5050 with open (relf , "wb" ) as f :
5151 f .write (rel_bin )
@@ -59,38 +59,34 @@ def verify():
5959 verify ()
6060
6161
62- def test_tvm_read_binary_section (binary ):
63- tmp_dir = util .tempdir ()
64- tmp_bin = tmp_dir .relpath ("obj.bin" )
65- with open (tmp_bin , "wb" ) as f :
66- f .write (binary )
62+ def test_tvm_callback_read_binary_section (binary ):
6763 def verify ():
68- text_bin = tvm_read_binary_section ( tmp_bin , "text" )
69- data_bin = tvm_read_binary_section ( tmp_bin , "data" )
70- bss_bin = tvm_read_binary_section ( tmp_bin , "bss" )
64+ text_bin = tvm_callback_read_binary_section ( binary , "text" )
65+ data_bin = tvm_callback_read_binary_section ( binary , "data" )
66+ bss_bin = tvm_callback_read_binary_section ( binary , "bss" )
7167 print ("Read text section part of binary? %r" % (text_bin in binary ))
7268 print ("Read data section part of binary? %r" % (data_bin in binary ))
7369 print ("Read bss section part of binary? %r" % (bss_bin in binary ))
7470 print
7571 verify ()
7672
7773
78- def test_tvm_get_symbol_map (binary ):
74+ def test_tvm_callback_get_symbol_map (binary ):
7975 tmp_dir = util .tempdir ()
8076 tmp_bin = tmp_dir .relpath ("obj.bin" )
8177 with open (tmp_bin , "wb" ) as f :
8278 f .write (binary )
8379 def verify ():
84- rel_bin = tvm_relocate_binary (tmp_bin , "0x0" , "0x10000" , "0x20000" )
85- symbol_map = tvm_get_symbol_map (rel_bin )
80+ rel_bin = tvm_callback_relocate_binary (tmp_bin , "0x0" , "0x10000" , "0x20000" )
81+ symbol_map = tvm_callback_get_symbol_map (rel_bin )
8682 print ("Obtained symbol map" )
8783 print (symbol_map )
8884 verify ()
8985
9086
9187if __name__ == "__main__" :
9288 prog_bin = make_binary ()
93- test_tvm_get_section_size (prog_bin )
94- test_tvm_relocate_binary (prog_bin )
95- test_tvm_read_binary_section (prog_bin )
96- test_tvm_get_symbol_map (prog_bin )
89+ test_tvm_callback_get_section_size (prog_bin )
90+ test_tvm_callback_relocate_binary (prog_bin )
91+ test_tvm_callback_read_binary_section (prog_bin )
92+ test_tvm_callback_get_symbol_map (prog_bin )
0 commit comments