From 97ae8936e7b7c0eb4a39bbfe6b3460c0c5ee6b4c Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 17 Sep 2019 20:27:41 +0200 Subject: [PATCH 1/4] style: merge vunit/vhdl/data_types/src/types/* into vunit/vhdl/data_types/src/types.vhd --- vunit/builtins.py | 1 - .../src/{types/integer_vector_pkg.vhd => types.vhd} | 6 ++++++ vunit/vhdl/data_types/src/types/string_pkg.vhd | 11 ----------- 3 files changed, 6 insertions(+), 12 deletions(-) rename vunit/vhdl/data_types/src/{types/integer_vector_pkg.vhd => types.vhd} (73%) delete mode 100644 vunit/vhdl/data_types/src/types/string_pkg.vhd diff --git a/vunit/builtins.py b/vunit/builtins.py index 0f7c6e7de..377e57064 100644 --- a/vunit/builtins.py +++ b/vunit/builtins.py @@ -72,7 +72,6 @@ def _add_data_types(self): """ Add data types packages """ - self._add_files(join(VHDL_PATH, "data_types", "src", "types", "*.vhd")) self._add_files(join(VHDL_PATH, "data_types", "src", "*.vhd")) def _add_array_util(self): diff --git a/vunit/vhdl/data_types/src/types/integer_vector_pkg.vhd b/vunit/vhdl/data_types/src/types.vhd similarity index 73% rename from vunit/vhdl/data_types/src/types/integer_vector_pkg.vhd rename to vunit/vhdl/data_types/src/types.vhd index 3cbab03ea..901aaa933 100644 --- a/vunit/vhdl/data_types/src/types/integer_vector_pkg.vhd +++ b/vunit/vhdl/data_types/src/types.vhd @@ -4,6 +4,12 @@ -- -- Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com +package string_pkg is + type string_access_t is access string; + type string_access_vector_t is array (natural range <>) of string_access_t; + type string_access_vector_access_t is access string_access_vector_t; +end package; + package integer_vector_pkg is type integer_vector_t is array (natural range <>) of integer; type integer_vector_access_t is access integer_vector_t; diff --git a/vunit/vhdl/data_types/src/types/string_pkg.vhd b/vunit/vhdl/data_types/src/types/string_pkg.vhd deleted file mode 100644 index 55be22bab..000000000 --- a/vunit/vhdl/data_types/src/types/string_pkg.vhd +++ /dev/null @@ -1,11 +0,0 @@ --- This Source Code Form is subject to the terms of the Mozilla Public --- License, v. 2.0. If a copy of the MPL was not distributed with this file, --- You can obtain one at http://mozilla.org/MPL/2.0/. --- --- Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com - -package string_pkg is - type string_access_t is access string; - type string_access_vector_t is array (natural range <>) of string_access_t; - type string_access_vector_access_t is access string_access_vector_t; -end package; From d4a51912d7a070ddbc483022820eae4114eca729 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 19 Sep 2019 22:27:30 +0200 Subject: [PATCH 2/4] merge string_pkg and integer_vector_pkg into types_pkg --- vunit/vhdl/data_types/src/integer_vector_ptr_pkg.vhd | 3 +-- vunit/vhdl/data_types/src/string_ptr_pkg.vhd | 3 +-- vunit/vhdl/data_types/src/types.vhd | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/vunit/vhdl/data_types/src/integer_vector_ptr_pkg.vhd b/vunit/vhdl/data_types/src/integer_vector_ptr_pkg.vhd index b61337c19..f90fa0f77 100644 --- a/vunit/vhdl/data_types/src/integer_vector_ptr_pkg.vhd +++ b/vunit/vhdl/data_types/src/integer_vector_ptr_pkg.vhd @@ -11,8 +11,7 @@ -- into a singleton datastructure of integer vector access types. -- -use work.integer_vector_pkg.all; - +use work.types_pkg.all; use work.codec_pkg.all; use work.codec_builder_pkg.all; diff --git a/vunit/vhdl/data_types/src/string_ptr_pkg.vhd b/vunit/vhdl/data_types/src/string_ptr_pkg.vhd index 19d2381a6..17ac7ef83 100644 --- a/vunit/vhdl/data_types/src/string_ptr_pkg.vhd +++ b/vunit/vhdl/data_types/src/string_ptr_pkg.vhd @@ -10,8 +10,7 @@ -- into a singleton datastructure of string access types. -- -use work.string_pkg.all; - +use work.types_pkg.all; use work.codec_pkg.all; use work.codec_builder_pkg.all; diff --git a/vunit/vhdl/data_types/src/types.vhd b/vunit/vhdl/data_types/src/types.vhd index 901aaa933..e99381fbc 100644 --- a/vunit/vhdl/data_types/src/types.vhd +++ b/vunit/vhdl/data_types/src/types.vhd @@ -4,13 +4,11 @@ -- -- Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com -package string_pkg is +package types_pkg is type string_access_t is access string; type string_access_vector_t is array (natural range <>) of string_access_t; type string_access_vector_access_t is access string_access_vector_t; -end package; -package integer_vector_pkg is type integer_vector_t is array (natural range <>) of integer; type integer_vector_access_t is access integer_vector_t; type integer_vector_access_vector_t is array (natural range <>) of integer_vector_access_t; From 1b6a8d3350398119f1e33bd141b6bfe194cd4879 Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 19 Sep 2019 22:35:46 +0200 Subject: [PATCH 3/4] move definition of byte_t to types_pkg --- vunit/vhdl/data_types/src/types.vhd | 2 ++ vunit/vhdl/verification_components/src/memory_pkg.vhd | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vunit/vhdl/data_types/src/types.vhd b/vunit/vhdl/data_types/src/types.vhd index e99381fbc..7e0667320 100644 --- a/vunit/vhdl/data_types/src/types.vhd +++ b/vunit/vhdl/data_types/src/types.vhd @@ -5,6 +5,8 @@ -- Copyright (c) 2014-2019, Lars Asplund lars.anders.asplund@gmail.com package types_pkg is + subtype byte_t is integer range 0 to 255; + type string_access_t is access string; type string_access_vector_t is array (natural range <>) of string_access_t; type string_access_vector_access_t is access string_access_vector_t; diff --git a/vunit/vhdl/verification_components/src/memory_pkg.vhd b/vunit/vhdl/verification_components/src/memory_pkg.vhd index eb4675be4..959e6cea1 100644 --- a/vunit/vhdl/verification_components/src/memory_pkg.vhd +++ b/vunit/vhdl/verification_components/src/memory_pkg.vhd @@ -9,12 +9,15 @@ library ieee; use ieee.std_logic_1164.all; -use work.integer_vector_ptr_pkg.all; +use work.types_pkg.all; use work.string_ptr_pkg.all; +use work.integer_vector_ptr_pkg.all; use work.logger_pkg.all; package memory_pkg is + alias byte_t is byte_t; + type endianness_arg_t is (little_endian, big_endian, default_endian); @@ -51,7 +54,6 @@ package memory_pkg is ----------------------------------------------------- -- Memory data read and write functions ----------------------------------------------------- - subtype byte_t is integer range 0 to 255; procedure write_byte(memory : memory_t; address : natural; byte : byte_t); From f6d497568d4c9a0e63770ef891c4b52bbe7420cb Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 20 Sep 2019 10:29:43 +0200 Subject: [PATCH 4/4] do not alias byte_t --- vunit/vhdl/verification_components/src/memory_pkg.vhd | 2 -- vunit/vhdl/verification_components/test/tb_memory.vhd | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/vunit/vhdl/verification_components/src/memory_pkg.vhd b/vunit/vhdl/verification_components/src/memory_pkg.vhd index 959e6cea1..f8394643a 100644 --- a/vunit/vhdl/verification_components/src/memory_pkg.vhd +++ b/vunit/vhdl/verification_components/src/memory_pkg.vhd @@ -16,8 +16,6 @@ use work.logger_pkg.all; package memory_pkg is - alias byte_t is byte_t; - type endianness_arg_t is (little_endian, big_endian, default_endian); diff --git a/vunit/vhdl/verification_components/test/tb_memory.vhd b/vunit/vhdl/verification_components/test/tb_memory.vhd index 02c5190d5..754b8302c 100644 --- a/vunit/vhdl/verification_components/test/tb_memory.vhd +++ b/vunit/vhdl/verification_components/test/tb_memory.vhd @@ -10,6 +10,7 @@ use ieee.std_logic_1164.all; library vunit_lib; context vunit_lib.vunit_context; +use work.types_pkg.byte_t; use work.memory_pkg.all; use work.string_ptr_pkg.all; use work.random_pkg.all;