From: Neel Date: Mon, 23 Jul 2018 04:43:05 +0000 (+0530) Subject: modify rs232 to get/put interface X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a79131d550ab1207bd8535f7c682e3e66a7785e3;p=shakti-peripherals.git modify rs232 to get/put interface --- diff --git a/src/peripherals/uart/RS232_modified.bsv b/src/peripherals/uart/RS232_modified.bsv index ca336d9..6de7a91 100644 --- a/src/peripherals/uart/RS232_modified.bsv +++ b/src/peripherals/uart/RS232_modified.bsv @@ -93,11 +93,9 @@ typedef enum { (* always_ready, always_enabled *) interface RS232; // Inputs - (* prefix = "" *) - method Action sin((* port = "SIN" *)Bit#(1) x); + interface Put#(Bit#(1)) sin; // Outputs - (* prefix = "", result = "SOUT" *) - method Bit#(1) sout(); + interface Get#(Bit#(1)) sout; endinterface interface BaudGenerator; @@ -704,8 +702,16 @@ module mkUART( Bit#(4) charsize /// Interface Connections / Methods //////////////////////////////////////////////////////////////////////////////// interface RS232 rs232; - method sout = rXmitDataOut; - method sin = rRecvData._write; + interface sin = interface Put + method Action put(Bit#(1) in); + rRecvData._write(in); + endmethod + endinterface; + interface sout = interface Get + method ActionValue#(Bit#(1)) get; + return rXmitDataOut; + endmethod + endinterface; endinterface interface Get tx;