(* always_ready, always_enabled *)
interface RS232_PHY_Ifc;
- (* always_ready, always_enabled *) method Action modem_input(bit srx, bit cts, bit dsr, bit ri, bit dcd);
- method bit modem_output_stx;
- method bit modem_output_rts;
- method bit modem_output_dtr;
+ interface Get#(Bit#(1)) srx_in;
+ interface Get#(Bit#(1)) cts_in;
+ interface Get#(Bit#(1)) dsr_in;
+ interface Get#(Bit#(1)) ri_in;
+ interface Get#(Bit#(1)) dcd_in;
+ interface Put#(Bit#(1)) stx_out;
+ interface Put#(Bit#(1)) rts_out;
+ interface Put#(Bit#(1)) dtr_out;
endinterface
endrule
*/
interface RS232_PHY_Ifc coe_rs232;
- method Action modem_input(bit srx, bit cts, bit dsr, bit ri, bit dcd);
- pin_srx_sync <= srx; // RX Input
- pin_cts_sync <= cts; // CTS Input
- pin_dsr_sync <= dsr; // Data Set Ready indicating that MODEM is ready to establish the communication
- pin_ri_sync <= ri; // Ring Indicator indicate that a telephone ringing signal has been recieved by the MODEM
- pin_dcd_sync <= dcd; // Data carrier detect
- endmethod
- method bit modem_output_stx = pin_stx; // Tx output
- method bit modem_output_rts = pin_rts; // RTS output
- method bit modem_output_dtr = pin_dtr; // Data Terminal Ready output
+
+ interface srx_in = interface Put
+ method Action put(Bit#(1) in);
+ pin_srx_sync <= in; // RX Input
+ endmethod
+ endinterface;
+
+ interface cts_in = interface Put
+ method Action put(Bit#(1) in);
+ pin_cts_sync <= in; // CTS Input
+ endmethod
+ endinterface;
+
+ interface dsr_in = interface Put
+ method Action put(Bit#(1) in);
+ pin_dsr_sync <= in; // Data Set Ready indicating that MODEM is ready
+ // to establish the communication
+ endmethod
+ endinterface;
+
+ interface ri_in = interface Put
+ method Action put(Bit#(1) in);
+ pin_ri_sync <= in; // Ring Indicator indicate that a telephone ringing
+ //signal has been recieved by the MODEM
+ endmethod
+ endinterface;
+
+ interface dcd_in = interface Put
+ method Action put(Bit#(1) in);
+ pin_dcd_sync <= in; // Data carrier detect
+ endmethod
+ endinterface;
+
+ interface stx_out = interface Get
+ method ActionValue#(Bit#(1)) get;
+ return pin_stx; // Tx output
+ endmethod
+ endinterface;
+
+ interface rts_out = interface Get
+ method ActionValue#(Bit#(1)) get;
+ return pin_rts; // RTS output
+ endmethod
+ endinterface;
+
+ interface dtr_out = interface Get
+ method ActionValue#(Bit#(1)) get;
+ return pin_dtr; // Data Terminal Ready output
+ endmethod
+ endinterface;
+
endinterface
interface slave_axi_uart = s_xactor.axi_side;