initial commit with minimal templates
[pinmux.git] / src / interface_decl.py
1 from params import *
2
3 #######====== Interface declarations =======#########
4 mux_interface='''
5 method Action cell{0}_mux(Bit#('''+str(N_MUX)+''') in);'''
6
7 io_interface='''
8 (*always_ready*) method Bit#(1) io_outputval_{0};
9 (*always_ready*) method Bit#(1) io_output_en_{0};
10 (*always_ready*) method Bit#(1) io_input_en_{0};
11 (*always_ready*) method Bit#(1) io_pullup_en_{0};
12 (*always_ready*) method Bit#(1) io_pulldown_en_{0};
13 (*always_ready*) method Bit#(1) io_drivestrength_{0};
14 (*always_ready*) method Bit#(1) io_pushpull_en_{0};
15 (*always_ready*) method Bit#(1) io_opendrain_en_{0};
16 (*always_ready,always_enabled,result="io"*) method Action io_inputval_{0}(Bit#(1) in);
17 '''
18 #== Peripheral Interface definitions ==#
19 # these are the interface of the peripherals to the pin mux
20 # Outputs from the peripherals will be inputs to the pinmux
21 # module. Hence the change in direction for most pins
22
23 uartinterface_decl='''
24 (*always_ready,always_enabled*) method Action tx_{0}(Bit#(1) in);
25 (*always_ready,always_enabled*) method Bit#(1) rx_{0};
26 '''
27
28 spiinterface_decl='''
29 (*always_ready,always_enabled*) method Action sclk_{0} (Bit#(1) in);
30 (*always_ready,always_enabled*) method Action mosi_{0} (Bit#(1) in);
31 (*always_ready,always_enabled*) method Action ss_{0} (Bit#(1) in);
32 (*always_ready,always_enabled*) method Bit#(1) miso_{0};
33 '''
34 #=======================================#
35
36