make net tqueue use c structs
This commit is contained in:
		| @@ -58,8 +58,9 @@ function Gate.setportstate(gate, index, state) | |||||||
| 		gate.port_states[index] = state | 		gate.port_states[index] = state | ||||||
| 		 | 		 | ||||||
| 		if ((gate.port_net_state_num[index][0]>0) ~= (gate.port_net_state[index][0]==1)) and (gate.port_net_in_queue[index][0]==0) then | 		if ((gate.port_net_state_num[index][0]>0) ~= (gate.port_net_state[index][0]==1)) and (gate.port_net_in_queue[index][0]==0) then | ||||||
| 			local group = gate.port_nets[index] | 			local net = gate.port_nets[index] | ||||||
| 			Simulation.queuegroup(GSim, group) | 			local cnet = net.c | ||||||
|  | 			Simulation.queuegroup_c(GSim, cnet) | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| end | end | ||||||
|   | |||||||
| @@ -284,10 +284,15 @@ function Simulation.queuegateinit(sim, gate) | |||||||
| end | end | ||||||
|  |  | ||||||
| -- Logic Critical | -- Logic Critical | ||||||
| function Simulation.queuegroup(sim, net) | function Simulation.queuegroup_c(sim, cnet) | ||||||
| 	sim.groupqueue[sim.num_groupqueue+1] = net | 	sim.groupqueue[sim.num_groupqueue+1] = cnet | ||||||
| 	sim.num_groupqueue = sim.num_groupqueue + 1 | 	sim.num_groupqueue = sim.num_groupqueue + 1 | ||||||
| 	net.in_queue[0] = 1 | 	cnet.in_queue[0] = 1 | ||||||
|  | end | ||||||
|  |  | ||||||
|  | function Simulation.queuegroup(sim, net) | ||||||
|  | 	local cnet = net.c | ||||||
|  | 	Simulation.queuegroup_c(sim, cnet) | ||||||
| end | end | ||||||
|  |  | ||||||
| function Simulation.queuegroup_safe(sim, group) | function Simulation.queuegroup_safe(sim, group) | ||||||
| @@ -298,7 +303,7 @@ end | |||||||
|  |  | ||||||
| function Simulation.dequeuegroup(sim, group) | function Simulation.dequeuegroup(sim, group) | ||||||
| 	if group.in_queue[0]~=0 then | 	if group.in_queue[0]~=0 then | ||||||
| 		array_remove(sim.groupqueue, group, true) | 		array_remove(sim.groupqueue, group.c, true) | ||||||
| 		sim.num_groupqueue = sim.num_groupqueue - 1 | 		sim.num_groupqueue = sim.num_groupqueue - 1 | ||||||
| 		group.in_queue[0] = 0 | 		group.in_queue[0] = 0 | ||||||
| 	end | 	end | ||||||
| @@ -330,8 +335,7 @@ end | |||||||
| -- Logic Critical | -- Logic Critical | ||||||
| function Simulation.ticklogic(sim) | function Simulation.ticklogic(sim) | ||||||
| 	for i = 1, sim.num_groupqueue do | 	for i = 1, sim.num_groupqueue do | ||||||
| 		local net = sim.groupqueue[i] | 		local cnet = sim.groupqueue[i] | ||||||
| 		local cnet = net.c |  | ||||||
| 		Group.update_c(cnet, sim.current_tick) | 		Group.update_c(cnet, sim.current_tick) | ||||||
| 		cnet.in_queue[0] = 0 | 		cnet.in_queue[0] = 0 | ||||||
| 		sim.groupqueue[i] = nil | 		sim.groupqueue[i] = nil | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo