22. The method of claim 16 , wherein selecting the hardware specific function is based on argument properties or data type of the function or the operator in the model code.
16. A computer-implemented method for generating code based on a graphical model, the method comprising: identifying, using a processor, a pattern in model code, where: the model code is associated with a graphical model having executable semantics, the pattern is associated with a function or an operator in the model code, and the function or the operator performs operations when the model code is executed; selecting a hardware specific function that performs an operation equivalent to a respective operation performed by the identified pattern; replacing the identified pattern with the hardware specific function selected by the lookup; receiving a selection of a first hardware specific library from a plurality of hardware specific libraries, the hardware specific libraries corresponding to one of a first target environment and a second target environment, the first hardware specific library corresponding to the first target environment; the hardware specific libraries comprising a plurality of relationships between the model code and hardware specific functions, and the hardware specific functions being executable in the first target environment; and performing a lookup of the identified pattern in the first hardware specific library, wherein selecting the hardware specific function is based on the lookup.