Instant SoC Class Library  3.1
FC_IO_Out Class Reference

Logic output. More...

Inheritance diagram for FC_IO_Out:
FC_Base

Public Member Functions

 FC_IO_Out (U32 width=1, U32 inital=0x00000000)
 
FC_IO_Outoperator= (const U32 v)
 
void SetOut (const U32 d)
 

Detailed Description

Logic output.

Adds to interface:
if width = 1 then
<name> : out std_logic
if width > 1 then
<name> : out std_logic_vector(width-1 downto 0)
where <name> is c++ object name.
Any number of instances are allowed.

// This is an example that show how to use the FC_IO_Out and FC_IO_In classes.
// When x changes the busy signal goes high and the square root is calculated.
// When the result is ready busy goes low.
#include <math.h>
#include "fc_io.h"
#include "fc_system.h"
int main()
{
//% hw_begin
FC_IO_Clk clk(100);
FC_IO_Out y(32);
FC_IO_In x(32);
FC_IO_Out busy;
//% hw_end
int previous_x=0;
for (;;)
{
if(previous_x != x ) {
busy = 0x1;
y = int( sqrtf( x ) );
previous_x = x;
busy = 0x0;
}
}
}


FC_IO_Clk
System clock input.
Definition: fc_io.h:55
FC_IO_In
Logic input.
Definition: fc_io.h:94
FC_IO_Out
Logic output.
Definition: fc_io.h:126