0d2305d057ed9c7797f9cb77c502d7c4291b34eb
2 # === templates for interface definitions ====== #
3 mux_interface_def
= '''
4 method Action cell{0}_mux (Bit#(''' + str(N_MUX
) + ''') in );
9 method io_outputval_{0}=cell{0}_out.outputval;
10 method io_output_en_{0}=cell{0}_out.output_en;
11 method io_input_en_{0}=cell{0}_out.input_en;
12 method io_pullup_en_{0}=cell{0}_out.pullup_en;
13 method io_pulldown_en_{0}=cell{0}_out.pulldown_en;
14 method io_drivestrength_{0}=cell{0}_out.drivestrength;
15 method io_pushpull_en_{0}=cell{0}_out.pushpull_en;
16 method io_opendrain_en_{0}=cell{0}_out.opendrain_en;
17 method Action io_inputval_{0}(Bit#(1) in);
21 uartinterface_def
= '''
22 method rx_{0}=wruart{0}_rx;
23 method Action tx_{0}(Bit#(1) in);
27 spiinterface_def
= '''
28 method Action sclk_{0} (Bit#(1) in);
31 method Action mosi_{0} (Bit#(1) in);
34 method Action ss_{0} (Bit#(1) in);
37 method Bit#(1) miso_{0}=wrspi{0}_miso;
40 twiinterface_def
= '''
42 method Action sda{0}_out (Bit#(1) in);
45 method Action sda{0}_outen (Bit#(1) in);
46 wrtwi{0}_sda_outen<=in;
48 method sda{0}_in=wrtwi{0}_sda_in;
50 method Action scl{0}_out (Bit#(1) in);
53 method Action scl{0}_outen (Bit#(1) in);
54 wrtwi{0}_scl_outen<=in;
56 method scl{0}_in=wrtwi{0}_scl_in;
59 # ============================================== #