Add ROS Action Server implementation

This commit is contained in:
John Ring 2022-03-02 11:27:57 +01:00
parent f759f0d201
commit 6bbb5fc102
13 changed files with 10037 additions and 8 deletions

View File

@ -0,0 +1,223 @@
onerror {resume}
radix define DDS_RETCODE {
"10#0#" "RETCODE_OK",
"10#1#" "RETCODE_ERROR",
"10#2#" "RETCODE_UNSUPPORTED",
"10#3#" "RETCODE_BAD_PARAMETER",
"10#4#" "RETCODE_PRECONDITION_NOT_MET",
"10#5#" "RETCODE_OUT_OF_RESOURCES",
"10#6#" "RETCODE_NOT_ENABLED",
"10#7#" "RETCODE_IMMUTABLE_POLICY",
"10#8#" "RETCODE_INCONSISTENT_POLICY",
"10#9#" "RETCODE_ALREADY_DELETED",
"10#10#" "RETCODE_TIMEOUT",
"10#11#" "RETCODE_NO_DATA",
"10#12#" "RETCODE_ILLEGAL_OPERATION",
-default unsigned
}
radix define ROS_RETCODE {
"10#0#" "ROS_RET_OK",
"10#1#" "ROS_RET_ERROR",
"10#2#" "ROS_RET_TIMEOUT",
"10#3#" "ROS_RET_UNSUPPORTED",
"10#10#" "ROS_RET_BAD_ALLOC",
"10#11#" "ROS_RET_INVALID_ARGUMENT",
"10#12#" "ROS_RET_INCORRECT_RMW_IMPLEMENTATION",
"10#100#" "ROS_RET_ALREADY_INIT",
"10#101#" "ROS_RET_NOT_INIT",
"10#102#" "ROS_RET_MISMATCHED_RMW",
"10#103#" "ROS_RET_TOPIC_NAME_INVALID",
"10#104#" "ROS_RET_SERVICE_NAME_INVALID",
"10#105#" "ROS_RET_UNKNOWN_SUBSTITUTION",
"10#106#" "ROS_RET_ALREADY_SHUTDOWN",
"10#200#" "ROS_RET_NODE_INVALID",
"10#201#" "ROS_RET_NODE_INVALID_NAME",
"10#202#" "ROS_RET_NODE_INVALID_NAMESPACE",
"10#203#" "ROS_RET_NODE_NAME_NON_EXISTENT",
"10#400#" "ROS_RET_SUBSCRIPTION_INVALID",
"10#401#" "ROS_RET_SUBSCRIPTION_TAKE_FAILED",
"10#500#" "ROS_RET_CLIENT_INVALID",
"10#501#" "ROS_RET_CLIENT_TAKE_FAILED",
"10#600#" "ROS_RET_SERVICE_INVALID",
"10#601#" "ROS_RET_SERVICE_TAKE_FAILED",
"10#800#" "ROS_RET_TIMER_INVALID",
"10#801#" "ROS_RET_TIMER_CANCELED",
"10#900#" "ROS_RET_WAIT_SET_INVALID",
"10#901#" "ROS_RET_WAIT_SET_EMPTY",
"10#902#" "ROS_RET_WAIT_SET_FULL",
"10#1001#" "ROS_RET_INVALID_REMAP_RULE",
"10#1002#" "ROS_RET_WRONG_LEXEME",
"10#1003#" "ROS_RET_INVALID_ROS_ARGS",
"10#1010#" "ROS_RET_INVALID_PARAM_RULE",
"10#1020#" "ROS_RET_INVALID_LOG_LEVEL_RULE",
"10#2001#" "ROS_RET_EVENT_TAKE_FAILED",
"10#2000#" "ROS_RET_ACTION_NAME_INVALID",
"10#2100#" "ROS_RET_ACTION_GOAL_ACCEPTED",
"10#2101#" "ROS_RET_ACTION_GOAL_REJECTED",
"10#2102#" "ROS_RET_ACTION_CLIENT_INVALID",
"10#2103#" "ROS_RET_ACTION_CLIENT_TAKE_FAILED",
"10#2200#" "ROS_RET_ACTION_SERVER_INVALID",
"10#2201#" "ROS_RET_ACTION_SERVER_TAKE_FAILED",
"10#2300#" "ROS_RET_ACTION_GOAL_HANDLE_INVALID",
"10#2301#" "ROS_RET_ACTION_GOAL_EVENT_INVALID",
"10#3000#" "ROS_RET_LIFECYCLE_STATE_REGISTERED",
"10#3001#" "ROS_RET_LIFECYCLE_STATE_NOT_REGISTERED",
-default unsigned
}
radix define GOAL_STATUS {
"10#0#" "STATUS_UNKNOWN",
"10#1#" "STATUS_ACCEPTED",
"10#2#" "STATUS_EXECUTING",
"10#3#" "STATUS_CANCELING",
"10#4#" "STATUS_SUCCEEDED",
"10#5#" "STATUS_CANCELED",
"10#6#" "STATUS_ABORTED",
-default unsigned
}
radix define CANCEL_RETCODE {
"10#0#" "ERROR_NONE",
"10#1#" "ERROR_REJECTED",
"10#2#" "ERROR_UNKNOWN_GOAL_ID",
"10#3#" "ERROR_GOAL_TERMINATED",
-default unsigned
}
quietly WaveActivateNextPane {} 0
add wave -noupdate -divider SYSTEM
add wave -noupdate /l0_ros_action_server_test1/uut/clk
add wave -noupdate /l0_ros_action_server_test1/uut/reset
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/time
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/check_time
add wave -noupdate -divider GOAL
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/data_available_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/start_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/ack_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/opcode_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test1/uut/service_info_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test1/uut/request_id_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/taken_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/done_g
add wave -noupdate -group GOAL -radix ROS_RETCODE /l0_ros_action_server_test1/uut/return_code_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test1/uut/goal_id_g
add wave -noupdate -group GOAL /l0_ros_action_server_test1/uut/accepted_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test1/uut/stamp_g
add wave -noupdate -divider RESULT
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/data_available_r
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/start_r
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/ack_r
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/opcode_r
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test1/uut/service_info_r
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test1/uut/request_id_r
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/taken_r
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/done_r
add wave -noupdate -group RESULT -radix ROS_RETCODE /l0_ros_action_server_test1/uut/return_code_r
add wave -noupdate -group RESULT -radix unsigned /l0_ros_action_server_test1/uut/result_index
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/result_sel
add wave -noupdate -group RESULT /l0_ros_action_server_test1/uut/result_sel_ack
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test1/uut/goal_id_r
add wave -noupdate -group RESULT -radix GOAL_STATUS /l0_ros_action_server_test1/uut/status_r
add wave -noupdate -divider CANCEL
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/data_available_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/start_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/ack_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/opcode_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/service_info_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/request_id_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/taken_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/done_c
add wave -noupdate -group CANCEL -radix CANCEL_RETCODE /l0_ros_action_server_test1/uut/return_code_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/goal_info_goal_id_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/goal_info_stamp_c
add wave -noupdate -group CANCEL -radix GOAL_STATUS /l0_ros_action_server_test1/uut/cancel_return_code_c
add wave -noupdate -group CANCEL -radix unsigned /l0_ros_action_server_test1/uut/goals_canceling_len_c
add wave -noupdate -group CANCEL -radix unsigned /l0_ros_action_server_test1/uut/goals_canceling_addr_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/goals_canceling_ready_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test1/uut/goals_canceling_wen_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/goals_canceling_goal_id_w_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test1/uut/goals_canceling_stamp_w_c
add wave -noupdate -divider STATUS
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/start_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/opcode_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/ack_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/done_s
add wave -noupdate -group STATUS -radix ROS_RETCODE /l0_ros_action_server_test1/uut/return_code_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/status_list_len_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/status_list_addr_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/status_list_ready_s
add wave -noupdate -group STATUS /l0_ros_action_server_test1/uut/status_list_wen_s
add wave -noupdate -group STATUS -radix hexadecimal /l0_ros_action_server_test1/uut/status_list_goal_info_goal_id_w_s
add wave -noupdate -group STATUS -radix hexadecimal /l0_ros_action_server_test1/uut/status_list_goal_info_stamp_w_s
add wave -noupdate -group STATUS -radix GOAL_STATUS /l0_ros_action_server_test1/uut/status_list_status_w_s
add wave -noupdate -divider USER
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/start
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/opcode
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/ack
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/done
add wave -noupdate -expand -group USER -radix ROS_RETCODE /l0_ros_action_server_test1/uut/return_code
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test1/uut/goal_handle_in
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test1/uut/goal_handle_out
add wave -noupdate -expand -group USER -radix GOAL_STATUS /l0_ros_action_server_test1/uut/goal_state_in
add wave -noupdate -expand -group USER -radix GOAL_STATUS /l0_ros_action_server_test1/uut/goal_state_out
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test1/uut/goal_id
add wave -noupdate -expand -group USER -radix unsigned /l0_ros_action_server_test1/uut/goal_result_index
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/goal_stamp
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/new_goal_request
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test1/uut/new_goal_handle
add wave -noupdate -expand -group USER -radix unsigned /l0_ros_action_server_test1/uut/new_goal_result_index
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/new_goal_accepted
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/new_goal_response
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/cancel_request
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test1/uut/cancel_request_handle
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/cancel_accepted
add wave -noupdate -expand -group USER /l0_ros_action_server_test1/uut/cancel_response
add wave -noupdate -divider FSM
add wave -noupdate /l0_ros_action_server_test1/uut/stage
add wave -noupdate /l0_ros_action_server_test1/uut/cnt
add wave -noupdate /l0_ros_action_server_test1/uut/terminal_cnt
add wave -noupdate -divider MEM
add wave -noupdate /l0_ros_action_server_test1/uut/mem_start
add wave -noupdate /l0_ros_action_server_test1/uut/mem_opcode
add wave -noupdate /l0_ros_action_server_test1/uut/mem_done
add wave -noupdate -childformat {{/l0_ros_action_server_test1/uut/mem_r.addr -radix unsigned} {/l0_ros_action_server_test1/uut/mem_r.goal_id -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_r.stamp -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_r.deadline -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_r.res_ind -radix unsigned} {/l0_ros_action_server_test1/uut/mem_r.state -radix GOAL_STATUS}} -subitemconfig {/l0_ros_action_server_test1/uut/mem_r.addr {-height 15 -radix unsigned} /l0_ros_action_server_test1/uut/mem_r.goal_id {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_r.stamp {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_r.deadline {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_r.res_ind {-height 15 -radix unsigned} /l0_ros_action_server_test1/uut/mem_r.state {-height 15 -radix GOAL_STATUS}} /l0_ros_action_server_test1/uut/mem_r
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/mem_addr_base
add wave -noupdate /l0_ros_action_server_test1/uut/mem_stage
add wave -noupdate /l0_ros_action_server_test1/uut/mem_cnt
add wave -noupdate -group GOAL_MEM -radix unsigned /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/addr
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/read
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/ready_in
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/valid_in
add wave -noupdate -group GOAL_MEM -radix hexadecimal /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/data_in
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/ready_out
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/valid_out
add wave -noupdate -group GOAL_MEM -radix hexadecimal /l0_ros_action_server_test1/uut/goal_mem_ctrl_inst/data_out
add wave -noupdate -group RRQ_MEM -radix unsigned /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/addr
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/read
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/ready_in
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/valid_in
add wave -noupdate -group RRQ_MEM -radix hexadecimal /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/data_in
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/ready_out
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/valid_out
add wave -noupdate -group RRQ_MEM -radix hexadecimal /l0_ros_action_server_test1/uut/rrq_mem_ctrl_inst/data_out
add wave -noupdate -childformat {{/l0_ros_action_server_test1/uut/mem_data.addr -radix unsigned} {/l0_ros_action_server_test1/uut/mem_data.goal_id -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_data.stamp -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_data.deadline -radix hexadecimal} {/l0_ros_action_server_test1/uut/mem_data.res_ind -radix unsigned} {/l0_ros_action_server_test1/uut/mem_data.state -radix GOAL_STATUS}} -subitemconfig {/l0_ros_action_server_test1/uut/mem_data.addr {-height 15 -radix unsigned} /l0_ros_action_server_test1/uut/mem_data.goal_id {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_data.stamp {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_data.deadline {-height 15 -radix hexadecimal} /l0_ros_action_server_test1/uut/mem_data.res_ind {-height 15 -radix unsigned} /l0_ros_action_server_test1/uut/mem_data.state {-height 15 -radix GOAL_STATUS}} /l0_ros_action_server_test1/uut/mem_data
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/mem_occupied_head
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/mem_occupied_tail
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/mem_empty_head
add wave -noupdate -radix unsigned /l0_ros_action_server_test1/uut/mem_empty_tail
add wave -noupdate -divider MISC
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {139775000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 218
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {139284504 ps} {140265496 ps}

View File

@ -0,0 +1,223 @@
onerror {resume}
radix define DDS_RETCODE {
"10#0#" "RETCODE_OK",
"10#1#" "RETCODE_ERROR",
"10#2#" "RETCODE_UNSUPPORTED",
"10#3#" "RETCODE_BAD_PARAMETER",
"10#4#" "RETCODE_PRECONDITION_NOT_MET",
"10#5#" "RETCODE_OUT_OF_RESOURCES",
"10#6#" "RETCODE_NOT_ENABLED",
"10#7#" "RETCODE_IMMUTABLE_POLICY",
"10#8#" "RETCODE_INCONSISTENT_POLICY",
"10#9#" "RETCODE_ALREADY_DELETED",
"10#10#" "RETCODE_TIMEOUT",
"10#11#" "RETCODE_NO_DATA",
"10#12#" "RETCODE_ILLEGAL_OPERATION",
-default unsigned
}
radix define ROS_RETCODE {
"10#0#" "ROS_RET_OK",
"10#1#" "ROS_RET_ERROR",
"10#2#" "ROS_RET_TIMEOUT",
"10#3#" "ROS_RET_UNSUPPORTED",
"10#10#" "ROS_RET_BAD_ALLOC",
"10#11#" "ROS_RET_INVALID_ARGUMENT",
"10#12#" "ROS_RET_INCORRECT_RMW_IMPLEMENTATION",
"10#100#" "ROS_RET_ALREADY_INIT",
"10#101#" "ROS_RET_NOT_INIT",
"10#102#" "ROS_RET_MISMATCHED_RMW",
"10#103#" "ROS_RET_TOPIC_NAME_INVALID",
"10#104#" "ROS_RET_SERVICE_NAME_INVALID",
"10#105#" "ROS_RET_UNKNOWN_SUBSTITUTION",
"10#106#" "ROS_RET_ALREADY_SHUTDOWN",
"10#200#" "ROS_RET_NODE_INVALID",
"10#201#" "ROS_RET_NODE_INVALID_NAME",
"10#202#" "ROS_RET_NODE_INVALID_NAMESPACE",
"10#203#" "ROS_RET_NODE_NAME_NON_EXISTENT",
"10#400#" "ROS_RET_SUBSCRIPTION_INVALID",
"10#401#" "ROS_RET_SUBSCRIPTION_TAKE_FAILED",
"10#500#" "ROS_RET_CLIENT_INVALID",
"10#501#" "ROS_RET_CLIENT_TAKE_FAILED",
"10#600#" "ROS_RET_SERVICE_INVALID",
"10#601#" "ROS_RET_SERVICE_TAKE_FAILED",
"10#800#" "ROS_RET_TIMER_INVALID",
"10#801#" "ROS_RET_TIMER_CANCELED",
"10#900#" "ROS_RET_WAIT_SET_INVALID",
"10#901#" "ROS_RET_WAIT_SET_EMPTY",
"10#902#" "ROS_RET_WAIT_SET_FULL",
"10#1001#" "ROS_RET_INVALID_REMAP_RULE",
"10#1002#" "ROS_RET_WRONG_LEXEME",
"10#1003#" "ROS_RET_INVALID_ROS_ARGS",
"10#1010#" "ROS_RET_INVALID_PARAM_RULE",
"10#1020#" "ROS_RET_INVALID_LOG_LEVEL_RULE",
"10#2001#" "ROS_RET_EVENT_TAKE_FAILED",
"10#2000#" "ROS_RET_ACTION_NAME_INVALID",
"10#2100#" "ROS_RET_ACTION_GOAL_ACCEPTED",
"10#2101#" "ROS_RET_ACTION_GOAL_REJECTED",
"10#2102#" "ROS_RET_ACTION_CLIENT_INVALID",
"10#2103#" "ROS_RET_ACTION_CLIENT_TAKE_FAILED",
"10#2200#" "ROS_RET_ACTION_SERVER_INVALID",
"10#2201#" "ROS_RET_ACTION_SERVER_TAKE_FAILED",
"10#2300#" "ROS_RET_ACTION_GOAL_HANDLE_INVALID",
"10#2301#" "ROS_RET_ACTION_GOAL_EVENT_INVALID",
"10#3000#" "ROS_RET_LIFECYCLE_STATE_REGISTERED",
"10#3001#" "ROS_RET_LIFECYCLE_STATE_NOT_REGISTERED",
-default unsigned
}
radix define GOAL_STATUS {
"10#0#" "STATUS_UNKNOWN",
"10#1#" "STATUS_ACCEPTED",
"10#2#" "STATUS_EXECUTING",
"10#3#" "STATUS_CANCELING",
"10#4#" "STATUS_SUCCEEDED",
"10#5#" "STATUS_CANCELED",
"10#6#" "STATUS_ABORTED",
-default unsigned
}
radix define CANCEL_RETCODE {
"10#0#" "ERROR_NONE",
"10#1#" "ERROR_REJECTED",
"10#2#" "ERROR_UNKNOWN_GOAL_ID",
"10#3#" "ERROR_GOAL_TERMINATED",
-default unsigned
}
quietly WaveActivateNextPane {} 0
add wave -noupdate -divider SYSTEM
add wave -noupdate /l0_ros_action_server_test2/uut/clk
add wave -noupdate /l0_ros_action_server_test2/uut/reset
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/time
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/check_time
add wave -noupdate -divider GOAL
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/data_available_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/start_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/ack_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/opcode_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test2/uut/service_info_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test2/uut/request_id_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/taken_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/done_g
add wave -noupdate -group GOAL -radix ROS_RETCODE /l0_ros_action_server_test2/uut/return_code_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test2/uut/goal_id_g
add wave -noupdate -group GOAL /l0_ros_action_server_test2/uut/accepted_g
add wave -noupdate -group GOAL -radix hexadecimal /l0_ros_action_server_test2/uut/stamp_g
add wave -noupdate -divider RESULT
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/data_available_r
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/start_r
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/ack_r
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/opcode_r
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test2/uut/service_info_r
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test2/uut/request_id_r
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/taken_r
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/done_r
add wave -noupdate -group RESULT -radix ROS_RETCODE /l0_ros_action_server_test2/uut/return_code_r
add wave -noupdate -group RESULT -radix unsigned /l0_ros_action_server_test2/uut/result_index
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/result_sel
add wave -noupdate -group RESULT /l0_ros_action_server_test2/uut/result_sel_ack
add wave -noupdate -group RESULT -radix hexadecimal /l0_ros_action_server_test2/uut/goal_id_r
add wave -noupdate -group RESULT -radix GOAL_STATUS /l0_ros_action_server_test2/uut/status_r
add wave -noupdate -divider CANCEL
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/data_available_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/start_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/ack_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/opcode_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/service_info_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/request_id_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/taken_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/done_c
add wave -noupdate -group CANCEL -radix CANCEL_RETCODE /l0_ros_action_server_test2/uut/return_code_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/goal_info_goal_id_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/goal_info_stamp_c
add wave -noupdate -group CANCEL -radix GOAL_STATUS /l0_ros_action_server_test2/uut/cancel_return_code_c
add wave -noupdate -group CANCEL -radix unsigned /l0_ros_action_server_test2/uut/goals_canceling_len_c
add wave -noupdate -group CANCEL -radix unsigned /l0_ros_action_server_test2/uut/goals_canceling_addr_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/goals_canceling_ready_c
add wave -noupdate -group CANCEL /l0_ros_action_server_test2/uut/goals_canceling_wen_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/goals_canceling_goal_id_w_c
add wave -noupdate -group CANCEL -radix hexadecimal /l0_ros_action_server_test2/uut/goals_canceling_stamp_w_c
add wave -noupdate -divider STATUS
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/start_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/opcode_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/ack_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/done_s
add wave -noupdate -group STATUS -radix ROS_RETCODE /l0_ros_action_server_test2/uut/return_code_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/status_list_len_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/status_list_addr_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/status_list_ready_s
add wave -noupdate -group STATUS /l0_ros_action_server_test2/uut/status_list_wen_s
add wave -noupdate -group STATUS -radix hexadecimal /l0_ros_action_server_test2/uut/status_list_goal_info_goal_id_w_s
add wave -noupdate -group STATUS -radix hexadecimal /l0_ros_action_server_test2/uut/status_list_goal_info_stamp_w_s
add wave -noupdate -group STATUS -radix GOAL_STATUS /l0_ros_action_server_test2/uut/status_list_status_w_s
add wave -noupdate -divider USER
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/start
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/opcode
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/ack
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/done
add wave -noupdate -expand -group USER -radix ROS_RETCODE /l0_ros_action_server_test2/uut/return_code
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test2/uut/goal_handle_in
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test2/uut/goal_handle_out
add wave -noupdate -expand -group USER -radix GOAL_STATUS /l0_ros_action_server_test2/uut/goal_state_in
add wave -noupdate -expand -group USER -radix GOAL_STATUS /l0_ros_action_server_test2/uut/goal_state_out
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test2/uut/goal_id
add wave -noupdate -expand -group USER -radix unsigned /l0_ros_action_server_test2/uut/goal_result_index
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/goal_stamp
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/new_goal_request
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test2/uut/new_goal_handle
add wave -noupdate -expand -group USER -radix unsigned /l0_ros_action_server_test2/uut/new_goal_result_index
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/new_goal_accepted
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/new_goal_response
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/cancel_request
add wave -noupdate -expand -group USER -radix hexadecimal /l0_ros_action_server_test2/uut/cancel_request_handle
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/cancel_accepted
add wave -noupdate -expand -group USER /l0_ros_action_server_test2/uut/cancel_response
add wave -noupdate -divider FSM
add wave -noupdate /l0_ros_action_server_test2/uut/stage
add wave -noupdate /l0_ros_action_server_test2/uut/cnt
add wave -noupdate /l0_ros_action_server_test2/uut/terminal_cnt
add wave -noupdate -divider MEM
add wave -noupdate /l0_ros_action_server_test2/uut/mem_start
add wave -noupdate /l0_ros_action_server_test2/uut/mem_opcode
add wave -noupdate /l0_ros_action_server_test2/uut/mem_done
add wave -noupdate -childformat {{/l0_ros_action_server_test2/uut/mem_r.addr -radix unsigned} {/l0_ros_action_server_test2/uut/mem_r.goal_id -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_r.stamp -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_r.deadline -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_r.res_ind -radix unsigned} {/l0_ros_action_server_test2/uut/mem_r.state -radix GOAL_STATUS}} -subitemconfig {/l0_ros_action_server_test2/uut/mem_r.addr {-height 15 -radix unsigned} /l0_ros_action_server_test2/uut/mem_r.goal_id {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_r.stamp {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_r.deadline {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_r.res_ind {-height 15 -radix unsigned} /l0_ros_action_server_test2/uut/mem_r.state {-height 15 -radix GOAL_STATUS}} /l0_ros_action_server_test2/uut/mem_r
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/mem_addr_base
add wave -noupdate /l0_ros_action_server_test2/uut/mem_stage
add wave -noupdate /l0_ros_action_server_test2/uut/mem_cnt
add wave -noupdate -group GOAL_MEM -radix unsigned /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/addr
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/read
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/ready_in
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/valid_in
add wave -noupdate -group GOAL_MEM -radix hexadecimal /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/data_in
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/ready_out
add wave -noupdate -group GOAL_MEM /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/valid_out
add wave -noupdate -group GOAL_MEM -radix hexadecimal /l0_ros_action_server_test2/uut/goal_mem_ctrl_inst/data_out
add wave -noupdate -group RRQ_MEM -radix unsigned /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/addr
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/read
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/ready_in
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/valid_in
add wave -noupdate -group RRQ_MEM -radix hexadecimal /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/data_in
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/ready_out
add wave -noupdate -group RRQ_MEM /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/valid_out
add wave -noupdate -group RRQ_MEM -radix hexadecimal /l0_ros_action_server_test2/uut/rrq_mem_ctrl_inst/data_out
add wave -noupdate -childformat {{/l0_ros_action_server_test2/uut/mem_data.addr -radix unsigned} {/l0_ros_action_server_test2/uut/mem_data.goal_id -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_data.stamp -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_data.deadline -radix hexadecimal} {/l0_ros_action_server_test2/uut/mem_data.res_ind -radix unsigned} {/l0_ros_action_server_test2/uut/mem_data.state -radix GOAL_STATUS}} -subitemconfig {/l0_ros_action_server_test2/uut/mem_data.addr {-height 15 -radix unsigned} /l0_ros_action_server_test2/uut/mem_data.goal_id {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_data.stamp {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_data.deadline {-height 15 -radix hexadecimal} /l0_ros_action_server_test2/uut/mem_data.res_ind {-height 15 -radix unsigned} /l0_ros_action_server_test2/uut/mem_data.state {-height 15 -radix GOAL_STATUS}} /l0_ros_action_server_test2/uut/mem_data
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/mem_occupied_head
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/mem_occupied_tail
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/mem_empty_head
add wave -noupdate -radix unsigned /l0_ros_action_server_test2/uut/mem_empty_tail
add wave -noupdate -divider MISC
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {139775000 ps} 0}
quietly wave cursor active 1
configure wave -namecolwidth 218
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {139284504 ps} {140265496 ps}

View File

@ -686,6 +686,67 @@ OUTPUT DATA
**| | **| |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
ACTION SERVER
=============
GOAL
----
31............24..............16..............8...............0
| | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-----------------------------------------------+---------------+
00| UNUSED | GOAL_STATE |
+-----------------------------------------------+---------------+
01| |
+ +
02| |
+ GOAL_ID +
03| |
+ +
04| |
+---------------------------------------------------------------+
05| |
+ STAMP +
06| |
+---------------------------------------------------------------+
07| |
+ DEADLINE + [only if TIMEOUT_DURATION /= DURATION_INFINITE]
08| |
+---------------------------------------------------------------+
09| RESULT_INDEX |
+---------------------------------------------------------------+
10| NEXT_ADDRESS |
+---------------------------------------------------------------+
11| PREV_ADDRESS |
+---------------------------------------------------------------+
RESULT_REQUEST
--------------
31............24..............16..............8...............0
| | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+---------------------------------------------------------------+
00| GOAL_HANDLE |
+---------------------------------------------------------------+
01| |
+ +
02| |
+ +
03| |
+ REQUEST_ID +
04| |
+ +
05| |
+ +
06| |
+---------------------------------------------------------------+
07| NEXT_ADDRESS |
+---------------------------------------------------------------+
08| PREV_ADDRESS |
+---------------------------------------------------------------+
TOPIC KEYS TOPIC KEYS
========== ==========
@ -948,4 +1009,4 @@ Parameter List (8.3.5.9)
* There shall be no more than 2^16 possible values of the ParameterId_t parameterId * There shall be no more than 2^16 possible values of the ParameterId_t parameterId
* A range of 2^15 values is reserved for protocol-defined parameters * A range of 2^15 values is reserved for protocol-defined parameters
* A range of 2^15 values is reserved for vendor-defined parameters * A range of 2^15 values is reserved for vendor-defined parameters
* The maximum length of any parameter is limited to 2^16 octets * The maximum length of any parameter is limited to 2^16 octets

View File

@ -428,6 +428,16 @@ DESIGN DECISIONS
does enforce those limits implicitly, since it encodes the memory/registers that are physically limited does enforce those limits implicitly, since it encodes the memory/registers that are physically limited
to those specified upper bounds during static generation. to those specified upper bounds during static generation.
* RTPS/DDS use a time representation of 64-bit seconds in 32Q32 fixed point format. The ROS libraries
use a 64-bit unsigned nanosecond representation, and ROS sends time (defined in
rcl_interfaces/builtin_interfaces) in 32-bit second and 32-bit nanosecond respresentation.
An internal representation of a 64-bit nanosecond counter seems like the most sensible, but conversions
between are quite resource and latency heavy.
Since the ros action server directly interfaces ros services with the builtin_interfaces definition,
it was decided that the entire server works on this representation to avoid costly converions. This in
effect mitigates the converion problem to the instantiating entity, but a single conversion point could
be defined that can be used throughout the system.
BRAINSTORMING BRAINSTORMING
------------- -------------

View File

@ -18,4 +18,9 @@ The code generation follows the normal code generation for encoding and decoding
* The <SERVICENAME>_package calculates both a maximum request and response message size, named * The <SERVICENAME>_package calculates both a maximum request and response message size, named
MAX_<SERVICENAME>_RQ_SIZE and MAX_<SERVICENAME>_RR_SIZE, respectively. MAX_<SERVICENAME>_RQ_SIZE and MAX_<SERVICENAME>_RR_SIZE, respectively.
The maximum includes the service overhead bytes that are contained in the DDS Payloads. The constant The maximum includes the service overhead bytes that are contained in the DDS Payloads. The constant
SERVICE_OVERHEAD_BYTES from ros_package gives this overhead bytes. SERVICE_OVERHEAD_BYTES from ros_package gives this overhead bytes.
ACTION
######

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
-- TEST: NEW GOAL [MEMORY EMPTY]
-- TEST: NEW GOAL [ACCEPT]
-- TEST: NEW GOAL [REJECT]
-- TEST: NEW GOAL [FULL GOAL MEMORY, TIMEOUT=INFINITE, NO TERMINAL STATE GOAL EXISTS]
-- TEST: NEW GOAL [FULL GOAL MEMORY, TIMEOUT=INFINITE, TERMINAL STATE GOAL EXISTS]
-- TEST: NEW GOAL [FULL GOAL MEMORY, TIMEOUT/=INFINITE]
-- TEST: GET_GOAL
-- TEST: GET_GOAL [INVALID HANDLE]
-- TEST: GET_LAST_GOAL [MEMORY NOT EMPTY]
-- TEST: GET_LAST_GOAL [MEMORY EMPTY]
-- TEST: GET_PREVIOUS_GOAL [PREVIOUS GOAL EXISTS]
-- TEST: GET_PREVIOUS_GOAL [PREVIOUS GOAL DOES NOT EXISTS]
-- TEST: GET_PREVIOUS_GOAL [INVALID HANDLE]
-- TEST: UPDATE_GOAL_STATE [VALID STATE]
-- TEST: UPDATE_GOAL_STATE [INVALID STATE]
-- TEST: UPDATE_GOAL_STATE [INVALID HANDLE]
-- TEST: PUBLISH_FEEDBACK
-- TEST: NEW RESULT REQUEST [MEMORY EMPTY]
-- TEST: NEW RESULT REQUEST [GOAL DOES NOT EXIST]
-- TEST: NEW RESULT REQUEST [GOAL TERMINAL]
-- TEST: NEW RESULT REQUEST [GOAL NOT TERMINAL]
-- TEST: NEW RESULT REQUEST [FULL RESULT MEMORY]
-- TEST: STORED RESULT REQUEST [GOAL STATE UPDATES]
-- TEST: STORED RESULT REQUEST [GOAL STATE CHANGES TO TERMINAL]
-- TEST: STORED RESULT REQUEST [MULTIPLE REQUESTS, SAME GOAL, GOAL STATE CHANGES TO TERMINAL]
-- TEST: EXPIRE GOALS [SINGLE EXPIRED GOAL]
-- TEST: EXPIRE GOALS [MULTIPLE EXPIRED GOALS]
-- TEST: EXPIRE GOALS [ALL GOALS EXPIRED]
-- TEST: GOAL MEMORY [EMPTY->FULL->EMPTY->FULL]
-- TEST: RESULT REQUEST MEMORY [EMPTY->FULL->EMPTY->FULL]
-- TEST: CANCEL REQUEST [MEMORY EMPTY]
-- TEST: CANCEL REQUEST [GOAL ID SET, GOAL EXISTS]
-- TEST: CANCEL REQUEST [GOAL ID SET, GOAL EXISTS, GOAL TERMINAL]
-- TEST: CANCEL REQUEST [GOAL ID SET, GOAL DOES NOT EXISTS]
-- TEST: CANCEL REQUEST [TIME SET, NO RELEVANT GOALS]
-- TEST: CANCEL REQUEST [TIME SET, RELEVANT GOALS EXIST]
-- TEST: CANCEL REQUEST [NO GOAL ID SET, NO TIME SET, GOALS EXIST]
-- TEST: CANCEL REQUEST [NO GOAL ID SET, NO TIME SET, NO GOALS EXIST]
-- TEST: CANCEL REQUEST [GOAL ID SET, TIME SET, GOAL ID IS NOT IN TIME RANGE]
-- TEST: CANCEL REQUEST [GOAL ID SET, TIME SET, GOAL ID IS IN TIME RANGE]
-- TEST: STATUS UPDATE [NEW GOAL]
-- TEST: STATUS UPDATE [GOAL UPDATE]
-- TEST: STATUS UPDATE [GOAL REMOVED]
-- TEST: STATUS UPDATE [GOAL CANCELED]

View File

@ -118,6 +118,9 @@ analyze ../example_interfaces/Fibonacci_ros_action_result_srv_server.vhd
analyze ../example_interfaces/Fibonacci_ros_action_result_srv_client.vhd analyze ../example_interfaces/Fibonacci_ros_action_result_srv_client.vhd
analyze Level_1/L1_Fibonacci_ros_action_result_srv_test1.vhd analyze Level_1/L1_Fibonacci_ros_action_result_srv_test1.vhd
analyze Level_1/L1_Fibonacci_ros_action_result_srv_test2.vhd analyze Level_1/L1_Fibonacci_ros_action_result_srv_test2.vhd
analyze ../ros_action_server.vhd
analyze Level_0/L0_ros_action_server_test1.vhd
analyze Level_0/L0_ros_action_server_test2.vhd
simulate L1_AddTwoInts_ros_srv_test1 simulate L1_AddTwoInts_ros_srv_test1
@ -132,4 +135,6 @@ simulate L1_Fibonacci_ros_action_feedback_test2
simulate L1_Fibonacci_ros_action_goal_srv_test1 simulate L1_Fibonacci_ros_action_goal_srv_test1
simulate L1_Fibonacci_ros_action_goal_srv_test2 simulate L1_Fibonacci_ros_action_goal_srv_test2
simulate L1_Fibonacci_ros_action_result_srv_test1 simulate L1_Fibonacci_ros_action_result_srv_test1
simulate L1_Fibonacci_ros_action_result_srv_test2 simulate L1_Fibonacci_ros_action_result_srv_test2
simulate L0_ros_action_server_test1
simulate L0_ros_action_server_test2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,13 +25,23 @@ package ros_package is
nanosec : std_logic_vector(CDR_LONG_WIDTH-1 downto 0); nanosec : std_logic_vector(CDR_LONG_WIDTH-1 downto 0);
end record; end record;
constant ROS_TIME_ZERO : ROS_TIME_TYPE := (sec => (others => '0'), nanosec => (others => '0'));
constant ROS_TIME_INFINITE : ROS_TIME_TYPE := (sec => (others => '1'), nanosec => (others => '1'));
constant ROS_TIME_INVALID : ROS_TIME_TYPE := (sec => (others => '1'), nanosec => x"fffffffe");
subtype ROS_DURATION_TYPE is ROS_TIME_TYPE; subtype ROS_DURATION_TYPE is ROS_TIME_TYPE;
constant ROS_DURATION_ZERO : ROS_DURATION_TYPE := (sec => (others => '0'), nanosec => (others => '0'));
constant ROS_DURATION_INFINITE : ROS_DURATION_TYPE := (sec => (others => '1'), nanosec => (others => '1'));
constant ROS_TIME_WIDTH : natural := 64; constant ROS_TIME_WIDTH : natural := 64;
function to_unsigned(input : ROS_TIME_TYPE) return unsigned; function to_unsigned(input : ROS_TIME_TYPE) return unsigned;
function to_ROS_TIME(input : std_logic_vector) return ROS_TIME_TYPE; function to_ROS_TIME(input : std_logic_vector) return ROS_TIME_TYPE;
-- Helper Function
function gen_duration(s,ns : integer) return ROS_DURATION_TYPE;
function gen_duration(t : time) return ROS_DURATION_TYPE;
type ROS_QOS_PROFILE_TYPE is record type ROS_QOS_PROFILE_TYPE is record
HISTORY_QOS : std_logic_vector(CDR_ENUMERATION_WIDTH-1 downto 0); HISTORY_QOS : std_logic_vector(CDR_ENUMERATION_WIDTH-1 downto 0);
@ -263,7 +273,7 @@ package ros_package is
type ROS_TOPIC_OPCODE_TYPE is (NOP, PUBLISH, TAKE); type ROS_TOPIC_OPCODE_TYPE is (NOP, PUBLISH, TAKE);
type ROS_SERVICE_OPCODE_TYPE is (NOP, SEND_REQUEST, TAKE_REQUEST, SEND_RESPONSE, TAKE_RESPONSE); type ROS_SERVICE_OPCODE_TYPE is (NOP, SEND_REQUEST, TAKE_REQUEST, SEND_RESPONSE, TAKE_RESPONSE);
type ROS_ACTION_OPCODE_TYPE is (NOP, SEND_GOAL_REQUEST, TAKE_GOAL_REQUEST, SEND_GOAL_RESPONSE, TAKE_GOAL_RESPONSE, SEND_RESULT_REQUEST, TAKE_RESULT_REQUEST, SEND_RESULT_RESPONSE, TAKE_RESULT_RESPONSE, SEND_CANCEL_REQUEST, TAKE_CANCEL_REQUEST, SEND_CANCEL_RESPONSE, TAKE_CANCEL_RESPONSE, PUBLISH_FEEDBACK, ACCEPT_GOAL, UPDATE_GOAL, EXPIRE_GOAL); type ROS_ACTION_OPCODE_TYPE is (NOP, GET_GOAL, GET_LAST_GOAL, GET_PREVIOUS_GOAL, UPDATE_GOAL_STATE, PUBLISH_FEEDBACK);
constant ROS_SEQUENCE_ID_WIDTH : natural := 64; constant ROS_SEQUENCE_ID_WIDTH : natural := 64;
@ -271,6 +281,9 @@ package ros_package is
constant SERVICE_OVERHEAD_BYTES : natural := 16; constant SERVICE_OVERHEAD_BYTES : natural := 16;
constant GOAL_HANDLE_WIDTH : natural := WORD_WIDTH;
constant GOAL_HANDLE_UNKNOWN : std_logic_vector(GOAL_HANDLE_WIDTH-1 downto 0) := (others => '1');
function get_num_pubs(nodes : ROS_NODE_ARRAY_TYPE) return natural; function get_num_pubs(nodes : ROS_NODE_ARRAY_TYPE) return natural;
function get_num_subs(nodes : ROS_NODE_ARRAY_TYPE) return natural; function get_num_subs(nodes : ROS_NODE_ARRAY_TYPE) return natural;
function get_num_services(nodes : ROS_NODE_ARRAY_TYPE) return natural; function get_num_services(nodes : ROS_NODE_ARRAY_TYPE) return natural;
@ -323,10 +336,41 @@ package ros_package is
type SERVICE_INTERFACE_ARRAY_TYPE is array (natural range <>) of SERVICE_INTERFACE_TYPE; type SERVICE_INTERFACE_ARRAY_TYPE is array (natural range <>) of SERVICE_INTERFACE_TYPE;
function ">" (L,R: ROS_TIME_TYPE) return boolean;
function "<" (L,R: ROS_TIME_TYPE) return boolean;
function ">=" (L,R: ROS_TIME_TYPE) return boolean;
function "<=" (L,R: ROS_TIME_TYPE) return boolean;
function "=" (L,R: ROS_TIME_TYPE) return boolean;
function "/=" (L,R: ROS_TIME_TYPE) return boolean;
end package; end package;
package body ros_package is package body ros_package is
function gen_duration(s,ns : integer) return ROS_DURATION_TYPE is
variable ret : ROS_DURATION_TYPE := ROS_TIME_ZERO;
constant sec : natural := 10**9;
begin
assert (ns < sec) report "ns argument has to be less than a second" severity failure;
ret.sec := std_logic_vector(to_unsigned(s,ret.sec'length));
ret.nanosec := std_logic_vector(to_unsigned(ns,ret.nanosec'length));
return ret;
end function;
function gen_duration(t : time) return ROS_DURATION_TYPE is
variable seconds : natural;
variable nanoseconds : natural;
begin
-- Extract Seconds
seconds := t / sec;
-- Extract Nanoseconds
nanoseconds := (t - (seconds * sec)) / ns;
return gen_duration(seconds, nanoseconds);
end function;
function to_gid(guid : GUID_TYPE) return GID_TYPE is function to_gid(guid : GUID_TYPE) return GID_TYPE is
variable ret : GID_TYPE; variable ret : GID_TYPE;
begin begin
@ -599,4 +643,34 @@ package body ros_package is
return ret; return ret;
end function; end function;
function ">" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) > to_unsigned(R);
end function;
function "<" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) < to_unsigned(R);
end function;
function ">=" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) >= to_unsigned(R);
end function;
function "<=" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) <= to_unsigned(R);
end function;
function "=" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) = to_unsigned(R);
end function;
function "/=" (L,R: ROS_TIME_TYPE) return boolean is
begin
return to_unsigned(L) /= to_unsigned(R);
end function;
end package body; end package body;

View File

@ -574,6 +574,7 @@ package rtps_package is
end record; end record;
function to_guid(A : GUIDPREFIX_TYPE; B : std_logic_vector(ENTITYID_WIDTH-1 downto 0)) return GUID_TYPE; function to_guid(A : GUIDPREFIX_TYPE; B : std_logic_vector(ENTITYID_WIDTH-1 downto 0)) return GUID_TYPE;
function to_guid(A : std_logic_vector) return GUID_TYPE;
function to_key_hash(A : GUID_TYPE) return KEY_HASH_TYPE; function to_key_hash(A : GUID_TYPE) return KEY_HASH_TYPE;
function to_key_hash(A : std_logic_vector) return KEY_HASH_TYPE; function to_key_hash(A : std_logic_vector) return KEY_HASH_TYPE;
@ -634,7 +635,7 @@ package body rtps_package is
constant sec : natural := 10**9; constant sec : natural := 10**9;
constant half_sec : natural := sec/2; constant half_sec : natural := sec/2;
begin begin
assert (ns < 10**9) report "ns argument has to be less than a second" severity failure; assert (ns < sec) report "ns argument has to be less than a second" severity failure;
ret(0) := to_unsigned(s, WORD_WIDTH); ret(0) := to_unsigned(s, WORD_WIDTH);
-- If Fraction Bit is >= 500 ms it cannot be represented as a natural (because naturals/integers are signed). -- If Fraction Bit is >= 500 ms it cannot be represented as a natural (because naturals/integers are signed).
@ -652,7 +653,6 @@ package body rtps_package is
function gen_duration(t : time) return DURATION_TYPE is function gen_duration(t : time) return DURATION_TYPE is
variable seconds : natural; variable seconds : natural;
variable nanoseconds : natural; variable nanoseconds : natural;
variable tmp : time;
begin begin
-- Extract Seconds -- Extract Seconds
seconds := t / sec; seconds := t / sec;
@ -1044,16 +1044,19 @@ package body rtps_package is
function get_sub_vector (input : std_logic_vector; index : natural; width : natural; invert : boolean) return std_logic_vector is function get_sub_vector (input : std_logic_vector; index : natural; width : natural; invert : boolean) return std_logic_vector is
variable ret : std_logic_vector(width-1 downto 0) := (others => '0'); variable ret : std_logic_vector(width-1 downto 0) := (others => '0');
variable input2 : std_logic_vector(input'length-1 downto 0) := (others => '0');
begin begin
assert(input'length mod width = 0) report "Input Length has to be multiple of width" severity FAILURE; assert(input'length mod width = 0) report "Input Length has to be multiple of width" severity FAILURE;
assert(input'length / width > index) report "Index out of bounds" severity FAILURE; assert(input'length / width > index) report "Index out of bounds" severity FAILURE;
input2 := input; -- Force input to "downto" range
if (invert = TRUE) then if (invert = TRUE) then
-- XXX: Synthesis Hack -- XXX: Synthesis Hack
--ret := input(input'length-(index*width)-1 downto input'length-((index+1)*width)); --ret := input(input'length-(index*width)-1 downto input'length-((index+1)*width));
for i in 0 to (input'length/width)-1 loop for i in 0 to (input'length/width)-1 loop
if (index = i) then if (index = i) then
ret := input(input'length-(i*width)-1 downto input'length-((i+1)*width)); ret := input2(input'length-(i*width)-1 downto input'length-((i+1)*width));
end if; end if;
end loop; end loop;
else else
@ -1061,7 +1064,7 @@ package body rtps_package is
--ret := input(((index+1)*width)-1 downto index*width); --ret := input(((index+1)*width)-1 downto index*width);
for i in 0 to (input'length/width)-1 loop for i in 0 to (input'length/width)-1 loop
if (index = i) then if (index = i) then
ret := input(((i+1)*width)-1 downto i*width); ret := input2(((i+1)*width)-1 downto i*width);
end if; end if;
end loop; end loop;
end if; end if;
@ -1097,4 +1100,15 @@ package body rtps_package is
return ret; return ret;
end function; end function;
function to_guid(A : std_logic_vector) return GUID_TYPE is
variable ret : GUID_TYPE;
begin
assert (A'length = GUID_WIDTH) report "SLV Length missmatch" severity FAILURE;
ret := GUID_UNKNOWN;
for i in 0 to ret'length-1 loop
ret(i) := get_sub_vector(A, i, ret(i)'length, TRUE);
end loop;
return ret;
end function;
end package body; end package body;