From 16fa8d7cc8c92f5ab879e4cf9c6c0bbb3567860f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 24 May 2018 01:37:55 -0700 Subject: systemc: Import tests from the Accellera systemc distribution. Change-Id: Iad76b398949a55d768a34d027a2d8e3739953da6 Reviewed-on: https://gem5-review.googlesource.com/10845 Reviewed-by: Giacomo Travaglini Maintainer: Gabe Black --- .../tests/tlm/p2p/BaseSocketLT/base_socket_LT.cpp | 36 ++++++++++++ .../tlm/p2p/BaseSocketLT/golden/base_socket_LT.log | 33 +++++++++++ .../tlm/p2p/CoreDecoupling/core_decoupling.cpp | 36 ++++++++++++ .../p2p/CoreDecoupling/golden/core_decoupling.log | 66 ++++++++++++++++++++++ .../tests/tlm/p2p/EndEventLT/end_event_LT.cpp | 36 ++++++++++++ .../tlm/p2p/EndEventLT/golden/end_event_LT.log | 33 +++++++++++ .../HierarchicalSocket/SimpleInitiatorWrapper.h | 55 ++++++++++++++++++ .../p2p/HierarchicalSocket/SimpleTargetWrapper.h | 55 ++++++++++++++++++ .../golden/hierarchical_socket.log | 33 +++++++++++ .../p2p/HierarchicalSocket/hierarchical_socket.cpp | 40 +++++++++++++ .../golden/register_socket_process_LT.log | 33 +++++++++++ .../register_socket_process_LT.cpp | 35 ++++++++++++ .../tests/tlm/p2p/SimpleAT/golden/simple_AT.log | 33 +++++++++++ src/systemc/tests/tlm/p2p/SimpleAT/simple_AT.cpp | 36 ++++++++++++ .../tlm/p2p/SimpleAT_TA/golden/simple_AT_TA.log | 33 +++++++++++ .../tests/tlm/p2p/SimpleAT_TA/simple_AT_TA.cpp | 36 ++++++++++++ 16 files changed, 629 insertions(+) create mode 100644 src/systemc/tests/tlm/p2p/BaseSocketLT/base_socket_LT.cpp create mode 100644 src/systemc/tests/tlm/p2p/BaseSocketLT/golden/base_socket_LT.log create mode 100644 src/systemc/tests/tlm/p2p/CoreDecoupling/core_decoupling.cpp create mode 100644 src/systemc/tests/tlm/p2p/CoreDecoupling/golden/core_decoupling.log create mode 100644 src/systemc/tests/tlm/p2p/EndEventLT/end_event_LT.cpp create mode 100644 src/systemc/tests/tlm/p2p/EndEventLT/golden/end_event_LT.log create mode 100644 src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleInitiatorWrapper.h create mode 100644 src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleTargetWrapper.h create mode 100644 src/systemc/tests/tlm/p2p/HierarchicalSocket/golden/hierarchical_socket.log create mode 100644 src/systemc/tests/tlm/p2p/HierarchicalSocket/hierarchical_socket.cpp create mode 100644 src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/golden/register_socket_process_LT.log create mode 100644 src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/register_socket_process_LT.cpp create mode 100644 src/systemc/tests/tlm/p2p/SimpleAT/golden/simple_AT.log create mode 100644 src/systemc/tests/tlm/p2p/SimpleAT/simple_AT.cpp create mode 100644 src/systemc/tests/tlm/p2p/SimpleAT_TA/golden/simple_AT_TA.log create mode 100644 src/systemc/tests/tlm/p2p/SimpleAT_TA/simple_AT_TA.cpp (limited to 'src/systemc/tests/tlm/p2p') diff --git a/src/systemc/tests/tlm/p2p/BaseSocketLT/base_socket_LT.cpp b/src/systemc/tests/tlm/p2p/BaseSocketLT/base_socket_LT.cpp new file mode 100644 index 000000000..9f527fd53 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/BaseSocketLT/base_socket_LT.cpp @@ -0,0 +1,36 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#include "tlm.h" + +#include "SimpleLTInitiator1.h" +#include "SimpleLTTarget1.h" + +int sc_main(int argc, char* argv[]) +{ + SimpleLTInitiator1 initiator("initiator"); + SimpleLTTarget1 target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/BaseSocketLT/golden/base_socket_LT.log b/src/systemc/tests/tlm/p2p/BaseSocketLT/golden/base_socket_LT.log new file mode 100644 index 000000000..186648cba --- /dev/null +++ b/src/systemc/tests/tlm/p2p/BaseSocketLT/golden/base_socket_LT.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Received ok response @ 10 ns +initiator: Send write request: A = 0x4, D = 0x1 @ 10 ns +target: Received write request: A = 0x4, D = 0x1 @ 10 ns +initiator: Received ok response @ 20 ns +initiator: Send write request: A = 0x8, D = 0x2 @ 20 ns +target: Received write request: A = 0x8, D = 0x2 @ 20 ns +initiator: Received ok response @ 30 ns +initiator: Send write request: A = 0xc, D = 0x3 @ 30 ns +target: Received write request: A = 0xc, D = 0x3 @ 30 ns +initiator: Received ok response @ 40 ns +initiator: Send write request: A = 0x10, D = 0x4 @ 40 ns +target: Received write request: A = 0x10, D = 0x4 @ 40 ns +initiator: Received ok response @ 50 ns +initiator: Send read request: A = 0x0 @ 50 ns +target: Received read request: A = 0x0 @ 50 ns +initiator: Received ok response: D = 0x0 @ 150 ns +initiator: Send read request: A = 0x4 @ 150 ns +target: Received read request: A = 0x4 @ 150 ns +initiator: Received ok response: D = 0x1 @ 250 ns +initiator: Send read request: A = 0x8 @ 250 ns +target: Received read request: A = 0x8 @ 250 ns +initiator: Received ok response: D = 0x2 @ 350 ns +initiator: Send read request: A = 0xc @ 350 ns +target: Received read request: A = 0xc @ 350 ns +initiator: Received ok response: D = 0x3 @ 450 ns +initiator: Send read request: A = 0x10 @ 450 ns +target: Received read request: A = 0x10 @ 450 ns +initiator: Received ok response: D = 0x4 @ 550 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/CoreDecoupling/core_decoupling.cpp b/src/systemc/tests/tlm/p2p/CoreDecoupling/core_decoupling.cpp new file mode 100644 index 000000000..aa68951f3 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/CoreDecoupling/core_decoupling.cpp @@ -0,0 +1,36 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ +#define SC_INCLUDE_DYNAMIC_PROCESSES +#include "tlm.h" + +#include "CoreDecouplingLTInitiator.h" +#include "ExplicitLTTarget.h" + +int sc_main(int argc, char* argv[]) +{ + CoreDecouplingLTInitiator initiator("initiator", 10); + ExplicitLTTarget target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/CoreDecoupling/golden/core_decoupling.log b/src/systemc/tests/tlm/p2p/CoreDecoupling/golden/core_decoupling.log new file mode 100644 index 000000000..b5a9e8314 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/CoreDecoupling/golden/core_decoupling.log @@ -0,0 +1,66 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s (0 s + 0 s) +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Received ok response @ 50 ns (50 ns + 0 s) +initiator: Send write request: A = 0x4, D = 0x1 @ 50 ns (50 ns + 0 s) +target: Received write request: A = 0x4, D = 0x1 @ 50 ns +initiator: Received ok response @ 100 ns (100 ns + 0 s) +initiator: Send write request: A = 0x8, D = 0x2 @ 100 ns (100 ns + 0 s) +target: Received write request: A = 0x8, D = 0x2 @ 100 ns +initiator: Received ok response @ 150 ns (150 ns + 0 s) +initiator: Send write request: A = 0xc, D = 0x3 @ 150 ns (150 ns + 0 s) +target: Received write request: A = 0xc, D = 0x3 @ 150 ns +initiator: Received ok response @ 200 ns (200 ns + 0 s) +initiator: Send write request: A = 0x10, D = 0x4 @ 200 ns (200 ns + 0 s) +target: Received write request: A = 0x10, D = 0x4 @ 200 ns +initiator: Received ok response @ 250 ns (250 ns + 0 s) +initiator: Send write request: A = 0x14, D = 0x5 @ 250 ns (250 ns + 0 s) +target: Received write request: A = 0x14, D = 0x5 @ 250 ns +initiator: Received ok response @ 300 ns (300 ns + 0 s) +initiator: Send write request: A = 0x18, D = 0x6 @ 300 ns (300 ns + 0 s) +target: Received write request: A = 0x18, D = 0x6 @ 300 ns +initiator: Received ok response @ 350 ns (350 ns + 0 s) +initiator: Send write request: A = 0x1c, D = 0x7 @ 350 ns (350 ns + 0 s) +target: Received write request: A = 0x1c, D = 0x7 @ 350 ns +initiator: Received ok response @ 400 ns (400 ns + 0 s) +initiator: Send write request: A = 0x20, D = 0x8 @ 400 ns (400 ns + 0 s) +target: Received write request: A = 0x20, D = 0x8 @ 400 ns +initiator: Received ok response @ 450 ns (450 ns + 0 s) +initiator: Send write request: A = 0x24, D = 0x9 @ 450 ns (450 ns + 0 s) +target: Received write request: A = 0x24, D = 0x9 @ 450 ns +Sync'ing... +initiator: Received ok response @ 500 ns (500 ns + 0 s) +initiator: Send read request: A = 0x0 @ 500 ns (500 ns + 0 s) +target: Received read request: A = 0x0 @ 500 ns +initiator: Received ok response: D = 0x0 @ 600 ns (500 ns + 100 ns) +initiator: Send read request: A = 0x4 @ 600 ns (500 ns + 100 ns) +target: Received read request: A = 0x4 @ 500 ns +initiator: Received ok response: D = 0x1 @ 700 ns (500 ns + 200 ns) +initiator: Send read request: A = 0x8 @ 700 ns (500 ns + 200 ns) +target: Received read request: A = 0x8 @ 500 ns +initiator: Received ok response: D = 0x2 @ 800 ns (500 ns + 300 ns) +initiator: Send read request: A = 0xc @ 800 ns (500 ns + 300 ns) +target: Received read request: A = 0xc @ 500 ns +initiator: Received ok response: D = 0x3 @ 900 ns (500 ns + 400 ns) +initiator: Send read request: A = 0x10 @ 900 ns (500 ns + 400 ns) +target: Received read request: A = 0x10 @ 500 ns +Sync'ing... +initiator: Received ok response: D = 0x4 @ 1 us (1 us + 0 s) +initiator: Send read request: A = 0x14 @ 1 us (1 us + 0 s) +target: Received read request: A = 0x14 @ 1 us +initiator: Received ok response: D = 0x5 @ 1100 ns (1 us + 100 ns) +initiator: Send read request: A = 0x18 @ 1100 ns (1 us + 100 ns) +target: Received read request: A = 0x18 @ 1 us +initiator: Received ok response: D = 0x6 @ 1200 ns (1 us + 200 ns) +initiator: Send read request: A = 0x1c @ 1200 ns (1 us + 200 ns) +target: Received read request: A = 0x1c @ 1 us +initiator: Received ok response: D = 0x7 @ 1300 ns (1 us + 300 ns) +initiator: Send read request: A = 0x20 @ 1300 ns (1 us + 300 ns) +target: Received read request: A = 0x20 @ 1 us +initiator: Received ok response: D = 0x8 @ 1400 ns (1 us + 400 ns) +initiator: Send read request: A = 0x24 @ 1400 ns (1 us + 400 ns) +target: Received read request: A = 0x24 @ 1 us +Sync'ing... +initiator: Received ok response: D = 0x9 @ 1500 ns (1500 ns + 0 s) + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/EndEventLT/end_event_LT.cpp b/src/systemc/tests/tlm/p2p/EndEventLT/end_event_LT.cpp new file mode 100644 index 000000000..1aca86b87 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/EndEventLT/end_event_LT.cpp @@ -0,0 +1,36 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#include "tlm.h" + +#include "SimpleLTInitiator3.h" +#include "SimpleLTTarget2.h" + +int sc_main(int argc, char* argv[]) +{ + SimpleLTInitiator3 initiator("initiator"); + SimpleLTTarget2 target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/EndEventLT/golden/end_event_LT.log b/src/systemc/tests/tlm/p2p/EndEventLT/golden/end_event_LT.log new file mode 100644 index 000000000..186648cba --- /dev/null +++ b/src/systemc/tests/tlm/p2p/EndEventLT/golden/end_event_LT.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Received ok response @ 10 ns +initiator: Send write request: A = 0x4, D = 0x1 @ 10 ns +target: Received write request: A = 0x4, D = 0x1 @ 10 ns +initiator: Received ok response @ 20 ns +initiator: Send write request: A = 0x8, D = 0x2 @ 20 ns +target: Received write request: A = 0x8, D = 0x2 @ 20 ns +initiator: Received ok response @ 30 ns +initiator: Send write request: A = 0xc, D = 0x3 @ 30 ns +target: Received write request: A = 0xc, D = 0x3 @ 30 ns +initiator: Received ok response @ 40 ns +initiator: Send write request: A = 0x10, D = 0x4 @ 40 ns +target: Received write request: A = 0x10, D = 0x4 @ 40 ns +initiator: Received ok response @ 50 ns +initiator: Send read request: A = 0x0 @ 50 ns +target: Received read request: A = 0x0 @ 50 ns +initiator: Received ok response: D = 0x0 @ 150 ns +initiator: Send read request: A = 0x4 @ 150 ns +target: Received read request: A = 0x4 @ 150 ns +initiator: Received ok response: D = 0x1 @ 250 ns +initiator: Send read request: A = 0x8 @ 250 ns +target: Received read request: A = 0x8 @ 250 ns +initiator: Received ok response: D = 0x2 @ 350 ns +initiator: Send read request: A = 0xc @ 350 ns +target: Received read request: A = 0xc @ 350 ns +initiator: Received ok response: D = 0x3 @ 450 ns +initiator: Send read request: A = 0x10 @ 450 ns +target: Received read request: A = 0x10 @ 450 ns +initiator: Received ok response: D = 0x4 @ 550 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleInitiatorWrapper.h b/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleInitiatorWrapper.h new file mode 100644 index 000000000..41b982ecd --- /dev/null +++ b/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleInitiatorWrapper.h @@ -0,0 +1,55 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#ifndef __SIMPLE_INITIATOR_WRAPPER_H__ +#define __SIMPLE_INITIATOR_WRAPPER_H__ + +#include "tlm.h" +#include "SimpleLTInitiator1.h" + +class SimpleInitiatorWrapper : public sc_core::sc_module +{ +public: + typedef tlm::tlm_generic_payload transaction_type; + typedef tlm::tlm_phase phase_type; + typedef tlm::tlm_sync_enum sync_enum_type; + typedef tlm::tlm_fw_transport_if<> fw_interface_type; + typedef tlm::tlm_bw_transport_if<> bw_interface_type; + typedef tlm::tlm_initiator_socket<> initiator_socket_type; + +public: + initiator_socket_type socket; + +public: + SimpleInitiatorWrapper(sc_core::sc_module_name name) : + sc_core::sc_module(name), + socket("socket"), + child("child") + { + child.socket(socket); + } + +protected: + SimpleLTInitiator1 child; + +}; + +#endif + + diff --git a/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleTargetWrapper.h b/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleTargetWrapper.h new file mode 100644 index 000000000..16212515c --- /dev/null +++ b/src/systemc/tests/tlm/p2p/HierarchicalSocket/SimpleTargetWrapper.h @@ -0,0 +1,55 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#ifndef __SIMPLE_TARGET_WRAPPER_H__ +#define __SIMPLE_TARGET_WRAPPER_H__ + +#include "tlm.h" +#include "SimpleLTTarget1.h" + +class SimpleTargetWrapper : public sc_core::sc_module +{ +public: + typedef tlm::tlm_generic_payload transaction_type; + typedef tlm::tlm_phase phase_type; + typedef tlm::tlm_sync_enum sync_enum_type; + typedef tlm::tlm_fw_transport_if<> fw_interface_type; + typedef tlm::tlm_bw_transport_if<> bw_interface_type; + typedef tlm::tlm_target_socket<> target_socket_type; + +public: + target_socket_type socket; + +public: + SimpleTargetWrapper(sc_core::sc_module_name name) : + sc_core::sc_module(name), + socket("socket"), + child("child") + { + socket(child.socket); + } + +protected: + SimpleLTTarget1 child; + +}; + +#endif + + diff --git a/src/systemc/tests/tlm/p2p/HierarchicalSocket/golden/hierarchical_socket.log b/src/systemc/tests/tlm/p2p/HierarchicalSocket/golden/hierarchical_socket.log new file mode 100644 index 000000000..137330634 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/HierarchicalSocket/golden/hierarchical_socket.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiatorWrapper.child: Send write request: A = 0x0, D = 0x0 @ 0 s +targetWrapper.child: Received write request: A = 0x0, D = 0x0 @ 0 s +initiatorWrapper.child: Received ok response @ 10 ns +initiatorWrapper.child: Send write request: A = 0x4, D = 0x1 @ 10 ns +targetWrapper.child: Received write request: A = 0x4, D = 0x1 @ 10 ns +initiatorWrapper.child: Received ok response @ 20 ns +initiatorWrapper.child: Send write request: A = 0x8, D = 0x2 @ 20 ns +targetWrapper.child: Received write request: A = 0x8, D = 0x2 @ 20 ns +initiatorWrapper.child: Received ok response @ 30 ns +initiatorWrapper.child: Send write request: A = 0xc, D = 0x3 @ 30 ns +targetWrapper.child: Received write request: A = 0xc, D = 0x3 @ 30 ns +initiatorWrapper.child: Received ok response @ 40 ns +initiatorWrapper.child: Send write request: A = 0x10, D = 0x4 @ 40 ns +targetWrapper.child: Received write request: A = 0x10, D = 0x4 @ 40 ns +initiatorWrapper.child: Received ok response @ 50 ns +initiatorWrapper.child: Send read request: A = 0x0 @ 50 ns +targetWrapper.child: Received read request: A = 0x0 @ 50 ns +initiatorWrapper.child: Received ok response: D = 0x0 @ 150 ns +initiatorWrapper.child: Send read request: A = 0x4 @ 150 ns +targetWrapper.child: Received read request: A = 0x4 @ 150 ns +initiatorWrapper.child: Received ok response: D = 0x1 @ 250 ns +initiatorWrapper.child: Send read request: A = 0x8 @ 250 ns +targetWrapper.child: Received read request: A = 0x8 @ 250 ns +initiatorWrapper.child: Received ok response: D = 0x2 @ 350 ns +initiatorWrapper.child: Send read request: A = 0xc @ 350 ns +targetWrapper.child: Received read request: A = 0xc @ 350 ns +initiatorWrapper.child: Received ok response: D = 0x3 @ 450 ns +initiatorWrapper.child: Send read request: A = 0x10 @ 450 ns +targetWrapper.child: Received read request: A = 0x10 @ 450 ns +initiatorWrapper.child: Received ok response: D = 0x4 @ 550 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/HierarchicalSocket/hierarchical_socket.cpp b/src/systemc/tests/tlm/p2p/HierarchicalSocket/hierarchical_socket.cpp new file mode 100644 index 000000000..be2ec433c --- /dev/null +++ b/src/systemc/tests/tlm/p2p/HierarchicalSocket/hierarchical_socket.cpp @@ -0,0 +1,40 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +//#include + +//#include + +#include "tlm.h" + +#include "SimpleInitiatorWrapper.h" +#include "SimpleTargetWrapper.h" + +int sc_main(int argc, char* argv[]) +{ + SimpleInitiatorWrapper initiator("initiatorWrapper"); + SimpleTargetWrapper target("targetWrapper"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/golden/register_socket_process_LT.log b/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/golden/register_socket_process_LT.log new file mode 100644 index 000000000..186648cba --- /dev/null +++ b/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/golden/register_socket_process_LT.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Received ok response @ 10 ns +initiator: Send write request: A = 0x4, D = 0x1 @ 10 ns +target: Received write request: A = 0x4, D = 0x1 @ 10 ns +initiator: Received ok response @ 20 ns +initiator: Send write request: A = 0x8, D = 0x2 @ 20 ns +target: Received write request: A = 0x8, D = 0x2 @ 20 ns +initiator: Received ok response @ 30 ns +initiator: Send write request: A = 0xc, D = 0x3 @ 30 ns +target: Received write request: A = 0xc, D = 0x3 @ 30 ns +initiator: Received ok response @ 40 ns +initiator: Send write request: A = 0x10, D = 0x4 @ 40 ns +target: Received write request: A = 0x10, D = 0x4 @ 40 ns +initiator: Received ok response @ 50 ns +initiator: Send read request: A = 0x0 @ 50 ns +target: Received read request: A = 0x0 @ 50 ns +initiator: Received ok response: D = 0x0 @ 150 ns +initiator: Send read request: A = 0x4 @ 150 ns +target: Received read request: A = 0x4 @ 150 ns +initiator: Received ok response: D = 0x1 @ 250 ns +initiator: Send read request: A = 0x8 @ 250 ns +target: Received read request: A = 0x8 @ 250 ns +initiator: Received ok response: D = 0x2 @ 350 ns +initiator: Send read request: A = 0xc @ 350 ns +target: Received read request: A = 0xc @ 350 ns +initiator: Received ok response: D = 0x3 @ 450 ns +initiator: Send read request: A = 0x10 @ 450 ns +target: Received read request: A = 0x10 @ 450 ns +initiator: Received ok response: D = 0x4 @ 550 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/register_socket_process_LT.cpp b/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/register_socket_process_LT.cpp new file mode 100644 index 000000000..33b73faff --- /dev/null +++ b/src/systemc/tests/tlm/p2p/RegisterSocketProcessLT/register_socket_process_LT.cpp @@ -0,0 +1,35 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#include "tlm.h" + +#include "SimpleLTInitiator2.h" +#include "SimpleLTTarget2.h" +int sc_main(int argc, char* argv[]) +{ + SimpleLTInitiator2 initiator("initiator"); + SimpleLTTarget2 target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/SimpleAT/golden/simple_AT.log b/src/systemc/tests/tlm/p2p/SimpleAT/golden/simple_AT.log new file mode 100644 index 000000000..e64d5ce44 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/SimpleAT/golden/simple_AT.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Send write request: A = 0x4, D = 0x1 @ 25 ns +target: Received write request: A = 0x4, D = 0x1 @ 25 ns +initiator: Send write request: A = 0x8, D = 0x2 @ 50 ns +target: Received write request: A = 0x8, D = 0x2 @ 50 ns +initiator: Send write request: A = 0xc, D = 0x3 @ 75 ns +target: Received write request: A = 0xc, D = 0x3 @ 75 ns +initiator: Send write request: A = 0x10, D = 0x4 @ 100 ns +target: Received write request: A = 0x10, D = 0x4 @ 100 ns +initiator: Send read request: A = 0x0 @ 125 ns +target: Received read request: A = 0x0 @ 125 ns +initiator: Received ok response @ 135 ns +initiator: Send read request: A = 0x4 @ 150 ns +target: Received read request: A = 0x4 @ 150 ns +initiator: Send read request: A = 0x8 @ 175 ns +target: Received read request: A = 0x8 @ 175 ns +initiator: Send read request: A = 0xc @ 200 ns +target: Received read request: A = 0xc @ 200 ns +initiator: Send read request: A = 0x10 @ 225 ns +target: Received read request: A = 0x10 @ 225 ns +initiator: Received ok response @ 245 ns +initiator: Received ok response @ 355 ns +initiator: Received ok response @ 465 ns +initiator: Received ok response @ 575 ns +initiator: Received ok response: D = 0x0 @ 685 ns +initiator: Received ok response: D = 0x1 @ 795 ns +initiator: Received ok response: D = 0x2 @ 905 ns +initiator: Received ok response: D = 0x3 @ 1015 ns +initiator: Received ok response: D = 0x4 @ 1125 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/SimpleAT/simple_AT.cpp b/src/systemc/tests/tlm/p2p/SimpleAT/simple_AT.cpp new file mode 100644 index 000000000..92e920369 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/SimpleAT/simple_AT.cpp @@ -0,0 +1,36 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ +#define SC_INCLUDE_DYNAMIC_PROCESSES +#include "tlm.h" + +#include "SimpleATInitiator1.h" +#include "SimpleATTarget1.h" + +int sc_main(int argc, char* argv[]) +{ + SimpleATInitiator1 initiator("initiator"); + SimpleATTarget1 target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} diff --git a/src/systemc/tests/tlm/p2p/SimpleAT_TA/golden/simple_AT_TA.log b/src/systemc/tests/tlm/p2p/SimpleAT_TA/golden/simple_AT_TA.log new file mode 100644 index 000000000..4970861d2 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/SimpleAT_TA/golden/simple_AT_TA.log @@ -0,0 +1,33 @@ +SystemC Simulation +initiator: Send write request: A = 0x0, D = 0x0 @ 0 s +target: Received write request: A = 0x0, D = 0x0 @ 0 s +initiator: Send write request: A = 0x4, D = 0x1 @ 25 ns +target: Received write request: A = 0x4, D = 0x1 @ 25 ns +initiator: Send write request: A = 0x8, D = 0x2 @ 50 ns +target: Received write request: A = 0x8, D = 0x2 @ 50 ns +initiator: Send write request: A = 0xc, D = 0x3 @ 75 ns +target: Received write request: A = 0xc, D = 0x3 @ 75 ns +initiator: Send write request: A = 0x10, D = 0x4 @ 100 ns +target: Received write request: A = 0x10, D = 0x4 @ 100 ns +initiator: Received ok response @ 125 ns +initiator: Send read request: A = 0x0 @ 125 ns +target: Received read request: A = 0x0 @ 125 ns +initiator: Send read request: A = 0x4 @ 150 ns +target: Received read request: A = 0x4 @ 150 ns +initiator: Send read request: A = 0x8 @ 175 ns +target: Received read request: A = 0x8 @ 175 ns +initiator: Send read request: A = 0xc @ 200 ns +target: Received read request: A = 0xc @ 200 ns +initiator: Send read request: A = 0x10 @ 225 ns +target: Received read request: A = 0x10 @ 225 ns +initiator: Received ok response @ 235 ns +initiator: Received ok response @ 345 ns +initiator: Received ok response @ 455 ns +initiator: Received ok response @ 565 ns +initiator: Received ok response: D = 0x0 @ 675 ns +initiator: Received ok response: D = 0x1 @ 785 ns +initiator: Received ok response: D = 0x2 @ 895 ns +initiator: Received ok response: D = 0x3 @ 1005 ns +initiator: Received ok response: D = 0x4 @ 1115 ns + +Info: /OSCI/SystemC: Simulation stopped by user. diff --git a/src/systemc/tests/tlm/p2p/SimpleAT_TA/simple_AT_TA.cpp b/src/systemc/tests/tlm/p2p/SimpleAT_TA/simple_AT_TA.cpp new file mode 100644 index 000000000..909ca9390 --- /dev/null +++ b/src/systemc/tests/tlm/p2p/SimpleAT_TA/simple_AT_TA.cpp @@ -0,0 +1,36 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ +#define SC_INCLUDE_DYNAMIC_PROCESSES +#include "tlm.h" + +#include "SimpleATInitiator2.h" +#include "SimpleATTarget2.h" + +int sc_main(int argc, char* argv[]) +{ + SimpleATInitiator2 initiator("initiator"); + SimpleATTarget2 target("target"); + + initiator.socket(target.socket); + + sc_core::sc_start(); + sc_core::sc_stop(); + + return 0; +} -- cgit v1.2.3