1. A method comprising: generating code for a caller element of a first graphical model and a called element of a second graphical model, comprising: generating a first function, the first function representing an interface between the caller element and the called element, through which the caller element calls the called element, the first function comprising: one or more first input arguments corresponding to one or more input variables of the caller element, and one or more first output arguments corresponding to one or more output variables of the caller element, the called element comprising the one or more input variables and the one or more output variables passed from the caller element, and generating a second function, the second function representing an underlying function of the called element, the underlying function including at least one of the one or more input variables passed from the caller element and at least one of the one or more output variables, the underlying function additionally including one or more internal input variables and one or more internal output variables, the second function comprising: one or more second input arguments corresponding to the at least one of the one or more input variables and the one or more internal input variables, and one or more second output arguments corresponding to the at least one of the one or more output variables and the one or more internal output variables, the generating the code being performed by one or more devices.