Hello again Andreas, It seems I have been a bit too pessimistic on first time, there *is* a "mod" operator defined in IEEE1076.2-1996 (VHDL Mathematical Packages).
However, the package provided with GHDL lacks it, so a good start would be to enter a request/bug fix there: https://gna.org/support/?func=additem&group=ghdl The official declaration is (taken from IEEE Std): function "MOD"(X, Y: in REAL ) return REAL; -- Purpose: -- Returns floating point modulus of X/Y, with the same sign as -- Y, and absolute value less than the absolute value of Y, and -- for some INTEGER value N the result satisfies the relation -- X = Y*N + MOD(X,Y) -- Special values: -- None -- Domain: -- X in REAL; Y in REAL and Y /= 0.0 -- Error conditions: -- Error if Y = 0.0 -- Range: -- ABS(MOD(X,Y)) < ABS(Y) -- Notes: -- None As a workaround, I propose you to compile the attached file inside the ieee_proposed library which will provide the stuff, and add the line: use IEEE_PROPOSED.math_real_fmod.all; in the 'fixed_pkg_c.vhdl'. Hope this will help you, Regards, Chris. On Monday 27 August 2007 17:19, Chris wrote: > Hello Andreas, > > I had a quick look on my side, and the lines are doing this: > > [real] <= [real] mod [real] > > but the "mod" operator does not exist for reals. I will try to check > tomorrow in the IEEE reference, but I don't think there is such operator to > be defined in "math_real" package. > > If this code has ever been compiled somewhere, I suppose that the tool used > made an implicit conversion (to integer, which I doubt, or...?) > > Regards, > Chris. > > On Sunday 26 August 2007 17:37, Andreas Schwarz wrote: > > Hi, > > > > I can't compile fixed_pkg (VHDL-93 compatible version from > > http://www.vhdl.org/vhdl-200x/vhdl-200x-ft/packages/fixed_pkg_c.vhdl) > > with GHDL: > > > > $ ghdl -a --work=ieee_proposed math_utility_pkg.vhdl > > $ ghdl -a --work=ieee_proposed fixed_pkg_c.vhdl > > fixed_pkg_c.vhdl:4493:28: no function declarations for operator "mod" > > fixed_pkg_c.vhdl:4548:29: no function declarations for operator "mod" > > /usr/lib/ghdl/bin/ghdl: compilation error > > $ ghdl -v > > GHDL 0.25 (20060811) [Sokcho edition] > > > > > > Any ideas how to fix this? > > > > Thanks > > Andreas > > > > > > _______________________________________________ > > Ghdl-discuss mailing list > > Ghdl-discuss@gna.org > > https://mail.gna.org/listinfo/ghdl-discuss > > _______________________________________________ > Ghdl-discuss mailing list > Ghdl-discuss@gna.org > https://mail.gna.org/listinfo/ghdl-discuss
WORKAROUND-MATH_REAL-FMOD.vhdl
Description: Binary data
_______________________________________________ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss