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}_out.outputval;
9 method io_output_en_{0}=cell{0}_out.output_en;
10 method io_input_en_{0}=cell{0}_out.input_en;
11 method io_pullup_en_{0}=cell{0}_out.pullup_en;
12 method io_pulldown_en_{0}=cell{0}_out.pulldown_en;
13 method io_drivestrength_{0}=cell{0}_out.drivestrength;
14 method io_pushpull_en_{0}=cell{0}_out.pushpull_en;
15 method io_opendrain_en_{0}=cell{0}_out.opendrain_en;
16 method Action io_inputval_{0}(Bit#(1) in);
20 uartinterface_def
= '''
21 method rx_{0}=wruart{0}_rx;
22 method Action tx_{0}(Bit#(1) in);
26 spiinterface_def
= '''
27 method Action sclk_{0} (Bit#(1) in);
30 method Action mosi_{0} (Bit#(1) in);
33 method Action ss_{0} (Bit#(1) in);
36 method Bit#(1) miso_{0}=wrspi{0}_miso;
39 twiinterface_def
= '''
41 method Action sda{0}_out (Bit#(1) in);
44 method Action sda{0}_outen (Bit#(1) in);
45 wrtwi{0}_sda_outen<=in;
47 method sda{0}_in=wrtwi{0}_sda_in;
49 method Action scl{0}_out (Bit#(1) in);
52 method Action scl{0}_outen (Bit#(1) in);
53 wrtwi{0}_scl_outen<=in;
55 method scl{0}_in=wrtwi{0}_scl_in;
58 # ============================================== #