more optimizations: move port states into gates, inline net queue checks
This commit is contained in:
@@ -5,13 +5,8 @@ Group = {}
|
||||
|
||||
function Group.new()
|
||||
local o = {
|
||||
--state = ffi.new("long long", 0),
|
||||
state = 0,
|
||||
--state_num = ffi.new("long long", 0),
|
||||
state_num = 0,
|
||||
--in_queue = ffi.new("bool", false),
|
||||
--in_queue = false,
|
||||
--in_queue = ffi.new("long long", 0),
|
||||
in_queue = 0,
|
||||
gates_update = {},
|
||||
num_gates_update = 0,
|
||||
@@ -44,7 +39,9 @@ function Group.addwire(group, wire)
|
||||
Wire.setgroup(wire, group)
|
||||
Wire.update(wire)
|
||||
|
||||
Simulation.queuegroup(GSim, group)
|
||||
if group.in_queue==0 then
|
||||
Simulation.queuegroup(GSim, group)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -186,11 +183,9 @@ function Group.setstate(group, state)
|
||||
group.state = state
|
||||
group.update_tick = sim.current_tick
|
||||
|
||||
--for k, gate in ipairs(group.gates_update) do
|
||||
local len = group.num_gates_update
|
||||
for i = 1, len do
|
||||
local gate = group.gates_update[i]
|
||||
Simulation.queuegate(sim, gate)
|
||||
Simulation.queuegate(sim, group.gates_update[i])
|
||||
end
|
||||
|
||||
Simulation.queuegroupfx(sim, group)
|
||||
|
||||
Reference in New Issue
Block a user