VHDL STD_LOGIC_VECTOR Substitution Values

I am trying to write a final state machine in VHDL code for a simple 16-bit processor that I implement on an Altera DE1 board. In the final state machine, I have an operator CASEthat processes various 16-bit instructions that are given in FSM by 16-bit STD_LOGIC_VECTOR. However, I have small problems in the decoding state, where the final state machine decodes the instruction. One of the instructions is ADD, which accepts two registers as operands, and the third as the destination register. However, I also have an ADD command that takes a register and a 5-bit instantaneous value as operands and a second register for the destination. My problem is that in the instructionsCASEI need to distinguish between two different ADD instructions. Thus, I thought that if I use wildcard values ​​such as "-" or "X" in the instructions CASE, I would be able to distinguish between them with only two cases, rather than listing all possible registry / immediate value combinations, For example:

    CASE IR IS --(IR stands for "Instruction Register")
      WHEN "0001------0-----" => (Go to 3-register add);
      WHEN "0001------1-----" => (Go to 2-register/immediate value add);
      WHEN OTHERS => (Do whatever);
    END CASE;

These are not the only two instructions that I have, I just put the two in order to make this post a little shorter. When I compile and run this code, the processor stops execution when it enters the "decoding" state. In addition, Quartus gives many warnings about things like VHDL Selection Warning in LC3FSM.vhd (37): ignored selection containing meta value "" 0001 ------ 0 ----- "" "I do not I understand how to do it. I REALLY do not want and probably should not define every 16-bit combination, and I hope that there is a way to use wildcards in STD_LOGIC_VECTOR to minimize the number of combinations that I will need to define.

Does anyone know how to do this?

thank

+5
2

, , , . ( , reset, ?)

.

,

if IR(15 downto 12) == "0001" then
    IR := IR_in(15 downto 12) & "0000000" & IR_in(5) & "00000";
else
    IR := IR_in
end if;

CASE IR IS --(IR stands for "Instruction Register")
  WHEN "0001000000000000" => (Go to 3-register add);
  WHEN "0001000000100000" => (Go to 2-register/immediate value add);
  WHEN OTHERS => (Do whatever);
END CASE;

, ( - ?), case .

+1

. = case . , std_logic , - , (, and or).

VHDL-2008 case case?, , - VHDL 2008. , VHDL 2008 ?=, - s.

, VHDL 2008, . std_match, VHDL, , , case .

+5

All Articles