big whitespace cleanup
[pinmux.git] / src / bsv / bsv_lib / pwm_instance.bsv
1 /*
2 Copyright (c) 2013, IIT Madras
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8
9 * Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright notice,
12 this list of conditions and the following disclaimer in the documentation
13 and/or other materials provided with the distribution.
14 * Neither the name of IIT Madras nor the names of its contributors may be
15 used to endorse or promote products derived from this software without
16 specific prior written permission.
17
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 -------------------------------------------------------------------------------------------------
30
31 Code inpired by the pwm module at: https://github.com/freecores/pwm
32
33 */
34 package pwm_instance;
35 /*=== Project imports ==*/
36 import Clocks::*;
37 /*======================*/
38 /*== Package imports ==*/
39 //import defined_types::*;
40 `include "instance_defines.bsv"
41 import ClockDiv::*;
42 import ConcatReg::*;
43 import Semi_FIFOF::*;
44 import BUtils ::*;
45 `ifdef PWM_AXI4Lite
46 import AXI4_Lite_Types::*;
47 `endif
48 import pwm::*;
49 /*======================*/
50
51 `ifdef PWM_AXI4Lite
52 // the following interface and module will add the
53 // AXI4Lite interface to the PWM module
54 interface Ifc_PWM_bus_real;
55 interface Ifc_PWM_bus pwmbus;
56 endinterface
57
58 //(*synthesize*)
59 module mkPWM_real#(Clock ext_clock)(Ifc_PWM_bus);
60 Ifc_PWM_bus pwmbus <-mkPWM_bus(ext_clock, 32);
61 interface pwm_io = pwmbus.pwm_io.io;
62 interface axi4_slave = pwmbus.axi4_slave;
63 endmodule
64 `endif
65
66 endpackage