Instant SoC Class Library  3.1
FC_System_EventManager Class Reference

Multi Event Manager. More...

Inheritance diagram for FC_System_EventManager:
FC_Base

Public Member Functions

int GetEvent ()
 

Detailed Description

Multi Event Manager.

This class manage all events that are available in the system. All classes that generates events like timers are supported.
This is best shown using the following example:

// This example shows how to use FC_System_Timer, FC_System_EventManager and FC_IO_Pulse.
// Three timers are started.
#include "fc_io.h"
#include "fc_system.h"
int main()
{
//% hw_begin
FC_IO_Clk clk(100);
FC_IO_Pulse p3(0b1); // Inverted
//% hw_end
enum EVENTS { Event1, Event2, Event3}; // Define events id
t1.Start(2, TU_us, Event1); // Event1 @ every 2 us
t2.Start(4, TU_us, Event2); // Event2 @ every 4 us
t3.Start(6, TU_us, Event3); // Event3 @ every 6 us
for (;;)
{
switch( em.GetEvent() ) { // Wait for event
case Event1: // 50 Clk pulse
p1.Pulse(50,TU_clk);
break;
case Event2: // 150 Clk pulse
p2.Pulse(150,TU_clk);
break;
case Event3: // 150 Clk inverted pulse
p3.Pulse(150,TU_clk);
break;
}
}
}

This example will give the following result:

FC_System_EventManager
Multi Event Manager.
Definition: fc_system.h:55
FC_IO_Clk
System clock input.
Definition: fc_io.h:55
FC_IO_Pulse
Asynchronous pulse std_logic output.
Definition: fc_io.h:172
FC_System_Timer
Timer.
Definition: fc_system.h:78