Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   VHDL (http://www.velocityreviews.com/forums/f18-vhdl.html)
-   -   Simple ALU Implementation (http://www.velocityreviews.com/forums/t644366-simple-alu-implementation.html)

andrew_ross 11-13-2008 08:46 PM

Simple ALU Implementation
 
Hi guys,
I have to implement a simple ALU of a 32bit mips..I have already implemented many submodules (adder,multipliers,shifter...) ,that I have to instantiate in the top level module "ALU_TOP". This module receives as input 2 op. (a , b) and a 6bit signal OPCODE on which basis the differents modules are instantiates.

My problem is checking the signal OPCODE directly in the architecture (not in a process , and after begin of arch.). I used that solution because using a process returned me errors reusing the components (and portamaps...)
But now I cannot even check the OPCODE ("If not allowed..")..(I double checked parenthesis or typos..)...

what should I do? Do I have to use a process? But how to use different modules within a process?

I paste the simple part of the code .. and this not work..
Code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity alu_top is
       
generic (N:integer:=32);
               
    Port ( A : in  STD_LOGIC_VECTOR(N-1 downto 0);
          B : in  STD_LOGIC_VECTOR(N-1 downto 0);
          OPCODE : in  STD_LOGIC_VECTOR(5 downto 0);
          FUNCT : in  STD_LOGIC_VECTOR(5 downto 0);
          COND : out  STD_LOGIC;
          ALUOut : out  STD_LOGIC_VECTOR(N-1 downto 0)
                          );
end alu_top;

architecture Behavioral of alu_top is

component multiplier_s_u is

        generic(N:integer:=16);

    Port ( A : in  STD_LOGIC_VECTOR(N-1 downto 0);
          B : in  STD_LOGIC_VECTOR(N-1 downto 0);
          SIGN : in  STD_LOGIC;--signed/unsigned selector
          M : out  STD_LOGIC_VECTOR((2*N)-1 downto 0));--output da 32 bit
end component multiplier_s_u;


begin


if OPCODE="000000"  then
cond<='0';
               
end if;

end Behavioral;

ERROR:HDLParsers:164 - "F:/Poli/SDSS/MyProjects/MIPS/alu_top.vhd" Line 50. parse error, unexpected IF

Thanks in advance


All times are GMT. The time now is 03:00 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57