blob: e0b69887fcb844e1f0ec53facc8e8a50cd7fe584 (
plain)
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
|
ENTITY test IS
END ENTITY test;
ARCHITECTURE rtl OF test IS
TYPE test_type_t IS (
TEST_1,
TEST_2);
TYPE test_type_value_t IS ARRAY (test_type_t) OF natural;
CONSTANT C_TEST_TYPE_VALUE : test_type_value_t := (
TEST_1 => 0,
TEST_2 => 1);
CONSTANT C_TEST_TYPE_TEST_1 : natural := C_TEST_TYPE_VALUE(TEST_1);
CONSTANT C_TEST_TYPE_TEST_2 : natural := C_TEST_TYPE_VALUE(TEST_2);
FUNCTION get_priority (
arg : natural)
RETURN natural IS
VARIABLE result_v : natural;
BEGIN
CASE arg IS
WHEN C_TEST_TYPE_TEST_1 =>
result_v := 3;
WHEN C_TEST_TYPE_TEST_2 =>
result_v := 0;
WHEN OTHERS =>
REPORT "Unknown Sector Type"
SEVERITY error;
result_v := 4;
END CASE;
RETURN result_v;
END FUNCTION get_priority;
BEGIN
END ARCHITECTURE rtl;
|