fix bugs with queue inlining; inline gate queue as well
This commit is contained in:
@@ -39,9 +39,7 @@ function Group.addwire(group, wire)
|
||||
Wire.setgroup(wire, group)
|
||||
Wire.update(wire)
|
||||
|
||||
if group.in_queue==0 then
|
||||
Simulation.queuegroup(GSim, group)
|
||||
end
|
||||
Simulation.queuegroup_safe(GSim, group)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -98,7 +96,7 @@ function Group.addport(group, port)
|
||||
group.nout_ports = group.nout_ports + 1
|
||||
group.state_num = group.state_num + Port.getstate(port)
|
||||
|
||||
Simulation.queuegroup(GSim, group)
|
||||
Simulation.queuegroup_safe(GSim, group)
|
||||
|
||||
elseif port.type == PortTypes.input then
|
||||
if group.in_ports[port] then error("port already in group") end
|
||||
@@ -106,7 +104,7 @@ function Group.addport(group, port)
|
||||
group.in_ports[port] = port
|
||||
group.nin_ports = group.nin_ports + 1
|
||||
|
||||
Simulation.queuegate(GSim, Port.getgate(port))
|
||||
Simulation.queuegate_safe(GSim, Port.getgate(port))
|
||||
|
||||
end
|
||||
|
||||
@@ -124,7 +122,7 @@ function Group.removeport(group, port)
|
||||
|
||||
group.state_num = group.state_num - Port.getstate(port)
|
||||
|
||||
Simulation.queuegroup(GSim, group)
|
||||
Simulation.queuegroup_safe(GSim, group)
|
||||
|
||||
elseif port.type == PortTypes.input then
|
||||
if not group.in_ports[port] then error("port not in group") end
|
||||
@@ -132,7 +130,7 @@ function Group.removeport(group, port)
|
||||
group.in_ports[port] = nil
|
||||
group.nin_ports = group.nin_ports - 1
|
||||
|
||||
Simulation.queuegate(GSim, Port.getgate(port))
|
||||
Simulation.queuegate_safe(GSim, Port.getgate(port))
|
||||
end
|
||||
|
||||
Group.rebuild_ports(group)
|
||||
@@ -185,7 +183,10 @@ function Group.setstate(group, state)
|
||||
|
||||
local len = group.num_gates_update
|
||||
for i = 1, len do
|
||||
Simulation.queuegate(sim, group.gates_update[i])
|
||||
local gate = group.gates_update[i]
|
||||
if gate.in_queue==0 then
|
||||
Simulation.queuegate(sim, gate)
|
||||
end
|
||||
end
|
||||
|
||||
Simulation.queuegroupfx(sim, group)
|
||||
|
||||
Reference in New Issue
Block a user