Skip to content

Tools

tools

Provides some tools that could be used almost out of the box

translate_lustre

translate_lustre(infilename, topnode, realtype, outmodule='encoding', inttype='int32')

Translates a lustre file into intrepyd syntax

inttype is 'int32' by default, as it always was; 'int' encodes lustre int as unbounded integers, its actual semantics, which is often much easier for the engines too

translate_simulink(infilename, outmodule='encoding', realtype='float', variables=None, scripts=None, mats=None, callbacks=True, finite_inputs=False, design_ranges=False)

Translates a Simulink model, a .mdl or a .slx file, into intrepyd syntax

The circuit of the module has the root Inport and Outport blocks of the model as inputs and outputs, and as targets its Assertion blocks, reached when an assertion fails, and the errors that would stop a simulation of its Stateflow charts (a division by zero, a state inconsistency, a conversion out of range). realtype is 'float' (single and double as floats, exactly) or 'real' (as reals, which is not exact). The MATLAB workspace the model refers to is filled by the callbacks of the model, unless callbacks is False, then by the MAT files in mats, the MATLAB scripts in scripts, and the variables, a dictionary of MATLAB expressions. With finite_inputs, the float inputs are assumed finite, neither NaN nor infinite; with design_ranges, within the OutMin and OutMax of their Inports, as Simulink Design Verifier takes them. Raises intrepyd.simulink.SimulinkError, listing the blocks that cannot be translated, if the model cannot be, or saying why there is no valid license of intrepid, which translating needs as the engines do. Needs the Simulink front-end library, see intrepyd.simulink.

translate_iec61131

translate_iec61131(infilename, outmodule='encoding')

Translates a ST iec61131 file into intrepyd syntax

simulate

simulate(ctx, infile, depth, outputs)

Simulates the design using default values for inputs or by taking input values from an existing simulation file

read_trace_csv

read_trace_csv(path)

The values of a trace from a CSV file, as write_trace_csv writes it: a header of the depths, then a row per net, its name first

write_trace_csv

write_trace_csv(path, name2values)

Writes the values of a trace, name -> [value@0, value@1, ...], to a CSV file: a header of the depths, then a row per net, its name first