Guest
At the moment it is a little bit raw.
It´s my first try to program in VHDL.
See the lines below.
The architecture includes the following two lines.
I get the error message "Signal is not defined 'the_enigma'.
It is declared as shared variable.
So what is wrong ?
It is better to declare all ports only as std_logic or
std_logic_vector ?
Or is it also ok to use bit or character ?
Good night
the_enigma.alphabet := alphabet;
the_enigma.chars := alphabet'length;
library IEEE;
library STD;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_TEXTIO.ALL;
-- Don´t use this two one
-- use IEEE.STD_LOGIC_ARITH.ALL;
-- use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Instead use this
use IEEE.numeric_std.all;
entity enigma is
generic (wheel_one : in integer := 3; stepsize_one : in
integer := 2; start_one : in integer := 1;
wheel_two : in integer := 5; stepsize_two : in integer := 3;
start_two : in integer := 1;
wheel_three : in integer := 7; stepsize_three : in integer := 1;
start_three : in integer := 1);
port (input : in std_logic; output : out std_logic; mode : in
bit);
-- The wheel type
subtype char_index is integer range 0 to 30;
type wheel_string is array (char_index'left to char_index'right) of
character;
subtype wheel_index is integer range 0 to 11;
type wheel_array is array (wheel_index'left to wheel_index'right) of
wheel_string;
-- The rotor type
type rotor_type is
record
wheel_number : wheel_index;
wheel : wheel_string;
start : char_index;
stepsize : char_index;
position : char_index;
end record;
-- The rotor array
type rotor_array is array (0 to 2) of rotor_type;
-- The enigma type
type enigma_type is
record
chars : integer;
alphabet : wheel_string;
rotor : rotor_array;
end record;
-- This is the only global variable
-- Must be declared as "shared" to use it global
shared variable the_enigma : enigma_type;
end enigma;
It´s my first try to program in VHDL.
See the lines below.
The architecture includes the following two lines.
I get the error message "Signal is not defined 'the_enigma'.
It is declared as shared variable.
So what is wrong ?
It is better to declare all ports only as std_logic or
std_logic_vector ?
Or is it also ok to use bit or character ?
Good night
the_enigma.alphabet := alphabet;
the_enigma.chars := alphabet'length;
library IEEE;
library STD;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_TEXTIO.ALL;
-- Don´t use this two one
-- use IEEE.STD_LOGIC_ARITH.ALL;
-- use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Instead use this
use IEEE.numeric_std.all;
entity enigma is
generic (wheel_one : in integer := 3; stepsize_one : in
integer := 2; start_one : in integer := 1;
wheel_two : in integer := 5; stepsize_two : in integer := 3;
start_two : in integer := 1;
wheel_three : in integer := 7; stepsize_three : in integer := 1;
start_three : in integer := 1);
port (input : in std_logic; output : out std_logic; mode : in
bit);
-- The wheel type
subtype char_index is integer range 0 to 30;
type wheel_string is array (char_index'left to char_index'right) of
character;
subtype wheel_index is integer range 0 to 11;
type wheel_array is array (wheel_index'left to wheel_index'right) of
wheel_string;
-- The rotor type
type rotor_type is
record
wheel_number : wheel_index;
wheel : wheel_string;
start : char_index;
stepsize : char_index;
position : char_index;
end record;
-- The rotor array
type rotor_array is array (0 to 2) of rotor_type;
-- The enigma type
type enigma_type is
record
chars : integer;
alphabet : wheel_string;
rotor : rotor_array;
end record;
-- This is the only global variable
-- Must be declared as "shared" to use it global
shared variable the_enigma : enigma_type;
end enigma;