From a79131d550ab1207bd8535f7c682e3e66a7785e3 Mon Sep 17 00:00:00 2001 From: Neel Date: Mon, 23 Jul 2018 10:13:05 +0530 Subject: [PATCH] modify rs232 to get/put interface --- src/peripherals/uart/RS232_modified.bsv | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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; -- 2.30.2