This paper presents the development and use of a traveling wave model of waveguide-based grating devices for use as a compact model in a circuit-level simulator. Both passive and active devices are modeled, with the grating being characterized by coupling coefficients for the two counter-propagating waves. It is shown how the implicit carrier frequency can be offset from the Bragg frequency using two possible methods: either by the static detuning of the model or introducing a phase modulation into the coupling coefficients. Other physical aspects of the model are addressed such as dispersion and energy conservation. A comparison to a 1D Yee-cell model is used to verify the applicability of the traveling wave model. As an example of the circuit simulation of a passive device, an optical code generating application is used and it is noted that for a passive device the interface between the compact model and the circuit simulator is not a concern. Using traveling-wave-based laser simulations of grating-based laser structures it is demonstrated that the model captures the complex behaviour of the devices. In particular the lasing frequency is naturally produced from the model and the introduction of delay elements into the structure can be used to restrict the laser to single mode operation. A number of examples are used to illustrate important aspects of its use as a compact model. Firstly, it is shown that an operating point for either of the laser configurations can be constructed and detuning used to produce an un-modulated output, allowing for much more efficient simulations. A final example uses a directly modulated laser to illustrate the effect of back reflection on the stability of the laser simulation.