Instant SoC Class Library  3.1
FC_IO_Pulse Class Reference

Asynchronous pulse std_logic output. More...

Inheritance diagram for FC_IO_Pulse:
FC_Base

Public Member Functions

 FC_IO_Pulse (U32 inital=0x00000000)
 
void Pulse (const U32 width, TimeUnits tu=TU_clk)
 

Detailed Description

Asynchronous pulse std_logic output.

Adds to interface:
<name> : out std_logic
where <name> is c++ object name.
Any number of instances are allowed.
The pulse value is logic not of the inital value
The pulse is asynchronous i.e. the funcion Pulse return immediately

// 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