From 1b7915de4c7b915984e3c34619dd22065e15b0e7 Mon Sep 17 00:00:00 2001 From: Redo Date: Thu, 17 Sep 2020 18:14:57 -0500 Subject: [PATCH] update gate interface for new protected port functionality --- sim/gate.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sim/gate.lua b/sim/gate.lua index d40fe2c..a7e2e14 100644 --- a/sim/gate.lua +++ b/sim/gate.lua @@ -16,10 +16,30 @@ function Gate:addport(port) port.gate = self end +function Gate:getportstate(index) + return self.ports[index].state +end + function Gate:setportstate(index, state) self.ports[index]:setstate(state) end +function Gate:initdata() + self.data = {} +end + +function Gate:getdata() + return self.data +end + +function Gate:getportisrising(index) + return self.ports[index]:isrising() +end + +function Gate:getportisfalling(index) + return self.ports[index]:isfalling() +end + -- function Gate:cb(...) -- local args = {...} -- local str = tostring(#args)