Opel_Corsa
Member level 1
I am working on a CPU control unit, and my code is giving me ridiculous errors. Here's the part of the code in question (excluding the entity part):
The error messages are:
The reason why I can't see why it's giving these errors is that, my if-then statements are all correctly stated and I don't see anything wrong with them! Any help is greatly appreciated.
P.S> I'm not sure if using "if (m = LOAD)" would be a correct syntax. Is it?[/code]
Code:
architecture behavioural of controlunit is
...
type mnemonic is (ADD, MOV, SUB, LOAD, MUL, ANDD, NEG);
signal m : mnemonic;
type state_type is (T1, T2, T3);
signal t : state_type;
-- Mnemonic definition
with instruction_in(15 downto 11) select
m <= ADD when "10001",
MOV when "11000",
SUB when "10010",
LOAD when "01000",
MUL when "10101",
ANDD when "10111",
NEG when "11010";
-- 3 State types
67 if (m = LOAD) then
68 t <= T1;
69 elsif (m = MOV or m = NEG) then
70 t <= T2;
71 else
72 t <= T3;
73 end if;
...
end behavioural;
Error (10500): VHDL syntax error at controlunit.vhd(67) near text "if"; expecting "end", or "(", or an identifier ("if" is a reserved keyword), or a concurrent statement,
Error (10500): VHDL syntax error at controlunit.vhd(67) near text "then"; expecting "<="
Error (10500): VHDL syntax error at controlunit.vhd(69) near text "elsif"; expecting "end", or "(", or an identifier ("elsif" is a reserved keyword), or a concurrent statement,
Error (10500): VHDL syntax error at controlunit.vhd(69) near text "then"; expecting "<="
Error (10500): VHDL syntax error at controlunit.vhd(71) near text "else"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a concurrent statement,
Error (10500): VHDL syntax error at controlunit.vhd(73) near text "if"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture"
The reason why I can't see why it's giving these errors is that, my if-then statements are all correctly stated and I don't see anything wrong with them! Any help is greatly appreciated.
P.S> I'm not sure if using "if (m = LOAD)" would be a correct syntax. Is it?[/code]