Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
import "primitives/flopoco/def.fil";
import "primitives/math/float.fil";
/// Floating point addition with Flopoco's internal format
comp FFTFPAdd[E, M]<'G:1>(
X: ['G, 'G+1] W,
Y: ['G, 'G+1] W,
) -> (
R: ['G+L, 'G+L+1] W,
) with {
some W where W > 0;
some L where L >= 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
FA := new FPAdd[E, M];
fa := FA<'G>(X, Y);
R = fa.R;
L := FA::L;
}
}
/// Floating point addition with Flopoco's internal format
comp FFTFPSub[E, M]<'G:1>(
X: ['G, 'G+1] W,
Y: ['G, 'G+1] W,
) -> (
R: ['G+L, 'G+L+1] W,
) with {
some W where W > 0;
some L where L >= 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
FS := new FPSub[E, M];
fs := FS<'G>(X, Y);
R = fs.R;
L := FS::L;
}
}
/// Floating point multiplication with Flopoco's internal format
comp FFTFPMult[E, M]<'G: 1>(
X: ['G, 'G+1] W,
Y: ['G, 'G+1] W,
) -> (
R: ['G+L, 'G+L+1] W,
) with {
some W where W > 0;
some L where L >= 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
FM := new FPMult[E, M];
fm := FM<'G>(X, Y);
R = fm.R;
L := FM::L;
}
}
/// Converts an IEEE floating point number to Flopoco internal format
comp FFTInputIEEE[E, M]<'G:1>(
X: ['G, 'G+1] WidthIEEE
) -> (
R: ['G+L, 'G+L+1] W
) with {
let WidthIEEE = E + M + 1;
some W where W > 0;
some L where L == 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
IE := new InputIEEE[E, M, E, M];
ie := IE<'G>(X);
R = ie.R;
L := IE::L;
}
}
/// Converts a Flopoco internal format floating point number to IEEE
comp FFTOutputIEEE[E, M]<'G:1>(
X: ['G, 'G+1] W
) -> (
R: ['G+L, 'G+L+1] WidthIEEE
) with {
some W where W > 0;
let WidthIEEE = E + M + 1;
some L where L == 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
IE := new OutputIEEE[E, M, E, M];
ie := IE<'G>(X);
R = ie.R;
L := IE::L;
}
}
/// Converts a Flopoco internal format floating point number to IEEE
comp FFTFPNeg[E, M]<'G:1>(
X: ['G, 'G+1] W
) -> (
R: ['G+L, 'G+L+1] W
) with {
some W where W > 0;
some L where L == 0;
} where
E > 0,
M > 0
{
let T = 0;
if T == 0 {
W := E + M + 3;
FN := new FPNeg[E, M];
fn := FN<'G>(X);
R = fn.R;
L := 0;
}
}70914e6feThis file is pinned to the selected release. Download the original to open it in your design tool.