I'm trying to implement an interactive digital simulator using SystemC. The user can place switches, gates etc. and can simulate the circuit.
I have some problem with switches. Assume there is a circuit containing a "clock" an "and gate" and a "switch". The switch can switch from the H and L states to the output. By default it is low state, when the user press the switch its output goes to the high state. The and gate's inputs connected to the clock and to the switch. The circuit is converted to its SystemC representation (except the switch). The simulation runs endless, because of the clock.
How to handle pressing the switch in the SystemC engine? I assume I have to send an event manually to the kernel. How to do that?
Im running the SystemC simulation through a dll (the SystemC representation of the circuit is compiled to a dll).