code refactoring

This commit is contained in:
Greek 2021-12-06 19:42:02 +01:00
parent 4420a62d63
commit 70549853d5
16 changed files with 90 additions and 88 deletions

3
.gitignore vendored
View File

@ -18,11 +18,12 @@
#***QUARTUS*** #***QUARTUS***
#Project File #Project File
!*.qpf !*.qpf
!*.qsf
#Settings File #Settings File
!*.qsf !*.qsf
#QSYS File #QSYS File
!*.qsys !*.qsys
#Constraint File
!*.sdc
#Unignore VHDL Files in syn Directory First Level #Unignore VHDL Files in syn Directory First Level
!/syn/*.vhd !/syn/*.vhd

View File

@ -15,13 +15,15 @@ entity FWFT_FIFO is
-- SYSTEM -- SYSTEM
clk : in std_logic; clk : in std_logic;
reset : in std_logic; reset : in std_logic;
-- INPUT
data_in : in std_logic_vector(DATA_WIDTH-1 downto 0); full : out std_logic;
write : in std_logic; write : in std_logic;
data_in : in std_logic_vector(DATA_WIDTH-1 downto 0);
-- OUTPUT
empty : out std_logic;
read : in std_logic; read : in std_logic;
data_out : out std_logic_vector(DATA_WIDTH-1 downto 0); data_out : out std_logic_vector(DATA_WIDTH-1 downto 0);
empty : out std_logic; -- MISC
full : out std_logic;
free : out natural range 0 to FIFO_DEPTH free : out natural range 0 to FIFO_DEPTH
); );
end entity; end entity;

View File

@ -8,7 +8,7 @@ use ieee.numeric_std.all;
use work.rtps_package.all; use work.rtps_package.all;
use work.rtps_config_package.all; use work.rtps_config_package.all;
entity Type2_reader_wrapper is entity TYPENAME_reader_wrapper is
port ( port (
-- SYSTEM -- SYSTEM
clk : in std_logic; clk : in std_logic;
@ -25,8 +25,8 @@ entity Type2_reader_wrapper is
get_data_dds : out std_logic; get_data_dds : out std_logic;
done_dds : in std_logic; done_dds : in std_logic;
return_code_dds : in std_logic_vector(RETURN_CODE_WIDTH-1 downto 0); return_code_dds : in std_logic_vector(RETURN_CODE_WIDTH-1 downto 0);
ready_in_dds : out std_logic;
valid_in_dds : in std_logic; valid_in_dds : in std_logic;
ready_in_dds : out std_logic;
data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_in_dds : in std_logic; last_word_in_dds : in std_logic;
-- Sample Info -- Sample Info
@ -87,13 +87,13 @@ entity Type2_reader_wrapper is
); );
end entity; end entity;
architecture arch of Type2_reader_wrapper is architecture arch of TYPENAME_reader_wrapper is
--*****TYPE DECLARATION***** --*****TYPE DECLARATION*****
-- FSM states. Explained below in detail -- FSM states. Explained below in detail
type STAGE_TYPE is (IDLE,GET_PAYLOAD_HEADER,FETCH,ALIGN_STREAM,SKIP_PAYLOAD,DECODE_PAYLOAD); type STAGE_TYPE is (IDLE,GET_PAYLOAD_HEADER,FETCH,ALIGN_STREAM,SKIP_PAYLOAD,DECODE_PAYLOAD);
-- ###GENERATED START### -- ###GENERATED START###
type DECODE_STAGE_TYPE is (GET_OPTIONAL_HEADER); type DECODE_STAGE_TYPE is (TODO,GET_OPTIONAL_HEADER);
-- TYPES DECLARATIONS -- TYPES DECLARATIONS
-- ###GENERATED END### -- ###GENERATED END###

View File

@ -10,10 +10,16 @@ use work.rtps_package.all;
package user_config is package user_config is
--*****USER CONFIG***** --*****USER CONFIG*****
-- NOTE: All strings have to be padded to 256 characters -- NOTE: All strings have to be padded to 256 characters
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.80] -- Period of system clock
constant CLOCK_PERIOD : time := 50 ns;
-- Maximum number of supported remote Participants (Affects generated Memory Size)
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
-- Maximum number of supported remote Endpoints (Affects generated Memory Size)
constant MAX_REMOTE_ENDPOINTS : natural := 50;
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.128]
constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80080"; constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80080";
-- Number of RTPS Writer Endpoints -- Number of RTPS Writer Endpoints
constant NUM_WRITERS : natural := 0; constant NUM_WRITERS : natural := 0;
@ -44,11 +50,13 @@ package user_config is
--***RTPS ENDPOINTS*** --***RTPS ENDPOINTS***
-- Array denoting if Endpoints use Keyed Topics -- Array denoting if Endpoints use Keyed Topics
constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE); constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE);
-- Array denoting which mode the Endpoints are operating with
constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRUE);
-- Array mapping Topic Names to Endpoints -- Array mapping Topic Names to Endpoints
constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Placeholder" & (12 to 256 => NUL)); constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Placeholder" & (12 to 256 => NUL));
-- Array mapping Type Names to Endpoints -- Array mapping Type Names to Endpoints
constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Placeholder" & (12 to 256 => NUL)); constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Placeholder" & (12 to 256 => NUL));
-- *TIMING CHARACTERISTICS* -- *TIMING CHARACTERISTICS*
-- Timing Characteristics for Participant -- Timing Characteristics for Participant
constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(30,0); -- 30 s constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(30,0); -- 30 s
@ -72,6 +80,7 @@ package user_config is
--***ENDPOINT DDS QOS*** --***ENDPOINT DDS QOS***
-- Array mapping DURABILITY QoS to Endpoints -- Array mapping DURABILITY QoS to Endpoints
constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_QOS); constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_QOS);
-- Array mapping DURABILITY SERVICE QoS to Endpoints
constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY); constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY); constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH); constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH);
@ -120,10 +129,6 @@ package user_config is
constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY);
constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY);
-- NOTE: The buffer will not only store participants, but also endpoint data
-- Used to determine the size of the builtin endpoint buffer
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
-- Set to TRUE for Simulation Testing (Extra Code generated) -- Set to TRUE for Simulation Testing (Extra Code generated)
constant SIMULATION_FLAG : boolean := FALSE; constant SIMULATION_FLAG : boolean := FALSE;
end package; end package;

View File

@ -8,7 +8,7 @@ use ieee.numeric_std.all;
use work.rtps_package.all; use work.rtps_package.all;
use work.rtps_config_package.all; use work.rtps_config_package.all;
entity Type2_writer_wrapper is entity TYPENAME_writer_wrapper is
generic ( generic (
LITTLE_ENDIAN : std_logic := '0' LITTLE_ENDIAN : std_logic := '0'
); );
@ -26,12 +26,12 @@ entity Type2_writer_wrapper is
done_dds : in std_logic; done_dds : in std_logic;
return_code_dds : in std_logic_vector(RETURN_CODE_WIDTH-1 downto 0); return_code_dds : in std_logic_vector(RETURN_CODE_WIDTH-1 downto 0);
instance_handle_in_dds : in INSTANCE_HANDLE_TYPE; instance_handle_in_dds : in INSTANCE_HANDLE_TYPE;
ready_out_dds : in std_logic;
valid_out_dds : out std_logic; valid_out_dds : out std_logic;
ready_out_dds : in std_logic;
data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0); data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_out_dds : out std_logic; last_word_out_dds : out std_logic;
ready_in_dds : out std_logic;
valid_in_dds : in std_logic; valid_in_dds : in std_logic;
ready_in_dds : out std_logic;
data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_in_dds : in std_logic; last_word_in_dds : in std_logic;
-- Communication Status -- Communication Status
@ -58,7 +58,7 @@ entity Type2_writer_wrapper is
); );
end entity; end entity;
architecture arch of Type2_writer_wrapper is architecture arch of TYPENAME_writer_wrapper is
--*****TYPE DECLARATION***** --*****TYPE DECLARATION*****
-- FSM states. Explained below in detail -- FSM states. Explained below in detail

View File

@ -7,10 +7,16 @@ use work.rtps_package.all;
package user_config is package user_config is
--*****USER CONFIG***** --*****USER CONFIG*****
-- NOTE: All strings have to be padded to 256 characters -- NOTE: All strings have to be padded to 256 characters
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.81] -- Period of system clock
constant CLOCK_PERIOD : time := 50 ns;
-- Maximum number of supported remote Participants (Affects generated Memory Size)
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
-- Maximum number of supported remote Endpoints (Affects generated Memory Size)
constant MAX_REMOTE_ENDPOINTS : natural := 50;
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.129]
constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80081"; constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80081";
-- Number of RTPS Writer Endpoints -- Number of RTPS Writer Endpoints
constant NUM_WRITERS : natural := 1; constant NUM_WRITERS : natural := 1;
@ -41,23 +47,13 @@ package user_config is
--***RTPS ENDPOINTS*** --***RTPS ENDPOINTS***
-- Array denoting if Endpoints use Keyed Topics -- Array denoting if Endpoints use Keyed Topics
constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRUE);
0 => TRUE
);
-- Array denoting which mode the Endpoints are operating with -- Array denoting which mode the Endpoints are operating with
constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRUE);
0 => TRUE
);
-- Array mapping Topic Names to Endpoints -- Array mapping Topic Names to Endpoints
constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Topic1" & (7 to 256 => NUL));
0 => "Topic1" & (7 to 256 => NUL)
);
-- Array mapping Type Names to Endpoints -- Array mapping Type Names to Endpoints
constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Type1" & (6 to 256 => NUL));
0 => "Type1" & (6 to 256 => NUL)
);
-- *TIMING CHARACTERISTICS* -- *TIMING CHARACTERISTICS*
-- Timing Characteristics for Participant -- Timing Characteristics for Participant
constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(0,50000); -- 50k ns constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(0,50000); -- 50k ns
@ -81,6 +77,7 @@ package user_config is
--***ENDPOINT DDS QOS*** --***ENDPOINT DDS QOS***
-- Array mapping DURABILITY QoS to Endpoints -- Array mapping DURABILITY QoS to Endpoints
constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRANSIENT_LOCAL_DURABILITY_QOS); constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRANSIENT_LOCAL_DURABILITY_QOS);
-- Array mapping DURABILITY SERVICE QoS to Endpoints
constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY); constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY); constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH); constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH);
@ -129,10 +126,6 @@ package user_config is
constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY);
constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY);
-- TESTING PARAMETERS
constant TEST_STRING : string := "TEST_CONFIG_2";
-- Set to TRUE for Simulation Testing (Extra Code generated) -- Set to TRUE for Simulation Testing (Extra Code generated)
constant SIMULATION_FLAG : boolean := TRUE; constant SIMULATION_FLAG : boolean := TRUE;
end package; end package;

View File

@ -7,10 +7,16 @@ use work.rtps_package.all;
package user_config is package user_config is
--*****USER CONFIG***** --*****USER CONFIG*****
-- NOTE: All strings have to be padded to 256 characters -- NOTE: All strings have to be padded to 256 characters
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.82] -- Period of system clock
constant CLOCK_PERIOD : time := 50 ns;
-- Maximum number of supported remote Participants (Affects generated Memory Size)
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
-- Maximum number of supported remote Endpoints (Affects generated Memory Size)
constant MAX_REMOTE_ENDPOINTS : natural := 50;
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.130]
constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80082"; constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80082";
-- Number of RTPS Writer Endpoints -- Number of RTPS Writer Endpoints
constant NUM_WRITERS : natural := 0; constant NUM_WRITERS : natural := 0;
@ -41,23 +47,15 @@ package user_config is
--***RTPS ENDPOINTS*** --***RTPS ENDPOINTS***
-- Array denoting if Endpoints use Keyed Topics -- Array denoting if Endpoints use Keyed Topics
constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRUE);
0 => TRUE
);
-- Array denoting which mode the Endpoints are operating with -- Array denoting which mode the Endpoints are operating with
constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRUE);
0 => TRUE
);
-- Array mapping Topic Names to Endpoints -- Array mapping Topic Names to Endpoints
constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Topic1" & (7 to 256 => NUL));
0 => "Topic1" & (7 to 256 => NUL)
);
-- Array mapping Type Names to Endpoints -- Array mapping Type Names to Endpoints
constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => "Type1" & (6 to 256 => NUL));
0 => "Type1" & (6 to 256 => NUL)
);
-- *TIMING CHARACTERISTICS* -- *TIMING CHARACTERISTICS*
-- Timing Characteristics for Participant -- Timing Characteristics for Participant
constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(0,50000); -- 50k ns constant PARTICIPANT_ANNOUNCEMENT_PERIOD : DURATION_TYPE := gen_duration(0,50000); -- 50k ns
@ -81,6 +79,7 @@ package user_config is
--***ENDPOINT DDS QOS*** --***ENDPOINT DDS QOS***
-- Array mapping DURABILITY QoS to Endpoints -- Array mapping DURABILITY QoS to Endpoints
constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRANSIENT_LOCAL_DURABILITY_QOS); constant ENDPOINT_DURABILITY_QOS : USER_ENUMERATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => TRANSIENT_LOCAL_DURABILITY_QOS);
-- Array mapping DURABILITY SERVICE QoS to Endpoints
constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY); constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY); constant ENDPOINT_DURABILITY_SERVICE_HISTORY : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY);
constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH); constant ENDPOINT_DURABILITY_SERVICE_HISTORY_DEPTH : USER_LONG_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_DURABILITY_SERVICE_HISTORY_DEPTH);
@ -129,10 +128,6 @@ package user_config is
constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY);
constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY);
-- TESTING PARAMETERS
constant TEST_STRING : string := "TEST_CONFIG_2";
-- Set to TRUE for Simulation Testing (Extra Code generated) -- Set to TRUE for Simulation Testing (Extra Code generated)
constant SIMULATION_FLAG : boolean := TRUE; constant SIMULATION_FLAG : boolean := TRUE;
end package; end package;

View File

@ -7,10 +7,16 @@ use work.rtps_package.all;
package user_config is package user_config is
--*****USER CONFIG***** --*****USER CONFIG*****
-- NOTE: All strings have to be padded to 256 characters -- NOTE: All strings have to be padded to 256 characters
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.80] -- Period of system clock
constant CLOCK_PERIOD : time := 50 ns;
-- Maximum number of supported remote Participants (Affects generated Memory Size)
constant MAX_REMOTE_PARTICIPANTS : natural := 50;
-- Maximum number of supported remote Endpoints (Affects generated Memory Size)
constant MAX_REMOTE_ENDPOINTS : natural := 50;
-- Unicast IPv4 Address used by all RTPS Entities [Default 192.168.0.128]
constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80080"; constant DEFAULT_IPv4_ADDRESS : std_logic_vector(IPv4_ADDRESS_WIDTH-1 downto 0) := x"C0A80080";
-- Number of RTPS Writer Endpoints -- Number of RTPS Writer Endpoints
constant NUM_WRITERS : natural := 8; constant NUM_WRITERS : natural := 8;
@ -33,7 +39,7 @@ package user_config is
-- D3 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1) -- D3 Value of Default Port Generation (see DDSI-RTPS 2.3 Section 9.6.1)
constant PORT_CONFIG_D3 : natural := 11; constant PORT_CONFIG_D3 : natural := 11;
-- MAC Address of underlying network stack (Used to generate GUIDs) -- MAC Address of underlying network stack (Used to generate GUIDs)
constant MAC_ADDRESS : std_logic_vector(47 downto 0) := x"97917E0BA8CF"; constant MAC_ADDRESS : std_logic_vector(47 downto 0) := x"17E97CEF2F64";
-- Domain ID -- Domain ID
constant USER_DOMAIN_ID : natural := 1; constant USER_DOMAIN_ID : natural := 1;
-- Domain TAG -- Domain TAG
@ -41,19 +47,17 @@ package user_config is
--***RTPS ENDPOINTS*** --***RTPS ENDPOINTS***
-- Array denoting if Endpoints use Keyed Topics -- Array denoting if Endpoints use Keyed Topics
constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE); constant ENDPOINT_WITH_KEY : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE);
-- Array denoting which mode the Endpoints are operating with -- Array denoting which mode the Endpoints are operating with
constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE); constant ENDPOINT_PUSH_MODE : USER_BOOLEAN_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => FALSE);
-- Array mapping Topic Names to Endpoints -- Array mapping Topic Names to Endpoints
constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TOPIC_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (
2 => "TOPIC_2" & (8 to 256 => NUL), 2 => "TOPIC_2" & (8 to 256 => NUL),
NUM_READERS+2 => "TOPIC_2" & (8 to 256 => NUL), NUM_READERS+2 => "TOPIC_2" & (8 to 256 => NUL),
others => "TOPIC_1" & (8 to 256 => NUL) others => "TOPIC_1" & (8 to 256 => NUL)
); );
-- Array mapping Type Names to Endpoints -- Array mapping Type Names to Endpoints
constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_TYPE_STRING : USER_STRING_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (
1 => "TYPE_2" & (7 to 256 => NUL), 1 => "TYPE_2" & (7 to 256 => NUL),
2 => "TYPE_2" & (7 to 256 => NUL), 2 => "TYPE_2" & (7 to 256 => NUL),
NUM_READERS+1 => "TYPE_2" & (7 to 256 => NUL), NUM_READERS+1 => "TYPE_2" & (7 to 256 => NUL),
@ -87,6 +91,7 @@ package user_config is
NUM_READERS+4 => TRANSIENT_LOCAL_DURABILITY_QOS, NUM_READERS+4 => TRANSIENT_LOCAL_DURABILITY_QOS,
others => DEFAULT_DURABILITY_QOS others => DEFAULT_DURABILITY_QOS
); );
-- Array mapping DURABILITY SERVICE QoS to Endpoints
constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := ( constant ENDPOINT_DURABILITY_SERVICE_CLEANUP_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (
NUM_READERS+7 => gen_duration(86400,0), NUM_READERS+7 => gen_duration(86400,0),
others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY others => DEFAULT_DURABILITY_SERVICE_CLEANUP_DELAY
@ -216,10 +221,9 @@ package user_config is
constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_NOWRITER_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_NOWRITER_SAMPLES_DELAY);
constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY); constant ENDPOINT_AUTOPURGE_DISPOSED_SAMPLES_DELAY : USER_DURATION_ARRAY_TYPE(0 to NUM_ENDPOINTS-1) := (others => DEFAULT_AUTOPURGE_DISPOSED_SAMPLES_DELAY);
-- TESTING PARAMETERS
constant TEST_STRING : string := "TEST_CONFIG_1";
-- Set to TRUE for Simulation Testing (Extra Code generated) -- Set to TRUE for Simulation Testing (Extra Code generated)
constant SIMULATION_FLAG : boolean := TRUE; constant SIMULATION_FLAG : boolean := TRUE;
-- TESTING PARAMETERS
constant TEST_STRING : string := "TEST_CONFIG_1";
end package; end package;

View File

@ -4,7 +4,7 @@ include ../OSVVM/osvvm.pro
library Testbench_Lib2 library Testbench_Lib2
analyze ../math_pkg.vhd analyze ../math_pkg.vhd
analyze ../rtps_package.vhd analyze ../rtps_package.vhd
analyze test_config2.vhd analyze Level_2/L2_Testbench_Lib2_config.vhd
analyze ../rtps_config_package.vhd analyze ../rtps_config_package.vhd
analyze ../rtps_test_package.vhd analyze ../rtps_test_package.vhd
analyze ../single_port_ram.vhd analyze ../single_port_ram.vhd
@ -34,7 +34,7 @@ analyze Type1_config.vhd
library Testbench_Lib3 library Testbench_Lib3
analyze ../math_pkg.vhd analyze ../math_pkg.vhd
analyze ../rtps_package.vhd analyze ../rtps_package.vhd
analyze test_config3.vhd analyze Level_2/L2_Testbench_Lib3_config.vhd
analyze ../rtps_config_package.vhd analyze ../rtps_config_package.vhd
analyze ../rtps_test_package.vhd analyze ../rtps_test_package.vhd
analyze ../single_port_ram.vhd analyze ../single_port_ram.vhd
@ -66,7 +66,7 @@ analyze Type1_config.vhd
library Testbench_Lib1 library Testbench_Lib1
analyze ../math_pkg.vhd analyze ../math_pkg.vhd
analyze ../rtps_package.vhd analyze ../rtps_package.vhd
analyze test_config1.vhd analyze Testbench_Lib1_config.vhd
analyze ../rtps_config_package.vhd analyze ../rtps_config_package.vhd
analyze ../rtps_test_package.vhd analyze ../rtps_test_package.vhd
analyze ../single_port_ram.vhd analyze ../single_port_ram.vhd

View File

@ -58,8 +58,8 @@ entity dds_reader is
get_data_dds : in std_logic; get_data_dds : in std_logic;
done_dds : out std_logic; done_dds : out std_logic;
return_code_dds : out std_logic_vector(RETURN_CODE_WIDTH-1 downto 0); return_code_dds : out std_logic_vector(RETURN_CODE_WIDTH-1 downto 0);
ready_out_dds : in std_logic;
valid_out_dds : out std_logic; valid_out_dds : out std_logic;
ready_out_dds : in std_logic;
data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0); data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_out_dds : out std_logic; last_word_out_dds : out std_logic;
-- Sample Info -- Sample Info

View File

@ -60,12 +60,12 @@ entity dds_writer is
done_dds : out std_logic; done_dds : out std_logic;
return_code_dds : out std_logic_vector(RETURN_CODE_WIDTH-1 downto 0); return_code_dds : out std_logic_vector(RETURN_CODE_WIDTH-1 downto 0);
instance_handle_out_dds : out INSTANCE_HANDLE_TYPE; instance_handle_out_dds : out INSTANCE_HANDLE_TYPE;
ready_in_dds : out std_logic;
valid_in_dds : in std_logic; valid_in_dds : in std_logic;
ready_in_dds : out std_logic;
data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in_dds : in std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_in_dds : in std_logic; last_word_in_dds : in std_logic;
ready_out_dds : in std_logic;
valid_out_dds : out std_logic; valid_out_dds : out std_logic;
ready_out_dds : in std_logic;
data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0); data_out_dds : out std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_out_dds : out std_logic; last_word_out_dds : out std_logic;
-- Communication Status -- Communication Status

View File

@ -126,6 +126,8 @@ package rtps_config_package is
type RTPS_OUT_DATA_TYPE is array (0 to NUM_ENDPOINTS) of std_logic_vector(WORD_WIDTH-1 downto 0); type RTPS_OUT_DATA_TYPE is array (0 to NUM_ENDPOINTS) of std_logic_vector(WORD_WIDTH-1 downto 0);
constant CLOCK_DURATION : DURATION_TYPE := gen_duration(0, CLOCK_PERIOD / 1 ns);
-- Swap "data" to Big Endian representation. -- Swap "data" to Big Endian representation.
function endian_swap(swap : std_logic; data : std_logic_vector) return std_logic_vector; function endian_swap(swap : std_logic; data : std_logic_vector) return std_logic_vector;
function endian_swap(swap : std_logic; data : unsigned) return unsigned; function endian_swap(swap : std_logic; data : unsigned) return unsigned;

View File

@ -19,15 +19,15 @@ entity rtps_handler is
empty : in std_logic; empty : in std_logic;
rd : out std_logic; rd : out std_logic;
data_in : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in : in std_logic_vector(WORD_WIDTH-1 downto 0);
-- TO BUILTIN ENDPOINT -- TO BUILTIN ENDPOINT
full_be : in std_logic; full_be : in std_logic;
wr_be : out std_logic; wr_be : out std_logic;
data_out_be : out std_logic_vector(WORD_WIDTH-1 downto 0); data_out_be : out std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_out_be : out std_logic; last_word_out_be : out std_logic;
-- TO USER ENDPOINTS -- TO USER ENDPOINTS
data_out_ue : out std_logic_vector(WORD_WIDTH-1 downto 0); -- one-to-many (Multicast) Connection
full_ue : in std_logic_vector(0 to NUM_ENDPOINTS-1); full_ue : in std_logic_vector(0 to NUM_ENDPOINTS-1);
wr_ue : out std_logic_vector(0 to NUM_ENDPOINTS-1); wr_ue : out std_logic_vector(0 to NUM_ENDPOINTS-1);
data_out_ue : out std_logic_vector(WORD_WIDTH-1 downto 0); -- one-to-many (Multicast) Connection
last_word_out_ue : out std_logic -- one-to-many (Multicast) Connection last_word_out_ue : out std_logic -- one-to-many (Multicast) Connection
); );
end entity; end entity;

View File

@ -19,13 +19,13 @@ entity rtps_out is
clk : in std_logic; clk : in std_logic;
reset : in std_logic; reset : in std_logic;
-- INPUT -- INPUT
full : in std_logic; empty : in std_logic_vector(0 to NUM_ENDPOINTS);
wr : out std_logic; rd : out std_logic_vector(0 to NUM_ENDPOINTS);
data_in : in RTPS_OUT_DATA_TYPE; data_in : in RTPS_OUT_DATA_TYPE;
last_word_in: in std_logic_vector(0 to NUM_ENDPOINTS); last_word_in: in std_logic_vector(0 to NUM_ENDPOINTS);
-- OUTPUT -- OUTPUT
empty : in std_logic_vector(0 to NUM_ENDPOINTS); full : in std_logic;
rd : out std_logic_vector(0 to NUM_ENDPOINTS); wr : out std_logic;
data_out : out std_logic_vector(WORD_WIDTH-1 downto 0) data_out : out std_logic_vector(WORD_WIDTH-1 downto 0)
); );
end entity; end entity;

View File

@ -53,9 +53,9 @@ entity rtps_reader is
ack_hc : in std_logic; ack_hc : in std_logic;
done_hc : in std_logic; done_hc : in std_logic;
ret_hc : in HISTORY_CACHE_RESPONSE_TYPE; ret_hc : in HISTORY_CACHE_RESPONSE_TYPE;
data_out_hc : out std_logic_vector(WORD_WIDTH-1 downto 0);
valid_out_hc : out std_logic; valid_out_hc : out std_logic;
ready_out_hc : in std_logic; ready_out_hc : in std_logic;
data_out_hc : out std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_out_hc : out std_logic last_word_out_hc : out std_logic
); );
end entity; end entity;

View File

@ -40,7 +40,7 @@ entity rtps_writer is
rd_user : out std_logic; rd_user : out std_logic;
data_in_user : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in_user : in std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_in_user : in std_logic; last_word_in_user : in std_logic;
-- FROM RTPS BUILTIN ENDPOINT (META TRAFFIC) -- TO/FROM RTPS BUILTIN ENDPOINT (META TRAFFIC)
empty_meta : in std_logic; empty_meta : in std_logic;
rd_meta : out std_logic; rd_meta : out std_logic;
data_in_meta : in std_logic_vector(WORD_WIDTH-1 downto 0); data_in_meta : in std_logic_vector(WORD_WIDTH-1 downto 0);
@ -62,9 +62,9 @@ entity rtps_writer is
done_hc : in std_logic; done_hc : in std_logic;
ret_hc : in HISTORY_CACHE_RESPONSE_TYPE; ret_hc : in HISTORY_CACHE_RESPONSE_TYPE;
get_data_hc : out std_logic; get_data_hc : out std_logic;
data_in_hc : in std_logic_vector(WORD_WIDTH-1 downto 0);
valid_in_hc : in std_logic; valid_in_hc : in std_logic;
ready_in_hc : out std_logic; ready_in_hc : out std_logic;
data_in_hc : in std_logic_vector(WORD_WIDTH-1 downto 0);
last_word_in_hc : in std_logic; last_word_in_hc : in std_logic;
cc_instance_handle : in INSTANCE_HANDLE_TYPE; cc_instance_handle : in INSTANCE_HANDLE_TYPE;
cc_kind : in CACHE_CHANGE_KIND_TYPE; cc_kind : in CACHE_CHANGE_KIND_TYPE;