<commit_before>/***********************************************************************/
/* Project:    HW-SW SystemC Co-Simulation SoC Validation Platform     */
/*                                                                     */
/* File:       tlm_signal_adapter.h - This file provides adapter to    */
/*             connect tlm_signals with SystemC signals.               */
/*                                                                     */
/* Modified on $Date$   */
/*          at $Revision$                                         */
/*                                                                     */
/* Principal:  European Space Agency                                   */
/* Author:     VLSI working group @ IDA @ TUBS                         */
/* Maintainer: <NAME>                                              */
/***********************************************************************/

#ifndef TLM_SIGNAL_ADAPTER
#define TLM_SIGNAL_ADAPTER

#include "tlm_signal.h"
#include <systemc.h>

template<class INTYPE, class OUTTYPE = INTYPE>
class tlmin_scout_adapter : public tlm_module<tlmin_scout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
  public:
    typename tlm_module<tlmin_scout_adapter<INTYPE, OUTTYPE> >::template signal<INTYPE>::in in;
    sc_out<OUTTYPE > out;

    tlmin_scout_adapter(sc_core::sc_module_name mn)
      : sc_core::sc_module(mn)
      , in(this, &tlmin_scout_adapter::oninput, "IN")
      , out("OUT") {}

  private:
    void oninput(const INTYPE &value, tlm_signal_in_if<INTYPE> *signal, tlm_signal_out_if<INTYPE> *sender, const sc_core::sc_time &time) {
      OUTTYPE o = value;
      out.write(o);
    }

};

template<class INTYPE, class OUTTYPE = INTYPE>
class scin_tlmout_adapter : public tlm_module<scin_tlmout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
public:
  typename tlm_module<scin_tlmout_adapter<INTYPE, OUTTYPE> >::template signal<OUTTYPE>::out out;
  sc_in<INTYPE>     in;

  SC_HAS_PROCESS(scin_tlmout_adapter);
  
  scin_tlmout_adapter(sc_core::sc_module_name mn)
    : sc_core::sc_module(mn)
    , out(this,"OUT")
    , in("IN") {
      
    SC_THREAD(oninput);
    sensitive << in;
  }

private:
  void oninput() {
    INTYPE i = in.read();
    OUTTYPE o = i;
    out = o;
  }
};


template<class INTYPE, class OUTTYPE = INTYPE>
class tlmsc_inout_adapter : public tlm_module<tlmsc_inout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
public:
  typename tlm_module<tlmsc_inout_adapter<INTYPE, OUTTYPE> >::template signal<INTYPE>::inout tlm;
  sc_inout<OUTTYPE>     sc;

  SC_HAS_PROCESS(tlmsc_inout_adapter);
  
  tlmsc_inout_adapter(sc_core::sc_module_name mn)
    : sc_core::sc_module(mn)
    , tlm(this, &tlmsc_inout_adapter::ontlm, "TLM")
    , sc("SC") {
    SC_THREAD(onsc);<commit_msg>tlmsignals - test mistake.<commit_after>/***********************************************************************/
/* Project:    HW-SW SystemC Co-Simulation SoC Validation Platform     */
/*                                                                     */
/* File:       tlm_signal_adapter.h - This file provides adapter to    */
/*             connect tlm_signals with SystemC signals.               */
/*                                                                     */
/* Modified on $Date$   */
/*          at $Revision$                                         */
/*                                                                     */
/* Principal:  European Space Agency                                   */
/* Author:     VLSI working group @ IDA @ TUBS                         */
/* Maintainer: <NAME>                                              */
/***********************************************************************/

#ifndef TLM_SIGNAL_ADAPTER
#define TLM_SIGNAL_ADAPTER

#include "tlm_signal.h"
#include <systemc.h>

template<class INTYPE, class OUTTYPE = INTYPE>
class tlmin_scout_adapter : public tlm_module<tlmin_scout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
  public:
    typename tlm_module<tlmin_scout_adapter<INTYPE, OUTTYPE> >::template signal<INTYPE>::in in;
    sc_out<OUTTYPE > out;

    tlmin_scout_adapter(sc_core::sc_module_name mn)
      : sc_core::sc_module(mn)
      , in(this, &tlmin_scout_adapter::oninput, "IN")
      , out("OUT") {}

  private:
    void oninput(const INTYPE &value, tlm_signal_in_if<INTYPE> *signal, tlm_signal_out_if<INTYPE> *sender, const sc_core::sc_time &time) {
      OUTTYPE o = value;
      out.write(o);
    }

};

template<class INTYPE, class OUTTYPE = INTYPE>
class scin_tlmout_adapter : public tlm_module<scin_tlmout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
public:
  typename tlm_module<scin_tlmout_adapter<INTYPE, OUTTYPE> >::template signal<OUTTYPE>::out out;
  sc_in<INTYPE>     in;

  SC_HAS_PROCESS(scin_tlmout_adapter);
  
  scin_tlmout_adapter(sc_core::sc_module_name mn)
    : sc_core::sc_module(mn)
    , out(this,"OUT")
    , in("IN") {
      
    SC_THREAD(oninput);
    dont_initialize();
    sensitive << in;
  }

private:
  void oninput() {
    INTYPE i = in.read();
    OUTTYPE o = i;
    out = o;
  }
};


template<class INTYPE, class OUTTYPE = INTYPE>
class tlmsc_inout_adapter : public tlm_module<tlmsc_inout_adapter<INTYPE, OUTTYPE> >, public sc_core::sc_module {
public:
  typename tlm_module<tlmsc_inout_adapter<INTYPE, OUTTYPE> >::template signal<INTYPE>::inout tlm;
  sc_inout<OUTTYPE>     sc;

  SC_HAS_PROCESS(tlmsc_inout_adapter);
  
  tlmsc_inout_adapter(sc_core::sc_module_name mn)
    : sc_core::sc_module(mn)
    , tlm(this, &tlmsc_inout_adapter::ontlm, "TLM")
    , sc("SC") {
    SC_THREAD(onsc);
    dont_initialize();
{'fraction_non_alphanumeric': 0.15704958531851068, 'fraction_numerical': 0.0, 'mean_word_length': 2.4268440145102783, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7464149', 'n_tokens_mistral': 1825, 'n_tokens_neox': 1786, 'n_words': 323}