Interaction of SystemC AMS Extensions with TLM 2.0 Markus Damm, Christoph Grimm Institut für Computertechnik ICT Vienna University of Technology Martin Barnasconi NXP Semiconductors Institute of Computer Technology 10.03.2016 1 Embedded AMS systems Receiver Modulator/ AMS-TLM demod. DSP interface Serial Interface ADC Calibration & Control Antenna front-end SystemC AMS Transmitter DAC RF detector Microcontroller Temp. sensor Oscillator Host processor SystemC TLM Memory Imaging DSP Audio DSP High Speed Serial Interface to all blocks Clock Generator Power Management Tight interaction between AMS and digital HW/SW sub-systems Dedicated interfaces between analog and digital domain How should a TLM AMS interface be defined? Institut für Computertechnik 10.03.2016 2 SystemC AMS TDF …implies a samling period of 20 s here! Sine-source e.g. sampling period of 2 ms here… A B 50 20 s 20 s 100 1 1 Bit-source C 100 20 s 20 2 ms Modulation 2 ms data rates s 1 D Environment “TDF-Cluster“ Schedule: B A A C D…D 100x Timed DataFlow – Synchronous Dataflow with timing annotation Enables static scheduling – fast simulation of sampled analog signals at discrete time points Sampling period associated to token production/consumption Institut für Computertechnik 10.03.2016 3 SystemC AMS – SystemC synchronization SystemC AMS has its own execution semantics and simulation time synchronization needs! SystemC AMS provides converter ports which allows TDF modules to connect to usual SystemC Discrete Event signals. Accessing these ports triggers synchronization to SystemC kernel Note: SystemC AMS is temporally decoupled, similar to the TLM 2.0 loosely timed coding style! tTDF 26 ms 32 ms 38 ms 26 ms 32 ms 38 ms TDF-module 2 ms token valid at 26 28 30 32 34 36 38 40 42 ms rate 3 3 ms rate 2 26 29 32 35 38 41 ms tDE 20 ms 38 ms 20 ms 38 ms synchronization tTDF ↔ tDE Note that tTDF tDE always holds! Institut für Computertechnik 10.03.2016 If the data rate is > 1, the data token even “warp ahead“ tTDF ! 4 Requirements for AMS-TLM interface Avoid “signal-level” interface (DETDF converter ports) between AMS and TLM Create direct interface between AMS Timed Data Flow and TLM 2.0 Loosely-timed coding style avoid unnecessary kernel context switching maintain concept of “loosely coupled independent processes”: avoid strict timing synchronization between processes maintain temporal decoupling for both engines efficient packing an unpacking of “analog samples” (data) in/from transactions Introduction of specialized converter modules / channels can be instantiated and configured by the user part of design refinement methodology Institut für Computertechnik 10.03.2016 5 Basic idea of a generic TLMTDF converter TLM Interconnect TLMTDF converter input-buffer dummy DE signal output-buffer TDF TDFCLUSTER TDF sub module sub mod ule DETDF converter port WRITE transaction data is streamed to TDF cluster directly Incoming TDF “samples” are passed to READ transactions The converter has to be part of the TDF-cluster Transactions mostly won’t come in regularly We use buffers which are accessed via transactions The TDF cluster might run ahead too far in time We need synchronization means! …and: what means “too far” exactly? Institut für Computertechnik 10.03.2016 6 Implementation Our current conversion approach assumes loosely timed initiators Blocking interface, no backward path used Initiators may use temporal decoupling Issues: Transactions may arrive out of order (delays) we need buffers which also keep timing information If a write-transaction has a delay annotation, the converter doesn’t know if the buffer has enough space by that time we need a projected free buffer space concept TLM and TDF might warp ahead too much of each other we need to trigger synchronization Institut für Computertechnik 10.03.2016 7 TLMTDF converter implementation WRITE-transactions TLM Interconnect TDF TLM TDF converter sub module TDFCLUSTER output-buffer The output buffer keeps the timestamp of the transaction the respective data was sent with (similar to payload event queue). If the TDF sub-module fires, it uses only data with a timestamp the current SystemC AMS time If an incoming transaction has a delay > 0, a projected free buffer space is computed the transaction is returned with an error if the (projected) free buffer space is too small for the data Synchronization: buffer underrun Institut für Computertechnik 10.03.2016 8 TDFTLM converter implementation READ-transactions TLM Interconnect TDF TDF TLM converter sub module TDFCLUSTER input-buffer If the TDF submodule fires, the incoming data token are copied into the input buffer (usual FIFO). We store only the timestamp of the oldest buffer token Transactions are annotated with an delay according to the timestamp of the youngest token returned If buffer holds not enough data for the read request, an error is returned Synchronization: buffer overflow Institut für Computertechnik 10.03.2016 9 Conclusion / future work Connecting TLM2 and SystemC AMS models makes sense regarding the design of mixed signals SoCs Efficient communication between AMS and digital HW/SW part Sophisticated synchronization TLM2 temporal decoupling processes can work well together with SystemC AMS statically scheduled TDF processes. The presented work is a technical feasibility analysis, more groundwork has to be done. Study Approximately-timed initiators and converter channels Apply methods to Real-life demonstrator Institut für Computertechnik 10.03.2016 10 Thank you for your attention! Your: questions comments ideas objections Institut für Computertechnik 10.03.2016 11