Esterel Homework 1
Due Wednesday, June 28, by email.
You have to write a model of a microwave oven. The system should have the following signals:
Inputs
- T : present every second that elapses
- D : door open (present at every instant when the door is open)
- I : increment cooking time by 5 seconds.
- H : halt (but keep the remaining time)
- C : clear: stop cooking and reset the time to 0
- S : start cooking (issued after entering the time)
- N(n) : signal of type ingeter, such that ?N tells you the amount of time for which the user has requested cooking.
Output
- M : microwaves on
- B : ring the bell (ding!)
- D : of type integer: emit D(6) writes that there are 6 more seconds to go
- F : flashes the display to indicate that the cooking has paused
Behavior
To cook, users can set the time via N, then press S to start cooking. Another way is to press I, which increments the time by 5. If I has been pressed, the microwave waits up to 4 seconds to see if another I will be pressed. If so, the time is incremented even more (and the microwave begins another cycle of 4-second waiting). If no I follows within 4 seconds, then the microwave starts cooking automatically.
Cooking can be stopped with H and restarted with S. While the microwave is stopped, the display must be flashed via the F signal.
If the door is opened, cooking halts as if H was pressed.
When cooking finishes, the bell rings, and the time is reset to 0.
If H is pressed, cooking stops and the time is reset to 0.
This gives you the main features of the model; for the rest, use your experience of microwaves!
Deliverables
Please email a copy of your solution to me. I will both read the solution, and test it in the Esterel simulator, so please make sure that the code compiles, otherwise, you lose at least half the credit (as I cannot simulate the code).
