Troubleshooting GUI Stalls and Git Updates in Wrpc-sw Repository
Resolve issues related to GUI stalls and Git updates in the Wrpc-sw repository. Includes guidance on checking out specific commits, submodule initialization, and updating. Also addresses update functions, state management, and configuration settings in the code.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Wrpc-sw -> proposed-master Make -> GUI stalls in WAIT_OFFSET_STABLE Copy of (old feb 2015) 150GB disk /peterj/CLBv2_peter/sw/embedded/wrpc- spec-sw proposed-master works fine
Wrpc-sw Git checkout 0e8b222 Git submodule init Git submodule update Works Git checkout proposed_master WAIT_OFFSET_STABLE ppsi
Thus: Git checkout 0e8b222 Git submodule init Git submodule update Checks out ppsi da4979d And: Git checkout proposed_master Git submodule init Git submodule update Checks out ppsi b8ebe5f
net.c wrc_main.c void update_rx_queues() { struct my_socket *s = NULL; struct sockq *q; | case LINK_UP: update_rx_queues(); | case LINK_WENT_DOWN: if (wrc_ptp_get_mode() == WRC_MODE_SLAVE) { spll_init(SPLL_MODE_FREE_RUNNING_MASTER, 0, 1); shw_pps_gen_enable_output(0); } break; } fsm.c wrc_ptp_ppsi.c int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen) { struct pp_state_table_item *ip; int state, err = 0; | int wrc_ptp_update() { int i; struct pp_instance *ppi = &ppi_static; | i = __recv_and_count(ppi, ppi->rx_frame, PP_MAX_FRAME_LENGTH - 4, &ppi->last_rcv_time); ui_update(); wrc_ptp_update(); spll_update(); check_stack(); if ((!i) && (timer_get_tics() - start_tics < delay_ms)) return 0; if (!i) { /* Nothing received, but timeout elapsed */ start_tics = timer_get_tics(); delay_ms = pp_state_machine(ppi, NULL, 0); return 0; } delay_ms = pp_state_machine(ppi, ppi->rx_ptp, i); return 0; } diag-macros.h
enum pp_diag_things { pp_dt_fsm pp_dt_time too */ pp_dt_frames pp_dt_servo pp_dt_bmc pp_dt_ext pp_dt_config = 7, = 6, /* level 1: set and timeouts, 2: get_time = 5, /* level 1: send/recv, 2: dump contents */ = 4, = 3, = 2, = 1,}; frames config servo time bmc fsm ext Verbose Verbose Verbose 1 0 2 0 1 0 0 0 2 = example in PPSi Manual (FSM at level 1 and frames at level 2) = example in PPSi Manual (level 1 for time) = prints raw timestamp info!
frames config servo time bmc fsm ext Verbose 1 0 1 2
frames config servo time bmc fsm ext Verbose 0 0 1
frames config servo time bmc fsm ext Verbose 0 0 1 Mode master already enables PPS_o SPEC Loopback ppsi/proto-standard/state-master.c //if (plen == 0) // goto out; /* * An extension can do special treatment of this message type, * possibly returning error or eating the message by returning * PPM_NOTHING_TO_DO */ msgtype = PPM_NOTHING_TO_DO; /* msgtype = ppi->received_ptp_header.messageType; if (pp_hooks.master_msg) msgtype = pp_hooks.master_msg(ppi, pkt, plen, msgtype); if (msgtype < 0) { e = msgtype; goto out_fault; } */ So far so good, but not yet timestamps and WR is OFF
ppsi/proto-standard/hooks.c static int wr_init(struct pp_instance *ppi, unsigned char *pkt, int plen) { struct wr_dsport *wrp = WR_DSPOR(ppi); pp_diag(ppi, ext, 2, "hook: %s\n", __func__); wrp->wrStateTimeout = WR_DEFAULT_STATE_TIMEOUT_MS; wrp->calPeriod = WR_DEFAULT_CAL_PERIOD; //wrp->wrModeOn = 0; wrp->wrModeOn = 1; //wrp->parentWrConfig = NON_WR; wrp->parentWrConfig = WR_MASTER; //wrp->parentWrModeOn = 0; wrp->parentWrModeOn = 1; wrp->calibrated = !WR_DEFAULT_PHY_CALIBRATION_REQUIRED;
Goal: loopback mode Master and generate Announce message once per second ppsi/proto-standard/state-master.c /* The real state function, relying on the two above for sending */ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen) { int msgtype, d1, d2; int e = 0; /* error var, to check errors in msg handling */ if (ppi->is_new_state) { pp_timeout_rand(ppi, PP_TO_SYNC, DSPOR(ppi)->logSyncInterval); pp_timeout_rand(ppi, PP_TO_ANN_INTERVAL, DSPOR(ppi)->logAnnounceInterval); Announce messages At startup /* Send an announce immediately, when becomes master */ if ((e = pp_master_issue_announce(ppi)) < 0) goto out; } // if (pp_timeout_z(ppi, PP_TO_SYNC)) { // /* Restart the timeout for next time */ // pp_timeout_rand(ppi, PP_TO_SYNC, DSPOR(ppi)->logSyncInterval); // // if ((e = pp_master_issue_sync_followup(ppi) < 0)) // goto out; // // } if (pp_timeout_z(ppi, PP_TO_ANN_INTERVAL)) { if ((e = pp_master_issue_announce(ppi) < 0)) goto out; Only periodically Announce messages /* Restart the timeout for next time */ pp_timeout_rand(ppi, PP_TO_ANN_INTERVAL, DSPOR(ppi)->logAnnounceInterval); }
Resulting screenshots Announce messages once per second Mode master already enables PPS_o frames config servo time bmc fsm ext Verbose 0 0 1 Next step: t1 and t4 must be printed in the low level net.c routines SPEC Loopback
Goal: loopback mode Master and generate Announce message once per second ppsi/proto-standard/common-fun.h static inline int __send_and_log(struct pp_instance *ppi, int msglen, int msgtype, int chtype) { if (ppi->n_ops->send(ppi, ppi->tx_frame, msglen + ppi->tx_offset, &ppi->last_snt_time, chtype, 0) < msglen) { pp_diag(ppi, frames, 1, "%s(%d) Message can't be sent\n", pp_msg_names[msgtype], msgtype); return PP_SEND_ERROR; } /* FIXME: diagnosticst should be looped back in the send method */ pp_diag(ppi, frames, 1, "SENT %02d bytes at %d.%09d.%d (%s)\n", msglen, (int)(ppi->last_snt_time.seconds), (int)(ppi->last_snt_time.nanoseconds), (int)(ppi->last_snt_time.phase), pp_msg_names[msgtype]); if (chtype == PP_NP_EVT && ppi->last_snt_time.correct == 0) return PP_SEND_NO_STAMP; Add phase info to SENT message ppsi/fsm.c int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen) { struct pp_state_table_item *ip; int state, err = 0; Diff: 336 ns + 5611 if (plen) pp_diag(ppi, frames, 1, "RECV %02d bytes at %d.%09d.%d (type %x, %s)\n", plen, (int)ppi->last_rcv_time.seconds, (int)ppi->last_rcv_time.nanoseconds, (int)ppi->last_rcv_time.phase, packet[0] & 0xf, pp_msg_names[packet[0] & 0xf]); Add phase info to RECV message
Goal: loopback mode Master and generate Announce message once per second Stat bts loopback loopback Loopback +0 mtr +1 mtr 336 336 344 336 344 336 336 336 +30 mtr 0 0 4000 0 4000 5600 5600 1600 2400 5600 Different bitslide 8 ns extra? 1 meter fiber, both 336 ns Or difference is 5600 ps via bitslide? 480 480
wrc_main .c -> wrc_ptp_init() Wrc_ptp_ppsi.c doesn t do much -> wrc_ptp_set_mode(WRC_MODE_MASTER) wrp->wrConfig = WR_M_ONLY; ppi->role = PPSI_ROLE_MASTER; spll_init(SPLL_MODE_FREE_RUNNING_MASTER, 0, 1); pp_printf("Locking PLL"); -> wrc_ptp_start pp_init_globals(&ppg_static, &__pp_default_rt_opts); /* Call the state machine. Being it in "Initializing" state, make * ppsi initialize what is necessary */ delay_ms = pp_state_machine(ppi, NULL, 0); start_tics = timer_get_tics(); WR_DSPOR(ppi)->linkUP = FALSE; wr_servo_reset(); -> wrc_ptp_update() Wrc_ptp_ppsi.c = type pp_globals Definedin pp- instance.h = type pp_runtime_opts Wrc_ptp_ppsi.c proto-standard/open-close.c = Definedin fsm.c NULL Wrc_ptp_ppsi.c Fsm.c Is called in wrc_ptp_update (defined in wrc_ptp_ppsi.c ) as => int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen) delay_ms = pp_state_machine(ppi, ppi->rx_ptp, i)
add_TimeInternal(proto_standard/arith.c) time_snt = time_snt + outbound_latency = last_snt_time = SYNC t1 from_TimeInternal(proto_standard/arith.c) &tstamp = time_snt seconds/nanoseconds (default 0.0)
frames config servo time bmc fsm SENT SYNC ext Diff: 5628192 ??? Verbose 2 2 2 2 now: 0x0555 = 1365 0x1027de60 = 271048288 SYNC sent @ 276676480 = PTP-t1 This info is put into FOLLOW_UP SENT FOLLOW_UP 0x0555 = 1365 0x1027de60 = 276676480 RECV SYNC Receivedat 276676824 With PTP-t1 = 276676480
msg_issue_sync_followup (defined in proto_standard\msg.c) Modified to strip away followup and print PTP-t1 PTP-t1 SPEC Loopback SYNC mesage PTP-t4 PTP-t1 (type TimeInternaldefinedin ppsi\ieee1588_types.h)
defined in proto-standard\msg.c Msg_issue_syn_followup = sent, phase is set 0 defined in time-wrpc\wrc-socket.c No FOLLOW_UP wrpc_net_send wrpc_net_recv Phase *always* 5611 also with different fiber loopback length. Why? Couples to ptpd_netif_recvfrom Defined in lib/net.c See next slide (defined in proto-standard\common-fun.h)
Receive Phase *always* 5611 Why? defined in lib/net.c ptpd_netif_recvfrom defined in time-wrpc\wrc-socket.c wrpc_net_send wr_timestamp_t defined in include\ptpd_netif.h renamed to _wr_timestamp Always the 0. Why? ptpd_netif_linearize_rx_timestamp defined in lib/net.c See next slide
So here the recv phase is put into place defined in lib/net.c 8000 2389 = 5611 Always the same since dmtd_phase = 0 always defined in lib/softpll/softpll_ng.c defined in lib/include/spll_defs.h
defined in lib/softpll/softpll_ptracker.h defined in lib/softpll/softpll_ng.c What about these? Initializedbut never started nor Updated... ptracker_init() called by: spll_init() ptracker_start() called by: void spll_enable_ptracker(int ref_channel, int enable) (softpll_ptracker.c) called by: int wrpc_spll_locking_enable(struct pp_instance *ppi) (wrpc_spll.c) -> maps to wr_operations .locking_enable int wrpc_spll_enable_ptracker(struct pp_instance *ppi) (wrpc_spll.c) -> maps tp wr_operations .enable_ptracker static inline void start_ptrackers(struct softpll_state *s) (softpll_ptracker.c) defined in ppsi/proto-ext-whiterabbit/state_wr-link-on.c defined in ppsi/proto-standard/state_initializing.c Instead of going to state MASTER directly, go and set WR_LINK_ON first
Conclusion: modifications ppsi/proto-standard/state_master.c Remove ANNOUNCE message Only sent SYNC Only sent SYNC Remove ANNOUNCE message See next slide
ppsi/proto-standard/msg.c Remove FOLLOW_UP message ppsi/proto-standard/state-initializing.c Essential! First initialize and enable Phase Tracker before going to PPS_MASTER otherwise Rx Phase will always read 0
ppsi/fsm.c ppsi/proto-standard/common-fun.h Not mandatory: Add phase to RX diagnostics Not mandatory: Add phase to TX diagnostics (by the way: always 0) ppsi/time-wrpc/wrpc-socket.c Not mandatory: Not mandatory: Also bitslide info is needed! Add phase to TX and RX net_send Add phase to TX and RX net_send