Changes between Version 9 and Version 10 of Writing Rules/Tlmt


Ignore:
Timestamp:
Dec 25, 2007, 4:53:50 PM (16 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Tlmt

    v9 v10  
    242242= E) Interconnection network modeling =
    243243
    244 = F) Interruption modeling =
     244= F) Interrupt modeling =
    245245
    246246Interrupts are asynchronous events that are not transported by the VCI network.
     
    263263== F.2) Destination modeling ==
    264264
    265 In the Parallel Discrete Event Simulation, the pessimistic approach suppose that any PDES can update his local time only when he knows that all messages received on the input ports have dates larger than his local time.
    266 Therefore, a SC_THRED modeling a
     265The destination module (named here '''my_processor''') must contain a member variable '''p_irq''' of type
     266'''!IrqInPortt''', and a call-back function (named here '''irqReceived()''' that is executed when an interrupt packet is received on the '''p_irq''' port.
     267
     268A link between the '''p_irq''' port and the call-back function mus be established by the port constructor in the constructor of the class '''my_processor''' :
     269{{{
     270p_irq(“irq”, this, &my_processor::irqReceived),
     271}}}
     272
     273In the Parallel Discrete Event Simulation, the pessimistic approach suppose that any PDES process can update his local time only when he has received messages  on all input ports with dates larger than his local time.
     274Therefore, a SC_THREAD modeling the behavior of a module containing an '''!IrqInPort''' should in principle wait a dated packet on this port before executing instruction and updating the local time. Such behavior would be very inefficient, and could create dead-lock situations.
     275
     276The recommended policy for handling interrupts is the following:
     277 * The call-back function '''irqReceived()''' sets the member variables '''m_irqpending''' and '''m_irqtime''', when a interrupt packet is received on the '''p_irq''' port.
     278 * The '''execLoop()''' thread must test the '''m_irqpending''' variable at each cycle (i.e. in each iteration of the infinite loop).
     279 * If there is no interrupt pending, the thread continues execution. If an interrupt is pending, and the interrupt date is larger than the local time, the thread continues execution. If the interrupt date is equal or smaller than the local time, the interrupt is handled.
     280
     281Such violation of the the pessimistic parallel simulation create a loss of accuracy on the interrupt handling date. This inaccuracy in the TLM-T simulation is acceptable, as interrupts are asynchronous events, and the timing error is bounded by the '''m_lookahead''' parameter.
    267282
    268283== F.3)  Processor with interrupt example ==