0dbe9228115aac80c2c67412b9ac0d4d6c34aa67
1 # === templates for interface definitions ====== #
2 mux_interface_def
= '''
3 method Action cell{0}_mux(Bit#({1}) in);
8 method io_outputval_{0}=cell{0}_mux_out.outputval;
9 method io_output_en_{0}=cell{0}_mux_out.output_en;
10 method io_input_en_{0}=cell{0}_mux_out.input_en;
11 method io_pullup_en_{0}=cell{0}_mux_out.pullup_en;
12 method io_pulldown_en_{0}=cell{0}_mux_out.pulldown_en;
13 method io_drivestrength_{0}=cell{0}_mux_out.drivestrength;
14 method io_pushpull_en_{0}=cell{0}_mux_out.pushpull_en;
15 method io_opendrain_en_{0}=cell{0}_mux_out.opendrain_en;
16 method Action io_inputval_{0}(Bit#(1) in);
20 uartinterface_def
= '''
21 method uart{0}_rx=wruart{0}_rx;
22 method Action uart{0}_tx(Bit#(1) in);
26 spiinterface_def
= '''
27 method Action spi{0}_sclk (Bit#(1) in);
30 method Action spi{0}_mosi (Bit#(1) in);
33 method Action spi{0}_nss (Bit#(1) in);
36 method Bit#(1) spi{0}_miso=wrspi{0}_miso;
39 twiinterface_def
= '''
41 method Action twi{0}_sda_out (Bit#(1) in);
44 method Action twi{0}_sda_outen (Bit#(1) in);
45 wrtwi{0}_sda_outen<=in;
47 method twi{0}_sda_in=wrtwi{0}_sda_in;
49 method Action twi{0}_scl_out (Bit#(1) in);
52 method Action twi{0}_scl_outen (Bit#(1) in);
53 wrtwi{0}_scl_outen<=in;
55 method twi{0}_scl_in=wrtwi{0}_scl_in;
60 method Action sd{0}_clk (Bit#(1) in);
63 method Action sd{0}_cmd (Bit#(1) in);
66 method Action sd{0}_d0_out (Bit#(1) in);
69 method Action sd{0}_d0_outen (Bit#(1) in);
72 method sd{0}_d0_in=wrsd{0}_d0_in;
73 method Action sd{0}_d1_out (Bit#(1) in);
76 method Action sd{0}_d1_outen (Bit#(1) in);
79 method sd{0}_d1_in=wrsd{0}_d1_in;
80 method Action sd{0}_d2_out (Bit#(1) in);
83 method Action sd{0}_d2_outen (Bit#(1) in);
86 method sd{0}_d2_in=wrsd{0}_d2_in;
87 method Action sd{0}_d3_out (Bit#(1) in);
90 method Action sd{0}_d3_outen (Bit#(1) in);
93 method sd{0}_d3_in=wrsd{0}_d3_in;
96 jtaginterface_def
= '''
97 method Bit#(1) jtag{0}_tdi=wrjtag{0}_tdi;
98 method Bit#(1) jtag{0}_tms=wrjtag{0}_tms;
99 method Bit#(1) jtag{0}_tclk=wrjtag{0}_tclk;
100 method Bit#(1) jtag{0}_trst=wrjtag{0}_trst;
101 method Action jtag{0}_tdo(Bit#(1) in);
106 pwminterface_def
= '''
107 method Action pwm{0}_pwm(Bit#(1) in);
111 # ============================================== #