A
A. Kong
Hi,all,
Here is the part of code which defines the arhitecture of a fetch unit:
=====================================================================
architecture behavioral of fetch is
type type_instruction_array is array(0 to 31) of std_logic_vector(31
downto 0);
begin
process
-- local variable used as a PC internally
variable PC : std_logic_vector(31 downto 0);
variable iaddr : integer := 0;
variable imem : type_instruction_array;
begin
....
====================================================================
In the process i want to convert the PC to an integer
I have tried the following statements:
iaddr := to_integer(PC);
iaddr := to_integer( To_bitvector(PC));
iaddr := to_integer(unsigned(PC));
I got this error messages:
to_integer can
not have such operands in this context.
Well, I am not sure what is wrong here. I was following 4.2.25 of VHDL
Faq1. Is my understanding wrong?
Cheers,
AK
Here is the part of code which defines the arhitecture of a fetch unit:
=====================================================================
architecture behavioral of fetch is
type type_instruction_array is array(0 to 31) of std_logic_vector(31
downto 0);
begin
process
-- local variable used as a PC internally
variable PC : std_logic_vector(31 downto 0);
variable iaddr : integer := 0;
variable imem : type_instruction_array;
begin
....
====================================================================
In the process i want to convert the PC to an integer
I have tried the following statements:
iaddr := to_integer(PC);
iaddr := to_integer( To_bitvector(PC));
iaddr := to_integer(unsigned(PC));
I got this error messages:
to_integer can
not have such operands in this context.
Well, I am not sure what is wrong here. I was following 4.2.25 of VHDL
Faq1. Is my understanding wrong?
Cheers,
AK