Miscellany
public lua v1 · immutableGateActions["wom"] = { group = "Memory", name = "Write Only Memory", inputs = { "Clk", "AddrWrite", "Data" } output = function( gate, Clk, AddrWrite, Data ) AddrWrite = math.floor(tonumber(AddrWrite)) if ( Clk > 0 ) then if ( AddrWrite >= 0 ) and ( AddrWrite < 4 ) then gate.LatchStore[AddrWrite] = Data end end end, reset = function( gate ) gate.LatchStore = {} for i = 0, 3 do gate.LatchStore[i] = 0 end end, label = function() return "Write Only Memory - 4 store" end}