Technical data
Using checkpoint/restore with the FLI
ModelSim EE/PLUS Reference Manual VHDL Foreign Language Interface and Verilog PLI
-
463
vhdl_integer : OUT integer;
vhdl_enum : OUT severity_level;
vhdl_real : OUT real;
vhdl_array : OUT string) is
begin
report "ERROR: foreign subprogram out_params not called";
end;
end;
Entity (test) example
The VHDL entity
test
contains calls to procedures (
in_params
and
out_params
)
that are declared in
pkg
and linked to functions in the original C subprogram.
entity test is end;
use work.pkg.all;
architecture only of test is
begin
process
variable int : integer := 0;
variable enum : severity_level := note;
variable r : real := 0.0;
variable s : string(1 to 5) := "abcde";
begin
for i in 1 to 10 loop
in_params(int, enum, r, s);
out_params(int, enum, r, s);
end loop;
wait;
end process;
end;
Using checkpoint/restore with the FLI
In order to use checkpoint/restore with the FLI, any data structures that have been
allocated in foreign models and certain ID's passed back from mti function calls,
must be explicitly saved and restored. We have provided a number of features to
make this as painless as possible.
The main feature is a set of memory allocation function calls. Memory allocated
by such a function call will be automatically restored for you to the same location
in memory, ensuring that pointers into the memory will still be valid.
The second feature is a collection of explicit calls to save and restore data. You
will need to use these for any pointers to your data structures, and for ID's returned