Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL AND operator usage " no function declarations for operator "and""

Status
Not open for further replies.

giorgi3092

Junior Member level 2
Joined
Jul 31, 2021
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
251
I have the following code:

Code:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
USE IEEE.STD_LOGIC_MISC.ALL;

ENTITY hazard_unit_forwards IS
    PORT (
        i_Rs1E, i_Rs2E : IN STD_LOGIC_VECTOR(4 downto 0);
        i_RdM, i_RdW : IN STD_LOGIC_VECTOR(4 downto 0);
        i_RegWriteM, i_RegWriteW : IN STD_LOGIC;
        o_ForwardAE, o_ForwardBE : OUT STD_LOGIC_VECTOR(1 downto 0)         -- forward A and B to execute stage
    );
END;

ARCHITECTURE behave OF hazard_unit_forwards IS

BEGIN
    -- forwarding logic for Rs1E
    PROCESS(i_Rs1E, i_RdM, i_RdW, i_RegWriteM, i_RegWriteW) BEGIN
        IF(((i_Rs1E = i_RdM) AND i_RegWriteM) AND (i_Rs1E /= "00000")) THEN     -- forward from memory stage
            o_ForwardAE <= "10";
        ELSIF (((i_Rs1E = i_RdW) AND i_RegWriteW) AND (i_Rs1E /= "00000")) THEN -- forward from writeback stage
            o_ForwardAE <= "01";
        ELSE                -- no forwarding (use RF output)
            o_ForwardAE <= "00";
        END IF;
    END PROCESS;
    
    -- forwarding logic for Rs2E
    PROCESS(i_Rs2E, i_RdM, i_RdW, i_RegWriteM, i_RegWriteW) BEGIN
        IF(((i_Rs2E = i_RdM) AND i_RegWriteM) AND (i_Rs2E /= "00000")) THEN     -- forward from memory stage
            o_ForwardBE <= "10";
        ELSIF (((i_Rs2E = i_RdW) AND i_RegWriteW) AND (i_Rs2E /= "00000")) THEN -- forward from writeback stage
            o_ForwardBE <= "01";
        ELSE                -- no forwarding (use RF output)
            o_ForwardBE <= "00";
        END IF;
    END PROCESS;
END;

Having Verilog background, VHDL types is giving me a PTSD, and I am sure it's the problem with types, but can't figure out what is wrong.


GHDL gives me the following errors:

Code:
hazard_unit_forwards.vhd:20:37:error: no function declarations for operator "and"
hazard_unit_forwards.vhd:22:41:error: no function declarations for operator "and"
hazard_unit_forwards.vhd:31:37:error: no function declarations for operator "and"
hazard_unit_forwards.vhd:33:41:error: no function declarations for operator "and"

So, what is wrong?

(the lines are basically everywhere AND operator is used in the code)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top