W elcome to
Fintronic USA

#### Third party tools integrated with FinSim(Specman, Denali, Debussy, Undertow, Vera, VirSim, HDL Score, Comet, Meteor, NelSim, Pivot, DeskPOD, @Designer 2.1)

Inverting 47x47 Pascal Matrix in Verilog

This example shows how to invert a 47x47 Pascal Matrice with variable precision elements. Larger Pascal Matrices need larger mantissa!

Note: this code runs on FinSim 10.0.0 or subsequent versions, which are available upon request from Fintronic USA. On a laptop with core i7 atr 2.4GHz, this example completed in 5.86 sec.

module top;
`include "finsimmath.h"
parameter SIZE = 47;
VpDescriptor d1;

VpReg  [0:180] AV[SIZE-1:0][SIZE-1:0];
VpReg [0:180] v;

initial begin
\$VpSetDescriptorInfo(d1, 12, 168, `FLOATING,
`TO_NEAREST_INTEGER_IF_TIE_TO_MINUS_INF,
`SATURATION+`WARNING, 1);
\$VpSetDefaultOptions(12, 168, `FLOATING,
`TO_NEAREST_INTEGER_IF_TIE_TO_MINUS_INF,
`SATURATION+`WARNING, 1);
\$VpAssocDescrToData(AV,  d1);
\$VpAssocDescrToData(v, d1);

\$InitM(AV, ((\$I1 == 0) ? 1 : ((\$I2 == 0) ? 1 : (AV[\$I1-1][\$I2] +  AV[\$I1][\$I2-1]))));

v = AV[SIZE-1][SIZE-1];
\$display("last = %y\n", v);

AV = AV ** (-1);
// PrintM(AV, "y");
AV = AV ** (-1);
v = AV[SIZE-1][SIZE-1];
\$display("last = %y\n", v);
end
endmodule