make in_queue int tptre
This commit is contained in:
@@ -6,7 +6,7 @@ Gate = {}
|
||||
function Gate.new(objref, definition)
|
||||
local gate = {
|
||||
-- Logic Critical
|
||||
in_queue = ffi.new("int"),
|
||||
in_queue = ffi.new("int[1]"),
|
||||
port_states = ffi.new("int["..(#definition.ports+1).."]"),
|
||||
logic = definition.logic,
|
||||
ports = {},
|
||||
@@ -27,10 +27,11 @@ end
|
||||
function Gate.setportstate(gate, index, state)
|
||||
if state ~= gate.port_states[index] then
|
||||
local group = gate.port_nets[index]
|
||||
local net_state_num = gate.port_net_state_nums[index]
|
||||
group.state_num = group.state_num - gate.port_states[index] + state
|
||||
gate.port_states[index] = state
|
||||
|
||||
if ((group.state_num>0) ~= (group.state==1)) and (group.in_queue==0) then
|
||||
if ((group.state_num>0) ~= (group.state==1)) and (group.in_queue[0]==0) then
|
||||
Simulation.queuegroup(GSim, group)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user