TLM Signal A nonmemory mapped bus model Presenter
TLM Signal A non-memory mapped bus model Presenter: R Swaminathan Authors: R. Swaminathan, Vishal Goel Company/Organization: Texas Instruments
Agenda • • Introduction Prior Art Why tlm_signal? TLM 2 Interoperability Layer – – – • • • Customizing Payload Customizing Interfaces Customizing Sockets Example: Level Interrupt Convenience Socket Sequence Diagram Conclusions References Acknowledgements ISCUG – India System. C User Group 2
Introduction • TLM 2. 0 has enjoyed wide success in standardizing memory mapped bus protocol handling. – AXI, OCP etc • Unfortunately there are many signals that are yet enjoy the benefits of standardization like: – – – Reset Interrupts (edge and level) Power interfaces IO Pins Endian … Memory Mapped Buses Configuration Interrupts Stimulation Clocks Hardware Model Resets and Power Supply Monitoring & Analysis Debugger S - im kernel Interaction Representations of Hardware IFs ISCUG – India System. C User Group 3 Package IFs for Simulation Only
Prior Art • sc_in/sc_out/sc_signal<bool> - OSCI – Delta cycle delay – Low level hardware semantics • Signal Socket - Green. Socs – Feature rich, but needs supporting Green. Socs infrastructure like Green. Socket etc. • sc_wire – Cadence/ST Microelectronics – Does away with delta-cycle delay – Does not support optional extensions (based on TLM 1. 0) ISCUG – India System. C User Group 4
Why tlm_signal? • No delta cycle delay to transport values across • Data value typically bool, but should be customizable for other datatypes too. • Should permit optional payload values to carry useful attributes and/or debug information • Leverage the benefits of TLM 2 standard (through reuse) – TLM base communication protocol – TLM extensions – TLM error codes – Performance (memory manager) ISCUG – India System. C User Group 5
TLM 2 Interoperability Layer 1. Generic Payload Customiz Command e Address Data Byte Enables 2. Core interfaces and sockets Response Status Extensions Initiator Customiz e Target Customiz e 3. Base Protocol BEGIN_REQ END_REQ BEGIN_RESP END_RESP ISCUG – India System. C User Group 6
Customize Payload tlm 2 1. Generic Payload Command Address Data Byte Enables Response Status traits Extensions struct tlm_base_protocol_types { typdef generic_payload tlm_payload_type; typedef tlm_phase_type; }; Customization tlm_signal_gp<SIG=bool> Command signal: SIG Response Status Extensions template<typename SIG=bool> struct tlm_signal_base_protocol_types { typedef SIG tlm_signal_type; typdef tlm_signal_gp<tlm_signal_type> tlm_payload_type; typedef tlm_phase_type; }; 1. Drop non-signal related attributes like addr, byte_en, stream_width, data_ptr etc. 2. Add 1. Templatized payload with Signal type (default to bool) and add access functions to set/get signal 3. Restrict 1. tlm_command: TLM_WRITE_COMMAND, TLM_IGNORE_COMMAND. 2. tlm_response_status: TLM_OK_RESPONSE, TLM_COMMAND_ERROR_REPONSE, TLM_INCOMPLETE_RESPONSE, TLM_GENERIC_ERROR_REPONSE 4. Reuse 1. Everything else like memory manager, extensions etc. ISCUG – India System. C User Group 7
Customize Interfaces 2. Core interfaces and sockets Initiator Target tlm 2 tlm_signal Customization class tlm_fw_transport_if class tlm_signal_fw_transport_if 1. Drop 1. tlm_fw_direct_mem_if, tlm_bw_direct_mem_if, tlm_transport_dbg_if 2. Change 1. Instead of TYPES being templatized on tlm_base_protocol_types, these are now templatized on tlm_signal_base_protocol_types<>. 3. Reuse 1. Semantics 2. Phase restricted to BEGIN_REQ and END_REQ b_transport nb_transport_fw get_direct_mem_ptr transport_dbg class tlm_bw_transport_if nb_transport_bw invalidate_direct_mem_ptr b_transport nb_transport_fw class tlm_signal_bw_transport_if nb_transport_bw ISCUG – India System. C User Group 8
Customize Sockets tlm 2 tlm_base_initiator_socket <BW, FW_IF, BW_IF, N, POL> tlm_initiator_socket <BW, TYPES= tlm_base_protocol_types, N, POL> : tlm_base_initator_socket<BW, tlm_fw_transport_if<TYPES>, tlm_signal_initiator_socket <SIG=bool, TYPES= tlm_signal_base_protocol_types<SIG>, N, POL> : tlm_base_initiator_socket<0, tlm_signal_fw_transport_if<TYPES>, tlm_signal_bw_transport_if<TYPES>, N, POL> tlm_bw_transport_if<TYPES, N, POL> tlm_base_target_socket <BW, FW_IF, BW_IF, N, POL> tlm_target_socket <BW, TYPES= tlm_base_protocol_types, N, POL> : tlm_base_target_socket<BW, tlm_fw_transport_if<TYPES>, tlm_signal_target_socket <SIG=bool, TYPES= tlm_signal_base_protocol_types<SIG>, N, POL> : tlm_base_target_socket<0, tlm_signal_fw_transport_if<TYPES>, tlm_signal_bw_transport_if<TYPES>, N, POL> tlm_bw_transport_if<TYPES, N, POL> ISCUG – India System. C User Group 9
Example: Level Interrupt Convenience Socket Initiator Target level_interrupt_initiator level_interrupt_target +set_interrupt(active: bool) +register_interrupt_cb(cb_type): void +prop: sc_attr_cltn typedef boost: : function<void(bool)>cb_type; Extensions ISCUG – India System. C User Group 10 1. Simplified interfaces 1. Initiator calls set_interrupt(active=true/false) and target handles the same. 2. Ease of integration 1. Integrator does not have to bother about conversions between activehigh/active-low connections. 2. If such information is required, it may be captured as attributes of sockets and interpreted accordingly. 3. Extensibility 1. If this utility socket needs to be connected to some IP that needs such information, it may be communicated via extensions.
Sequence Diagram w/o ack Initiator (convenience) set_interrupt(true) : TLM_COMPLETED set_interrupt(true) w/ ack nb_transport_fw(sig_gp, BEG_REQ, delay) Target (convenience) handle_interrupt(bool active) nb_transport_fw(sig_gp, BEG_REQ, delay) handle_interrupt(bool active) : TLM_ACCEPTED handle_ack() nb_transport_bw(sig_gp, END_REQ, delay) : TLM_COMPLETED ISCUG – India System. C User Group 11 send_ack()
Conclusions • tlm_signal presents a minimal set of TLM 2 payload/interfaces selected to achieve the required functionality. • It also offers reduced learning curve as TLM 2 semantics is reused to large extent. • There is a need to standardize on the non-memory mapped bus signals, and tlm_signal is presented as a candidate towards achieving the same. ISCUG – India System. C User Group 12
References • • • System. C Reference Manual - Accellera sc_wire – Cadence/ST Microelectronics Signal. Socket – Green. Socs ISCUG – India System. C User Group 13
Acknowledgements • Anonymous reviewers of the ISCUG Abstract for their many insightful comments. • Tor Jeremiassen, Amit Nene and Nizamudheen A, Texas Instruments, for their providing their valuable inputs on this presentation. ISCUG – India System. C User Group 14
- Slides: 14