An HDL simulator having an automated interface to compiled or interpreted application code written in a
general purpose language. The interface enables the HDL code to have a direct
data access to and from the application code. The simulator automatically maps and converts HDL data types to and from
programming language data types, such as the arguments of routine calls or direct data accesses. Further, the simulator provides a
programming language calling mechanism and automatically does
data type mapping of arguments, which enables the HDL to call application code routines compiled with a standard
compiler, and enables such routines to call functions in the HDL. The simulator automatically generates wrappers for the interface which automatically map data types for direct
data access when the application code is compiled, and can output messages upon the occurrence of calls or returns. The automatically generated wrappers also provide automatic threading, which enables compiled application code to call tasks in the HDL.