Instant SoC Class Library  3.1
FC_IO_In Class Reference

Logic input. More...

Inheritance diagram for FC_IO_In:
FC_Base

Public Member Functions

 FC_IO_In (U32 width=1)
 
U32 GetIn ()
 Read signal. The signal value is copied to the least significant bits.
 
 operator U32 ()
 Read signal. The signal value is copied to the least significant bits.
 

Detailed Description

Logic input.

Adds to interface:
if width = 1 then
<name> : in std_logic
if width > 1 then
<name> : in 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;
}
}
}


Constructor & Destructor Documentation

◆ FC_IO_In()

FC_IO_In::FC_IO_In ( U32  width = 1)
inline

Constructor

Parameters
widthWidth of the input signal. Must be in range 1 to 32.
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