Skip to content

Commit

Permalink
[import] Release line trace string at final
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpan committed Oct 23, 2023
1 parent 4b681f3 commit b435704
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def finalize( s ):
s._finalization_count += 1
# Clean up python side FFI references
# del s._line_trace_str
del s._line_trace_str
s._ffi_inst.destroy_model( s._ffi_m )
s.ffi.dlclose( s._ffi_inst )
Expand All @@ -95,7 +95,7 @@ def __del__( s ):
s._finalization_count += 1
# Clean up python side FFI references
# del s._line_trace_str
del s._line_trace_str
s._ffi_inst.destroy_model( s._ffi_m )
s.ffi.dlclose( s._ffi_inst )
Expand Down Expand Up @@ -123,8 +123,8 @@ def construct( s, *args, **kwargs ):
s._ffi_m = s._ffi_inst.create_model( ffi_vl_vcd_file )
# Buffer for line tracing
# s._line_trace_str = s.ffi.new('char[512]')
# s._convert_string = s.ffi.string
s._line_trace_str = s.ffi.new('char[512]')
s._convert_string = s.ffi.string
# Use non-attribute varialbe to reduce CPython bytecode count
_ffi_m = s._ffi_m
Expand Down Expand Up @@ -168,9 +168,8 @@ def assert_en( s, en ):
def line_trace( s ):
if {external_trace}:
# s._ffi_inst.trace( s._ffi_m, s._line_trace_str )
# return s._convert_string( s._line_trace_str ).decode('ascii')
print('no implemented')
s._ffi_inst.trace( s._ffi_m, s._line_trace_str )
return s._convert_string( s._line_trace_str ).decode('ascii')
else:
{line_trace}
Expand Down

0 comments on commit b435704

Please sign in to comment.