Update the TLM2 protocol checker to the newest version from Doulos

Basically it changes:
	1. Update error messages refer to IEEE std 1666-2011
	2. Add DMI post check
	3. Add check for Generic Payload Option in various checks
	4. Minor bug fix
More information, take a look at its source code prelude comments
This commit is contained in:
Thanh Tran
2016-11-04 22:04:41 +01:00
parent f02c7169eb
commit 369f7153a9

View File

@@ -2,7 +2,7 @@
// Filename: tlm2_base_protocol_checker.h
//----------------------------------------------------------------------
// Copyright (c) 2008 by Doulos Ltd.
// Copyright (c) 2008-2013 by Doulos Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,11 +19,19 @@
// Author: John Aynsley, Doulos
// Version 1, 11 July 2008
// Version 2, 16 July 2008 Only generate ref_count > 1 warning from 1st checker of path
// Version 3, 17 July 2008 Support compilation under SystemC 2.1.v1
// Version 4, 12 Aug 2008 Add header #include <map>
// Version 5, 08 Sep 2008 Fix bugs in message text
// Version 1, 11 July 2008
// Version 2, 16 July 2008 Only generate ref_count > 1 warning from 1st checker of path
// Version 3, 17 July 2008 Support compilation under SystemC 2.1.v1
// Version 4, 12 Aug 2008 Add header #include <map>
// Version 5, 08 Sep 2008 Fix bugs in message text
// Version 6, 01 Aug 2010 Update messages to refer to OSCI TLM-2.0 LRM of July 2009
// Version 7, 25 Oct 2011 Minor bug fix for certain compilers: replace u_char with uchar_t
// Version 8, 02 Nov 2011 Support the endianness conversion functions by excluding the
// tlm_endian_context extension from the protocol checks
// Version 9, 17 Aug 2012 Fix LRM reference on line 805 (should be 8.2.11 a) [NOT YET RELEASED]
// Version 10, 3 Jan 2013 Updated messages to refer to IEEE Std 1666-2011, the combined SystemC + TLM-2.0 LRM
// Added checks related to the generic payload option attribute
// Version 11, 14 Mar 2016 Fix minor bug - start_phase should be a copy, not a reference
// TLM-2.0 Base Protocol Compliance Checker
@@ -100,6 +108,10 @@ The BEGIN_RESP path must be the reverse of the BEGIN_REQ path
Transaction object must not be sent with BEGIN_REQ while participating in a previous response
Interconnect component must not set response status attribute to TLM_OK_RESPONSE
Interconnect component must not modify data array on the response path
Generic payload option attribute (IEEE Std 1666-2011, SystemC 2.3.x)
gp_option must be properly initialized and only used for DMI and debug transport
When gp_option is used, other gp attributes must be initalized and used as per the transport interfaces
*/
@@ -115,7 +127,7 @@ using std::endl;
using std::dec;
using std::hex;
#include <tlm.h>
#include "tlm.h"
#include <sstream>
#include <map>
@@ -186,7 +198,7 @@ public:
virtual tlm::tlm_sync_enum nb_transport_fw(
tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_core::sc_time& delay)
{
tlm::tlm_phase& start_phase = phase;
tlm::tlm_phase start_phase = phase;
if (num_checks)
nb_transport_fw_pre_checks( trans, phase, delay );
@@ -233,6 +245,8 @@ public:
bool status;
status = initiator_socket->get_direct_mem_ptr( trans, dmi_data );
get_direct_mem_ptr_post_checks( trans, dmi_data );
return status;
}
@@ -280,9 +294,12 @@ private:
void check_initial_state( tlm::tlm_generic_payload& trans, const char* txt2 );
void check_trans_not_modified( tlm::tlm_generic_payload& trans, const char* txt2 );
void check_response_path( tlm::tlm_generic_payload& trans, const char* txt2 );
void remember_gp_option( tlm::tlm_generic_payload& trans );
void get_direct_mem_ptr_pre_checks( tlm::tlm_generic_payload& trans, tlm::tlm_dmi& dmi_data );
void get_direct_mem_ptr_post_checks( tlm::tlm_generic_payload& trans, tlm::tlm_dmi& dmi_data );
void transport_dbg_pre_checks( tlm::tlm_generic_payload& trans );
void transport_dbg_post_checks( tlm::tlm_generic_payload& trans, unsigned int count );
@@ -333,7 +350,7 @@ b_transport_pre_checks(
if ( trans.has_mm() && trans.get_ref_count() == 0)
{
txt << "Transaction passed to b_transport with memory manager and reference count of 0";
tlm2error(trans, "6.5 s)");
tlm2error(trans, "14.5 t)");
}
check_initial_state(trans, "b_transport");
@@ -341,14 +358,14 @@ b_transport_pre_checks(
if (sc_core::sc_get_current_process_handle().proc_kind() == sc_core::SC_METHOD_PROC_)
{
txt << "b_transport called from method process";
tlm2error(trans, "4.1.1.4 b)");
tlm2error(trans, "11.1.1.4 b)");
}
#endif
if (m_map[&trans].ph > 0 && m_map[&trans].ph < 4)
{
txt << "b_transport called during a sequence of nb_transport calls";
tlm2error(trans, "7.2.5 k)");
tlm2error(trans, "15.2.10 c)");
}
}
@@ -370,12 +387,12 @@ nb_transport_fw_pre_checks(
if ( !trans.has_mm() )
{
txt << "Transaction passed to nb_transport_fw with no memory manager set";
tlm2error(trans, "6.5 h)");
tlm2error(trans, "14.5 i)");
}
if ( trans.get_ref_count() == 0)
{
txt << "Transaction passed to nb_transport_fw with reference count of 0";
tlm2error(trans, "6.5 s)");
tlm2error(trans, "14.5 t)");
}
switch (phase)
@@ -386,20 +403,20 @@ nb_transport_fw_pre_checks(
if (m_map[&trans].ph > 0 && m_map[&trans].ph < 4) // END_RESP -> BEGIN_REQ is legal
{
txt << "Phase " << phase << " sent out-of-sequence on forward path, detected in nb_transport_fw";
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
}
if (m_request_in_progress)
{
txt << "Transaction violates BEGIN_REQ exclusion rule, detected in nb_transport_fw";
tlm2error(trans, "7.2.4 b)");
tlm2error(trans, "15.2.6 e)");
}
m_request_in_progress = &trans;
if (m_map[&trans].b_call)
{
txt << "nb_transport_fw called during a b_transport call";
tlm2error(trans, "7.2.5 k)");
tlm2error(trans, "15.2.10 c)");
}
break;
@@ -407,14 +424,14 @@ nb_transport_fw_pre_checks(
case tlm::BEGIN_RESP:
case tlm::UNINITIALIZED_PHASE:
txt << "Phase " << phase << " sent on forward path, detected in nb_transport_fw";
tlm2error(trans, "7.2.3 d)");
tlm2error(trans, " 15.2.3 c)");
break;
case tlm::END_RESP:
if (m_map[&trans].ph != tlm::BEGIN_RESP)
{
txt << "Phase " << phase << " sent out-of-sequence on forward path, detected in nb_transport_fw";
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
}
m_response_in_progress = 0;
break;
@@ -428,7 +445,7 @@ nb_transport_fw_pre_checks(
txt << "nb_transport_fw called with decreasing timing annotation:"
<< " delay = " << delay
<< ", sc_time_stamp() + delay from previous call = " << m_map[&trans].time;
tlm2error(trans, "7.2.5 e)");
tlm2error(trans, "15.2.7 c)");
}
m_map[&trans].time = sc_core::sc_time_stamp() + delay;
}
@@ -469,12 +486,12 @@ nb_transport_bw_pre_checks(
if ( !trans.has_mm() )
{
txt << "Transaction passed to nb_transport_bw with no memory manager set";
tlm2error(trans, "6.5 h)");
tlm2error(trans, "14.5 i)");
}
if ( trans.get_ref_count() == 0)
{
txt << "Transaction passed to nb_transport_bw with reference count of 0";
tlm2error(trans, "6.5 s)");
tlm2error(trans, "14.5 t)");
}
nb_transport_response_checks(
trans, phase, delay, "backward", "nb_transport_bw called", "nb_transport_bw");
@@ -492,21 +509,21 @@ nb_transport_bw_post_checks(
{
case tlm::BEGIN_REQ:
txt << "Phase " << phase << " sent out-of-sequence on (backward) return path, detected in nb_transport_bw";
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
break;
case tlm::END_REQ:
case tlm::BEGIN_RESP:
case tlm::UNINITIALIZED_PHASE:
txt << "Phase " << phase << " sent on (backward) return path, detected in nb_transport_bw";
tlm2error(trans, "7.2.3 d)");
tlm2error(trans, "15.2.3 c)");
break;
case tlm::END_RESP:
if (m_map[&trans].ph != tlm::BEGIN_RESP)
{
txt << "Phase " << phase << " sent out-of-sequence on (backward) return path, detected in nb_transport_bw";
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
}
m_response_in_progress = 0;
@@ -521,7 +538,7 @@ nb_transport_bw_post_checks(
txt << "Return from nb_transport_bw with decreasing timing annotation:"
<< " delay = " << delay
<< ", sc_time_stamp() + delay from previous call = " << m_map[&trans].time;
tlm2error(trans, "7.2.5 e)");
tlm2error(trans, "15.2.7 c)");
}
m_map[&trans].time = sc_core::sc_time_stamp() + delay;
}
@@ -551,7 +568,7 @@ nb_transport_response_checks(
{
txt << "Interconnect component sets response status attribute to TLM_OK_RESPONSE"
<< ", detected in " << txt4;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
@@ -562,7 +579,7 @@ nb_transport_response_checks(
case tlm::UNINITIALIZED_PHASE:
txt << "Phase " << phase << " sent on " << txt2 << " path"
<< ", detected in " << txt4;
tlm2error(trans, "7.2.3 d)");
tlm2error(trans, "15.2.3 c)");
break;
case tlm::END_REQ:
@@ -570,7 +587,7 @@ nb_transport_response_checks(
{
txt << "Phase " << phase << " sent out-of-sequence on " << txt2 << " path"
<< ", detected in " << txt4;
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
}
m_request_in_progress = 0;
@@ -581,7 +598,7 @@ nb_transport_response_checks(
{
txt << "Phase " << phase << " sent out-of-sequence on " << txt2 << " path"
<< ", detected in " << txt4;
tlm2error(trans, "7.2.3 i)");
tlm2error(trans, "15.2.4");
}
if (&trans == m_request_in_progress)
@@ -591,7 +608,7 @@ nb_transport_response_checks(
{
txt << "Transaction violates BEGIN_RESP exclusion rule"
<< ", detected in " << txt4;
tlm2error(trans, "7.2.4 c)");
tlm2error(trans, "15.2.6 f)");
}
m_response_in_progress = &trans;
@@ -607,7 +624,7 @@ nb_transport_response_checks(
txt << txt3 << " with decreasing timing annotation:"
<< " delay = " << delay
<< ", sc_time_stamp() + delay from previous call = " << m_map[&trans].time;
tlm2error(trans, "7.2.5 e)");
tlm2error(trans, "15.2.7 c)");
}
m_map[&trans].time = sc_core::sc_time_stamp() + delay;
}
@@ -628,38 +645,43 @@ check_initial_state(
{
txt << "New transaction passed to " << txt2 << " with reference count = "
<< trans.get_ref_count();
tlm2error(trans, "6.5 s)", true);
tlm2error(trans, "14.5 t)", true);
}
if (trans.get_data_ptr() == 0)
if (trans.get_data_ptr() == 0 && trans.get_command() != tlm::TLM_IGNORE_COMMAND)
{
txt << "Transaction not properly initialized: data_ptr == 0, detected in " << txt2;
tlm2error(trans, "6.10 e)");
tlm2error(trans, "14.11 e)");
}
if (trans.get_data_length() == 0)
if (trans.get_data_length() == 0 && trans.get_command() != tlm::TLM_IGNORE_COMMAND)
{
txt << "Transaction not properly initialized: data_langth == 0, detected in " << txt2;
tlm2error(trans, "6.11 d)");
tlm2error(trans, "14.12 d)");
}
if (trans.get_byte_enable_ptr() != 0 && trans.get_byte_enable_length() == 0)
{
txt << "Transaction not properly initialized: "
<< "byte_enable_ptr != 0 and byte_enable_length == 0, detected in " << txt2;
tlm2error(trans, "6.13 f)");
tlm2error(trans, "14.14 f)");
}
if (trans.get_streaming_width() == 0)
{
txt << "Transaction not properly initialized: streaming_width == 0, detected in " << txt2;
tlm2error(trans, "6.14 f)");
tlm2error(trans, "14.15 f)");
}
if (trans.is_dmi_allowed())
{
txt << "Transaction not properly initialized: dmi_allowed == true, detected in " << txt2;
tlm2error(trans, "6.15)");
tlm2error(trans, "14.16");
}
if (trans.get_response_status() != tlm::TLM_INCOMPLETE_RESPONSE)
{
txt << "Transaction not properly initialized: response_status != TLM_INCOMPLETE_RESPONSE, detected in " << txt2;
tlm2error(trans, "6.16 e)");
tlm2error(trans, "14.17 e)");
}
if (trans.get_gp_option() != tlm::TLM_MIN_PAYLOAD)
{
txt << "Transaction not properly initialized: gp_option != TLM_MIN_PAYLOAD, detected in " << txt2;
tlm2error(trans, "14.8 g)");
}
// Setup clones of transaction and buffers in map
@@ -696,13 +718,26 @@ check_initial_state(
if (shared_map[&trans].response_in_progress)
{
txt << "Transaction object sent with BEGIN_REQ while still being used on a previous response path, detected in " << txt2;
tlm2error(trans, "6.5");
tlm2error(trans, "14.5 x)");
}
shared_map[&trans].ok_response = false;
shared_map[&trans].path.push_back(this);
}
BOILERPLATE
remember_gp_option(
tlm::tlm_generic_payload& trans)
{
// Setup clone of transaction in map in order to check gp_option only
tlm::tlm_generic_payload* gp = m_map[&trans].gp;
if (gp == 0)
gp = new tlm::tlm_generic_payload; // Memory leak: transactions are never cleared from map
gp->set_gp_option( trans.get_gp_option() );
m_map[&trans].gp = gp;
}
BOILERPLATE
check_trans_not_modified(
tlm::tlm_generic_payload& trans, const char* txt2 )
@@ -712,61 +747,69 @@ check_trans_not_modified(
if (trans.get_command() != init->get_command())
{
txt << "Command attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_data_ptr() != m_map[&trans].data_ptr)
{
txt << "Data pointer attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_data_length() != init->get_data_length())
{
txt << "Data length attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_command() == tlm::TLM_WRITE_COMMAND)
for (unsigned int i = 0; i < init->get_data_length(); i++)
if (trans.get_data_ptr()[i] != init->get_data_ptr()[i])
{
txt << "Data array modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_byte_enable_ptr() != m_map[&trans].byte_enable_ptr)
{
txt << "Byte enable pointer attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_byte_enable_length() != init->get_byte_enable_length())
{
txt << "Byte enable length attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_byte_enable_ptr())
for (unsigned int i = 0; i < init->get_byte_enable_length(); i++)
if (trans.get_byte_enable_ptr()[i] != init->get_byte_enable_ptr()[i])
{
txt << "Byte enable array modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (trans.get_streaming_width() != init->get_streaming_width())
{
txt << "Streaming width attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
if (init->get_gp_option() == tlm::TLM_MIN_PAYLOAD && trans.get_gp_option() != tlm::TLM_MIN_PAYLOAD)
{
txt << "Generic payload option attribute modified during transaction lifetime, detected in " << txt2;
tlm2error(trans, "14.8 g)");
}
if ( !m_map[&trans].has_mm )
{
if (trans.has_mm())
{
txt << "Interconnect component sets a memory manager, but does not clear it on return, detected in " << txt2;
tlm2error(trans, "6.5y)");
tlm2error(trans, "14.5 aa)");
}
for (unsigned int i = 0; i < tlm::max_num_extensions(); i++)
if (trans.get_extension(i))
if ( !m_map[&trans].gp->get_extension(i) )
{
txt << "Extension set (index = " << i << ") without also being deleted in the absence of a memory manager, detected in " << txt2;
tlm2error(trans, "6.5 y)");
}
// Exclude tlm_endian_context extension from the check because it is not cloned in m_map
if (i != tlm::tlm_endian_context::ID)
if (trans.get_extension(i))
if ( !m_map[&trans].gp->get_extension(i) )
{
txt << "Extension set (index = " << i << ") without also being deleted in the absence of a memory manager, detected in " << txt2;
tlm2error(trans, "14.5 aa)");
}
}
uchar_t* resp_data_ptr = shared_map[&trans].resp_data_ptr;
@@ -775,7 +818,7 @@ check_trans_not_modified(
if (trans.get_data_ptr()[i] != resp_data_ptr[i])
{
txt << "Transaction data array modified in interconnect component on response path, detected in " << txt2;
tlm2error(trans, "6.7)");
tlm2error(trans, "14.7");
}
}
@@ -794,7 +837,7 @@ check_response_path(
for (deque_t::iterator i = path.begin(); i < path.end(); i++)
txt << (*i)->name() << " -> ";
txt << "\nDetected in " << txt2;
tlm2error(trans, "7.2.5 m-n)");
tlm2error(trans, "15.2.11 a)");
}
shared_map[&trans].path.pop_back();
shared_map[&trans].response_in_progress = !shared_map[&trans].path.empty();
@@ -803,7 +846,7 @@ check_response_path(
// Create a copy of the data array for comparison on the response path
if ( !shared_map[&trans].resp_data_ptr )
{
shared_map[&trans].resp_data_ptr = new u_char[trans.get_data_length()];
shared_map[&trans].resp_data_ptr = new uchar_t[trans.get_data_length()];
memcpy(shared_map[&trans].resp_data_ptr, trans.get_data_ptr(), trans.get_data_length());
}
}
@@ -814,35 +857,76 @@ BOILERPLATE
get_direct_mem_ptr_pre_checks(
tlm::tlm_generic_payload& trans, tlm::tlm_dmi& dmi_data )
{
remember_gp_option(trans);
if (dmi_data.get_dmi_ptr() != 0)
{
txt << "DMI descriptor not properly initialized: dmi_ptr != 0";
tlm2error(trans, "4.2.5 f)");
tlm2error(trans, "11.2.5 f)");
}
if (!dmi_data.is_none_allowed())
{
txt << "DMI descriptor not properly initialized: granted_access != DMI_ACCESS_NONE";
tlm2error(trans, "4.2.5 a)");
tlm2error(trans, "11.2.5 a)");
}
if (dmi_data.get_start_address() != 0)
{
txt << "DMI descriptor not properly initialized: start_address != 0";
tlm2error(trans, "4.2.5 s)");
tlm2error(trans, "11.2.5 u)");
}
if (dmi_data.get_end_address() != (sc_dt::uint64)(-1))
{
txt << "DMI descriptor not properly initialized: end_address != 0";
tlm2error(trans, "4.2.5 s)");
tlm2error(trans, "11.2.5 u)");
}
if (dmi_data.get_read_latency() != sc_core::SC_ZERO_TIME)
{
txt << "DMI descriptor not properly initialized: read_latency != SC_ZERO_TIME";
tlm2error(trans, "4.2.5 aa)");
tlm2error(trans, "11.2.5 ac)");
}
if (dmi_data.get_write_latency() != sc_core::SC_ZERO_TIME)
{
txt << "DMI descriptor not properly initialized: write_latency != SC_ZERO_TIME";
tlm2error(trans, "4.2.5 aa)");
tlm2error(trans, "11.2.5 ac)");
}
if (trans.get_gp_option() == tlm::TLM_FULL_PAYLOAD)
{
/*
if (trans.is_dmi_allowed()) // Would be rather brutal to flag dmi_allowed as an arror for a DMI transaction!
{
txt << "DMI transaction not properly initialized: dmi_allowed == true";
tlm2error(trans, "14.8 e) & 14.16");
}
*/
if (trans.get_response_status() != tlm::TLM_INCOMPLETE_RESPONSE)
{
txt << "DMI transaction not properly initialized: response_status != TLM_INCOMPLETE_RESPONSE";
tlm2error(trans, "14.8 e) & 14.17 e)");
}
}
else if (trans.get_gp_option() == tlm::TLM_FULL_PAYLOAD_ACCEPTED)
{
txt << "DMI transaction not properly initialized: gp_option == TLM_FULL_PAYLOAD_ACCEPTED";
tlm2error(trans, "14.8 c) & e) & j)");
}
}
BOILERPLATE
get_direct_mem_ptr_post_checks( tlm::tlm_generic_payload& trans, tlm::tlm_dmi& dmi_data )
{
tlm::tlm_generic_payload* init = m_map[&trans].gp;
if (init->get_gp_option() == tlm::TLM_MIN_PAYLOAD && trans.get_gp_option() != tlm::TLM_MIN_PAYLOAD)
{
txt << "DMI transaction gp_option attribute value TLM_MIN_PAYLOAD modified during transaction lifetime";
tlm2error(trans, "14.8 h)");
}
else if (init->get_gp_option() == tlm::TLM_FULL_PAYLOAD && trans.get_gp_option() == tlm::TLM_MIN_PAYLOAD)
{
txt << "DMI transaction gp_option attribute value changed from TLM_FULL_PAYLOAD to TLM_MIN_PAYLOAD";
tlm2error(trans, "14.8 j)");
}
}
@@ -850,39 +934,86 @@ get_direct_mem_ptr_pre_checks(
BOILERPLATE
transport_dbg_pre_checks( tlm::tlm_generic_payload& trans )
{
remember_gp_option(trans);
if (trans.get_data_length() > 0 && trans.get_data_ptr() == 0)
{
txt << "Debug transaction has data_ptr == 0";
tlm2error(trans, "4.3.4 j)");
tlm2error(trans, "11.3.4 l)");
}
}
if (trans.get_gp_option() == tlm::TLM_FULL_PAYLOAD)
{
if (trans.get_byte_enable_ptr() != 0 && trans.get_byte_enable_length() == 0)
{
txt << "Debug transaction not properly initialized: "
<< "byte_enable_ptr != 0 and byte_enable_length == 0";
tlm2error(trans, "14.8 f) & 14.14 f)");
}
if (trans.get_streaming_width() == 0)
{
txt << "Debug transaction not properly initialized: streaming_width == 0";
tlm2error(trans, "14.8 f) & 14.15 f)");
}
if (trans.is_dmi_allowed())
{
txt << "Debug transaction not properly initialized: dmi_allowed == true";
tlm2error(trans, "14.8 f) & 14.16");
}
if (trans.get_response_status() != tlm::TLM_INCOMPLETE_RESPONSE)
{
txt << "Debug transaction not properly initialized: response_status != TLM_INCOMPLETE_RESPONSE";
tlm2error(trans, "14.8 f) & 14.17 e)");
}
}
else if (trans.get_gp_option() == tlm::TLM_FULL_PAYLOAD_ACCEPTED)
{
txt << "Debug transaction not properly initialized: gp_option == TLM_FULL_PAYLOAD_ACCEPTED";
tlm2error(trans, "14.8 c) & f) & l)");
}}
BOILERPLATE
transport_dbg_post_checks( tlm::tlm_generic_payload& trans, unsigned int count )
{
tlm::tlm_generic_payload* init = m_map[&trans].gp;
if (trans.get_data_length() > 0 && trans.get_data_ptr() == 0)
{
txt << "Debug transaction has data_ptr == 0";
tlm2error(trans, "4.3.4 j)");
tlm2error(trans, "11.3.4 l)");
}
if (count > trans.get_data_length())
{
txt << "Count returned from transport_dbg is greater than data_length";
tlm2error(trans, "4.3.4 o)");
tlm2error(trans, "11.3.4 s)");
}
}
if (init->get_gp_option() == tlm::TLM_MIN_PAYLOAD && trans.get_gp_option() != tlm::TLM_MIN_PAYLOAD)
{
txt << "Debug transaction gp_option attribute value TLM_MIN_PAYLOAD modified during transaction lifetime";
tlm2error(trans, "14.8 h)");
}
else if (init->get_gp_option() == tlm::TLM_FULL_PAYLOAD && trans.get_gp_option() == tlm::TLM_MIN_PAYLOAD)
{
txt << "Debug transaction gp_option attribute value changed from TLM_FULL_PAYLOAD to TLM_MIN_PAYLOAD";
tlm2error(trans, "14.8 l)");
}}
BOILERPLATE
tlm2error( tlm::tlm_generic_payload& trans, const char* ref, bool warning )
{
txt << "\n\nRefer to TLM-2.0 User Manual, version JA22, clause " << ref;
txt << "\n\nRefer to IEEE Std 1666-2011, clause " << ref;
txt << "\n\nChecker instance: " << this->name();
txt << "\n\nTransaction details:";
txt << "\n has_mm = " << dec << trans.has_mm() << " (bool)";
txt << "\n ref_count = " << dec << trans.get_ref_count() << " (int)";
txt << "\n\n command = " <<
txt << "\n\n gp_option = " <<
(trans.get_gp_option() == tlm::TLM_MIN_PAYLOAD ? "TLM_MIN_PAYLOAD"
:trans.get_gp_option() == tlm::TLM_FULL_PAYLOAD ? "TLM_FULL_PAYLOAD"
: "TLM_FULL_PAYLOAD_ACCEPTED");
txt << "\n command = " <<
(trans.get_command() == tlm::TLM_READ_COMMAND ? "TLM_READ_COMMAND"
:trans.get_command() == tlm::TLM_WRITE_COMMAND ? "TLM_WRITE_COMMAND"
: "TLM_IGNORE_COMMAND");