This IP Core contains both the HDL and firmware driver needed to realize a pulse width modulation module that's controllable from software. This IP uses the AXI bus to interface between the hardware and software components
In the HDL folder you'll find three files:
There are three registers that control the operation of the PWM module:
The PWM module will continuously count up to the "load" value and once it reaches the load value, will loop back to zero. When the counter is at zero, the output is set high. When the PWM module reaches the "compare" value, it clears the output. So the "high" width of the output signal is exactly "compare" clock ticks long (the clock is whatever clock you connect to the IP in your block design, but it will most likely be generated by the Zynq Processing System). The "low" width of the output signal is exactly "load" - "compare" clock ticks long. If you disable the PWM module (by setting bit zero of the control register to zero) then the output will always be low.
In other words, the "load" register determines your period, while the "compare" register determines your duty cycle.
The "PWM_Generator.h" header file contains helpful macros for manipulating the PWM registers while "main.c" gives an example of using those macros. This code would be used in a Xilinx SDK project created for a Zynq design that utilizes the PWM IP.