Is this a bug?

I get a compile error but its reported in the s file generated by ghdl
- The s file is created but it is then processed by the assembler,
/usr/bin/as which flags an error in the s file.


I am using a binary distribution show below:

[gbea...@wt0433 generic_lib]$ ghdl --version
GHDL 0.29 (20100109) [Sokcho edition]
 Compiled with GNAT Version: GPL 2008 (20080521)
 GCC back-end code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2010 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[gbea...@wt0433 generic_lib]$


My gcc version is 4.1.2 (but I would think that that shouldn't matter
for the binary distribution).


In the example below, one of the base vhdl files (attached) is
compiled by itself and produces errors.

[gbea...@wt0433 generic_lib]$ ghdl -a -g -v --workdir=work
--work=wavesat --ieee=synopsys std_functions_pkg.vhd
/usr/local/libexec/gcc/i686-pc-linux-gnu/4.3.4/ghdl1 -g --workdir=work
--work=wavesat -P/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.4/vhdl/lib//v93/std/
-P/usr/local/lib/gcc/i686-pc-linux-gnu/4.3.4/vhdl/lib//v93/synopsys/
-quiet -o work/std_functions_pkg.s std_functions_pkg.vhd
/usr/bin/as -o work/std_functions_pkg.o work/std_functions_pkg.s
work/std_functions_pkg.s: Assembler messages:
work/std_functions_pkg.s:131: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:208: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:259: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:300: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:328: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:360: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:392: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:718: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:744: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:970: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:1202: Error: suffix or operands invalid for `push'
work/std_functions_pkg.s:1397: Error: suffix or operands invalid for `push'
ghdl: compilation error


Thanks,
Greg

library IEEE;
use IEEE.std_logic_1164.all;
-- synopsys translate_off

use IEEE.std_logic_textio.all;
library STD;
use STD.textio.all;
-- synopsys translate_on


package std_functions_pkg is 
	
	----------------------------------------
	--	exponential function 
	--		returns : base**exponent
	--
	--	07/03/01 : submitted by Erick Delage 
	----------------------------------------
	function exp(constant base : integer; constant exponent : integer) return integer ;	
	
	
	----------------------------------------
	--	logarithmic function 
	--		returns : log    (value)
	--					 base
	--
	--	07/03/01 : submitted by Erick Delage
	----------------------------------------
	function log(constant base : integer range 2 to integer'high ; constant value : integer range 0 to integer'high) return integer ;
	
	----------------------------------------
	--	maximum function 
	--		returns : the greatest of two integers
	--
	--	07/03/01 : submitted by Erick Delage
	----------------------------------------
	function max (constant int_a : integer; constant int_b : integer) return integer;
	
	----------------------------------------
	--	minimum function 
	--		returns : the smallest of two integers
	--
	--	07/03/01 : submitted by Erick Delage
	----------------------------------------
	function min (constant int_a : integer; constant int_b : integer) return integer;
	
	----------------------------------------
	--	Mirror Image function 
	--		returns : a vector with inverse bit setting while keeping the same range definition
	--
	--		ex: a(3 downto 0) <= "1100"; b(7 downto 0)<= inverse_range(a) ---> b = "0011"
	--
	--	07/03/01 : submitted by Erick Delage
	----------------------------------------
	function mirror_image (input_v : std_logic_vector) return std_logic_vector;
	
	
	----------------------------------------
	--	logarithmic function 
	--		returns : minimum log    (value) to contain value
	--				             base
	--
	--	May/09/03 : submitted by Greg Beaton
	----------------------------------------
	function min_log(constant base : integer range 2 to integer'high ; constant value : integer range 0 to integer'high) return integer ;
	
	---------------------------------------- 
	-- Return a 1 if boolean is true else return a 0
	--
	--	Feb/27/04 : submitted by Greg Beaton
	----------------------------------------
	function is_true (arg : boolean) return integer;

	
	-- synopsys translate_off
	
	---------------------------------------- 
	-- Convert to hex string function
	--	returns a string containing the hex representation of a vector that must be hex aligned 
	--
	--	May/17/02 : submitted by Greg Beaton
	----------------------------------------
	function conv_hexstring (vec : std_logic_vector) return string;
	
	---------------------------------------- 
	-- Convert to octal string function
	--	returns a string containing the octal representation of a vector that must be octal aligned 
	--
	--	May/17/02 : submitted by Greg Beaton
	----------------------------------------
	function conv_octstring (vec : std_logic_vector) return string;
	
	---------------------------------------- 
	-- Convert to bin string function
	--	returns a string containing the binary representation of a vector that must be bit aligned 
	--
	--	May/17/02 : submitted by Greg Beaton
	----------------------------------------
	function conv_binstring (vec : std_logic_vector) return string;	
	
	-- synopsys translate_on
	
end std_functions_pkg;

package body std_functions_pkg is
	
	
	function exp(constant base : integer; constant exponent : integer) return integer is
		variable exp_out : integer;
	begin	
		exp_out := 0;
		for I in 0 to exponent loop
			if (I = 0) then
				exp_out := 1;
			else
				exp_out := base*exp_out;
			end if;
		end loop;
		return exp_out;
	end exp;
	
	
	function log(constant base : integer range 2 to integer'high ; constant value : integer range 0 to integer'high) return integer is
		variable value_out : integer;
	begin 
		if (value >= base) then
			value_out := log(base, value/base) + 1;
		else
			value_out := 0;
		end if;
		
		return value_out;
	end log;
	
	
	-- GB: May/08/03
	-- This function is intended to find the minimum number of a digits to represent a number in the given base.
	-- Why would you want to do that?!
	-- For example, The minimum vector width of binary address for a given depth of memory.
	function min_log(constant base : integer range 2 to integer'high ; constant value : integer range 0 to integer'high) return integer is
		variable value_out : integer;
	begin 
		value_out := log(base, value - 1) + 1;	
		
		return value_out;
	end min_log;
	
	
	function max (constant int_a : integer; constant int_b : integer) return integer is
		variable out_tmp : integer;
	begin
		if (int_a > int_b) then
			out_tmp := int_a;
		else
			out_tmp := int_b;
		end if;
		return out_tmp;
	end max;
	
	
	function min (constant int_a : integer; constant int_b : integer) return integer is
		variable out_tmp : integer;
	begin
		if (int_a < int_b) then
			out_tmp := int_a;
		else
			out_tmp := int_b;
		end if;
		return out_tmp;
	end min;
	
	function mirror_image (input_v : std_logic_vector) return std_logic_vector is
		variable vector : std_logic_vector (input_v'range);
	begin
		for I in 0 to input_v'high - input_v'low loop
			vector(input_v'high-I) := input_v(input_v'low+I);
		end loop;
		return vector;
	end mirror_image;  
	
	function is_true (arg : boolean) return integer is
	begin
		if arg then
			return 1;
		else
			return 0;
		end if;
	end is_true;
	
	
	
	
	-- synopsys translate_off
	
	function conv_hexstring (vec : std_logic_vector) return string is
		variable text_buffer : LINE;
		variable text : string (1 to vec'length/4);
		variable test : boolean;
	begin
		HWRITE(text_buffer,vec,RIGHT,vec'length/4);
		READ(text_buffer,text,test);
		return text;
	end conv_hexstring;
	
	function conv_octstring (vec : std_logic_vector) return string is
		variable text_buffer : LINE;
		variable text : string (1 to vec'length/3);
		variable test : boolean;
	begin
		OWRITE(text_buffer,vec,RIGHT,vec'length/3);
		READ(text_buffer,text,test);
		return text;
	end conv_octstring;
	
	function conv_binstring (vec : std_logic_vector) return string is
		variable text_buffer : LINE;
		variable text : string (1 to vec'length);
		variable test : boolean;
	begin
		WRITE(text_buffer,vec,RIGHT,vec'length);
		READ(text_buffer,text,test);
		return text;
	end conv_binstring;			  
	
	-- synopsys translate_on
	
end std_functions_pkg;

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to