Compare commits

..

No commits in common. "main" and "Corona_TLM_FIFO" have entirely different histories.

142 changed files with 1479 additions and 786745 deletions

3
.gitignore vendored
View file

@ -1,3 +0,0 @@
build
out
sim

View file

@ -1,56 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(sim)
SET(CMAKE_PREFIX_PATH /usr/local/systemc/)
set(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -pthread")
set(CMAKE_BUILD_TYPE Release)
INCLUDE_DIRECTORIES(${CMAKE_PREFIX_PATH}/include)
INCLUDE_DIRECTORIES(./src)
FIND_LIBRARY(systemc systemc ${CMAKE_PREFIX_PATH}/lib-linux64)
LINK_DIRECTORIES(${CMAKE_PREFIX_PATH}/lib-linux64)
ADD_DEFINITIONS(-D SC_INCLUDE_DYNAMIC_PROCESSES -D SYSTEMC_DISABLE_COPYRIGHT_MESSAGE -D ENABLE_BUFFER_VC_STATS -D SC_DISABLE_API_VERSION_CHECK)
ADD_EXECUTABLE(${PROJECT_NAME}
src/main.cpp
src/networkInterface/NetworkInterfaceTlm.cpp
src/networkManager/NetworkManager.cpp
src/noc/noc.cpp
src/router/router.cpp
src/utils/memory_manager.cpp
src/utils/utils.cpp
src/utils/semaphore_manager.h
src/utils/configuration.h
src/utils/noc_logger.cpp
src/ratatoskrUtils/utils/Report.cpp
src/ratatoskrUtils/utils/GlobalReport.cpp
src/ratatoskrUtils/utils/Structures.cpp
src/ratatoskrUtils/utils/PacketFactory.cpp
src/ratatoskrUtils/utils/GlobalResources.cpp
src/ratatoskrUtils/utils/Statistics.cpp
src/ratatoskrUtils/processingElement/ProcessingElement.cpp
src/ratatoskrUtils/processingElement/ProcessingElementVC.cpp
src/ratatoskrUtils/networkInterface/NetworkInterface.cpp
src/ratatoskrUtils/traffic/Packet.cpp
src/ratatoskrUtils/traffic/Flit.cpp
src/ratatoskrUtils/traffic/synthetic/SyntheticPool.cpp
src/ratatoskrUtils/traffic/task/TaskPool.cpp
src/ratatoskrUtils/traffic/TrafficPool.cpp
src/ratatoskrUtils/link/Link.cpp
src/ratatoskrUtils/traffic/netrace/NetracePool.cpp
src/ratatoskrUtils/traffic/netrace/NetracePool.h
src/ratatoskrUtils/traffic/netrace/ntNetrace.h
src/ratatoskrUtils/traffic/netrace/ntNetrace.cpp
src/ratatoskrUtils/traffic/netrace/ntQueue.h
src/ratatoskrUtils/traffic/netrace/ntQueue.cpp
src/ratatoskrUtils/utils/TrafficTracer.cpp
)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} systemc pugixml boost_system zmq boost_program_options)

27
Makefile Normal file
View file

@ -0,0 +1,27 @@
CXX = g++
CXXFLAGS = -std=c++17 -g -I$(SYSTEMC_HOME)/include -I./include
LDFLAGS = -L$(SYSTEMC_HOME)/lib-linux64 -lsystemc
SRCDIR = src
INCDIR = include
OBJDIR = obj
OUTDIR = out
SOURCES = $(wildcard $(SRCDIR)/*.cpp)
OBJECTS = $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)
EXECUTABLE = $(OUTDIR)/noc_simulation
all: directories $(EXECUTABLE)
directories:
mkdir -p $(OBJDIR) $(OUTDIR)
$(EXECUTABLE): $(OBJECTS) main.cpp
$(CXX) $(CXXFLAGS) $(OBJECTS) main.cpp -o $@ $(LDFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
rm -rf $(OBJDIR) $(OUTDIR)
.PHONY: all clean directories

View file

@ -1,8 +1,22 @@
# Corona Optical Network on Chip (NoC) Simulation with Ratatoskr
# Corona Optical Network on Chip (NoC) Simulation
This project simulates the Corona all optical Network-on-Chip (NoC) architecture using SystemC TLM 2.0.
## Project Structure
Corona_NoC_Optical_230924/
├── include/
│ ├── configuration.h
│ ├── core.h
│ ├── router.h
| |__ semaphore_manager.h
├── src/
│ ├── core.cpp
│ ├── router.cpp
├── main.cpp
├── Makefile
└── README.md
## Prerequisites
- SystemC (version 2.3.3 or later)
@ -18,13 +32,10 @@ This project simulates the Corona all optical Network-on-Chip (NoC) architecture
export SYSTEMC_HOME=/path/to/your/systemc/installation
## Compilation
./build.sh
make
## Output simple test - 1 Task
./sim --configFolder simple_test
## Output - 2 Task
./sim --configFolder simple_2_point_test
## Output
./out/noc_simulation
# Log file
@ -33,14 +44,14 @@ The log file is in out/report.log
# The current setup
• There are ROUTER_NO of routers.
• Multiple PEs (CORE_NO) are connected to each router -Processing Elements and Network Interfaces
• The PEs transmit the data to each routers using non-blocking TLM
• The routers receive data from NI in the input fifo
• Multiple cores (CORE_NO) are connected to each router
• The cores transmit the data to each routers using non-blocking TLM
• The routers receive data from core in the input fifo
• The data from the input fifo is processed to find destination router
• The sender router waits for the destination router's token (Semaphore)
• When the semaphore is available, the sender writes the data using non-blocking write to destination router's output fifo - this confirms whether space available in the fifo too
• At the destination router, the data from output fifo is processed to find the destination NI
• The data is transmitted to the destination NI using non-blocking TLM
• At the destination router, the data from output fifo is processed to find the destination core
• The data is transmitted to the destination core using non-blocking TLM
# Introduction to Corona
The Corona architecture is as follows;
@ -86,4 +97,4 @@ In general, if we consider any particular cluster n, there will be a numbe
• Release broadcast token when broadcast message transmission is finished
• Detects for messages on home channel n (Reading data)
• Detecting the broadcast channel for broadcast messages
• Acquire and renew the home token
• Acquire and renew the home token

View file

@ -1,9 +0,0 @@
#!/bin/bash
mkdir build
cd build
cmake ..
make -j
cp sim ..
cd ..
rm -rf build

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500000"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/MobileNet/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/MobileNet/data_R1000.xml</dataFile>
<mapFile>config/MobileNet/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,597 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Type_task_0"/>
</dataType>
<dataType id="1">
<name value="Type_task_1"/>
</dataType>
<dataType id="2">
<name value="Type_task_2"/>
</dataType>
<dataType id="3">
<name value="Type_task_3"/>
</dataType>
<dataType id="4">
<name value="Type_task_4"/>
</dataType>
<dataType id="5">
<name value="Type_task_5"/>
</dataType>
<dataType id="6">
<name value="Type_task_6"/>
</dataType>
<dataType id="7">
<name value="Type_task_7"/>
</dataType>
<dataType id="8">
<name value="Type_task_8"/>
</dataType>
<dataType id="9">
<name value="Type_task_9"/>
</dataType>
<dataType id="10">
<name value="Type_task_10"/>
</dataType>
<dataType id="11">
<name value="Type_task_11"/>
</dataType>
<dataType id="12">
<name value="Type_task_12"/>
</dataType>
<dataType id="13">
<name value="Type_task_13"/>
</dataType>
<dataType id="14">
<name value="Type_task_14"/>
</dataType>
<dataType id="15">
<name value="Type_task_15"/>
</dataType>
<dataType id="16">
<name value="Type_task_16"/>
</dataType>
<dataType id="17">
<name value="Type_task_17"/>
</dataType>
<dataType id="18">
<name value="Type_task_18"/>
</dataType>
<dataType id="19">
<name value="Type_task_19"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="402" max="402"/>
<type value="0"/>
<task value="1"/>
</destination>
</destinations>
</possibility>
</generates>
<requires/>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="1">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="402" max="402"/>
<type value="1"/>
<task value="2"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count min="402" max="402"/>
</requirement>
</requires>
</task>
<task id="2">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="2">
<delay min="65" max="65"/>
<interval min="20" max="20"/>
<count min="201" max="201"/>
<type value="2"/>
<task value="3"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="1"/>
<source value="1"/>
<count min="402" max="402"/>
</requirement>
</requires>
</task>
<task id="3">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="3">
<delay min="195" max="195"/>
<interval min="20" max="20"/>
<count min="1205" max="1205"/>
<type value="3"/>
<task value="4"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="2"/>
<source value="2"/>
<count min="201" max="201"/>
</requirement>
</requires>
</task>
<task id="4">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="4">
<delay min="28" max="28"/>
<interval min="20" max="20"/>
<count min="302" max="302"/>
<type value="4"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="3"/>
<source value="3"/>
<count min="1205" max="1205"/>
</requirement>
</requires>
</task>
<task id="5">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="5">
<delay min="73" max="73"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="5"/>
<task value="6"/>
</destination>
<destination id="6">
<delay min="73" max="73"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="5"/>
<task value="9"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="4"/>
<source value="4"/>
<count min="302" max="302"/>
</requirement>
</requires>
</task>
<task id="6">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="7">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="6"/>
<task value="7"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="5"/>
<source value="5"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="7">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="8">
<delay min="41" max="41"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="7"/>
<task value="8"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="6"/>
<source value="6"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="8">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="9">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="8"/>
<task value="9"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="7"/>
<source value="7"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="9">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="10">
<delay min="1" max="1"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="9"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="5"/>
<source value="5"/>
<count min="76" max="76"/>
</requirement>
<requirement id="1">
<type value="8"/>
<source value="8"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="10">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="11">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="10"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="9"/>
<source value="9"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="11">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="12">
<delay min="11" max="11"/>
<interval min="20" max="20"/>
<count min="113" max="113"/>
<type value="11"/>
<task value="12"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="10"/>
<source value="10"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="12">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="13">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="12"/>
<task value="13"/>
</destination>
<destination id="14">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="12"/>
<task value="16"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="11"/>
<source value="11"/>
<count min="113" max="113"/>
</requirement>
</requires>
</task>
<task id="13">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="15">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="13"/>
<task value="14"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="12"/>
<source value="12"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="14">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="16">
<delay min="14" max="14"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="14"/>
<task value="15"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="13"/>
<source value="13"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="15">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="17">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="15"/>
<task value="16"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="14"/>
<source value="14"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="16">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="18">
<delay min="1" max="1"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="16"/>
<task value="17"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="12"/>
<source value="12"/>
<count min="26" max="26"/>
</requirement>
<requirement id="1">
<type value="15"/>
<source value="15"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="17">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="19">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="17"/>
<task value="18"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="16"/>
<source value="16"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="18">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="20">
<delay min="14" max="14"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="18"/>
<task value="19"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="17"/>
<source value="17"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="19">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations/>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="18"/>
<source value="18"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,83 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="8"/>
</bind>
<bind>
<task value="1"/>
<node value="12"/>
</bind>
<bind>
<task value="2"/>
<node value="16"/>
</bind>
<bind>
<task value="3"/>
<node value="20"/>
</bind>
<bind>
<task value="4"/>
<node value="24"/>
</bind>
<bind>
<task value="5"/>
<node value="28"/>
</bind>
<bind>
<task value="6"/>
<node value="32"/>
</bind>
<bind>
<task value="7"/>
<node value="36"/>
</bind>
<bind>
<task value="8"/>
<node value="9"/>
</bind>
<bind>
<task value="9"/>
<node value="13"/>
</bind>
<bind>
<task value="10"/>
<node value="17"/>
</bind>
<bind>
<task value="11"/>
<node value="21"/>
</bind>
<bind>
<task value="12"/>
<node value="25"/>
</bind>
<bind>
<task value="13"/>
<node value="29"/>
</bind>
<bind>
<task value="14"/>
<node value="33"/>
</bind>
<bind>
<task value="15"/>
<node value="37"/>
</bind>
<bind>
<task value="16"/>
<node value="10"/>
</bind>
<bind>
<task value="17"/>
<node value="14"/>
</bind>
<bind>
<task value="18"/>
<node value="18"/>
</bind>
<bind>
<task value="19"/>
<node value="22"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500000"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/MobileNet_task_repeat/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/MobileNet_task_repeat/data_R1000.xml</dataFile>
<mapFile>config/MobileNet_task_repeat/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,597 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Type_task_0"/>
</dataType>
<dataType id="1">
<name value="Type_task_1"/>
</dataType>
<dataType id="2">
<name value="Type_task_2"/>
</dataType>
<dataType id="3">
<name value="Type_task_3"/>
</dataType>
<dataType id="4">
<name value="Type_task_4"/>
</dataType>
<dataType id="5">
<name value="Type_task_5"/>
</dataType>
<dataType id="6">
<name value="Type_task_6"/>
</dataType>
<dataType id="7">
<name value="Type_task_7"/>
</dataType>
<dataType id="8">
<name value="Type_task_8"/>
</dataType>
<dataType id="9">
<name value="Type_task_9"/>
</dataType>
<dataType id="10">
<name value="Type_task_10"/>
</dataType>
<dataType id="11">
<name value="Type_task_11"/>
</dataType>
<dataType id="12">
<name value="Type_task_12"/>
</dataType>
<dataType id="13">
<name value="Type_task_13"/>
</dataType>
<dataType id="14">
<name value="Type_task_14"/>
</dataType>
<dataType id="15">
<name value="Type_task_15"/>
</dataType>
<dataType id="16">
<name value="Type_task_16"/>
</dataType>
<dataType id="17">
<name value="Type_task_17"/>
</dataType>
<dataType id="18">
<name value="Type_task_18"/>
</dataType>
<dataType id="19">
<name value="Type_task_19"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="402" max="402"/>
<type value="0"/>
<task value="1"/>
</destination>
</destinations>
</possibility>
</generates>
<requires/>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="1">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="402" max="402"/>
<type value="1"/>
<task value="2"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count min="402" max="402"/>
</requirement>
</requires>
</task>
<task id="2">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="2">
<delay min="65" max="65"/>
<interval min="20" max="20"/>
<count min="201" max="201"/>
<type value="2"/>
<task value="3"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="1"/>
<source value="1"/>
<count min="402" max="402"/>
</requirement>
</requires>
</task>
<task id="3">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="3">
<delay min="195" max="195"/>
<interval min="20" max="20"/>
<count min="1205" max="1205"/>
<type value="3"/>
<task value="4"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="2"/>
<source value="2"/>
<count min="201" max="201"/>
</requirement>
</requires>
</task>
<task id="4">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="4">
<delay min="28" max="28"/>
<interval min="20" max="20"/>
<count min="302" max="302"/>
<type value="4"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="3"/>
<source value="3"/>
<count min="1205" max="1205"/>
</requirement>
</requires>
</task>
<task id="5">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="5">
<delay min="73" max="73"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="5"/>
<task value="6"/>
</destination>
<destination id="6">
<delay min="73" max="73"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="5"/>
<task value="9"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="4"/>
<source value="4"/>
<count min="302" max="302"/>
</requirement>
</requires>
</task>
<task id="6">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="7">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="6"/>
<task value="7"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="5"/>
<source value="5"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="7">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="8">
<delay min="41" max="41"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="7"/>
<task value="8"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="6"/>
<source value="6"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="8">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="9">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="8"/>
<task value="9"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="7"/>
<source value="7"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="9">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="10">
<delay min="1" max="1"/>
<interval min="20" max="20"/>
<count min="76" max="76"/>
<type value="9"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="5"/>
<source value="5"/>
<count min="76" max="76"/>
</requirement>
<requirement id="1">
<type value="8"/>
<source value="8"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="10">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="11">
<delay min="110" max="110"/>
<interval min="20" max="20"/>
<count min="452" max="452"/>
<type value="10"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="9"/>
<source value="9"/>
<count min="76" max="76"/>
</requirement>
</requires>
</task>
<task id="11">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="12">
<delay min="11" max="11"/>
<interval min="20" max="20"/>
<count min="113" max="113"/>
<type value="11"/>
<task value="12"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="10"/>
<source value="10"/>
<count min="452" max="452"/>
</requirement>
</requires>
</task>
<task id="12">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="13">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="12"/>
<task value="13"/>
</destination>
<destination id="14">
<delay min="37" max="37"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="12"/>
<task value="16"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="11"/>
<source value="11"/>
<count min="113" max="113"/>
</requirement>
</requires>
</task>
<task id="13">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="15">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="13"/>
<task value="14"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="12"/>
<source value="12"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="14">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="16">
<delay min="14" max="14"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="14"/>
<task value="15"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="13"/>
<source value="13"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="15">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="17">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="15"/>
<task value="16"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="14"/>
<source value="14"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="16">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="18">
<delay min="1" max="1"/>
<interval min="20" max="20"/>
<count min="26" max="26"/>
<type value="16"/>
<task value="17"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="12"/>
<source value="12"/>
<count min="26" max="26"/>
</requirement>
<requirement id="1">
<type value="15"/>
<source value="15"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="17">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="19">
<delay min="49" max="49"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="17"/>
<task value="18"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="16"/>
<source value="16"/>
<count min="26" max="26"/>
</requirement>
</requires>
</task>
<task id="18">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="20">
<delay min="14" max="14"/>
<interval min="20" max="20"/>
<count min="151" max="151"/>
<type value="18"/>
<task value="19"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="17"/>
<source value="17"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
<task id="19">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="10" max="10"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations/>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="18"/>
<source value="18"/>
<count min="151" max="151"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,83 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="8"/>
</bind>
<bind>
<task value="1"/>
<node value="8"/>
</bind>
<bind>
<task value="2"/>
<node value="12"/>
</bind>
<bind>
<task value="3"/>
<node value="12"/>
</bind>
<bind>
<task value="4"/>
<node value="16"/>
</bind>
<bind>
<task value="5"/>
<node value="16"/>
</bind>
<bind>
<task value="6"/>
<node value="20"/>
</bind>
<bind>
<task value="7"/>
<node value="20"/>
</bind>
<bind>
<task value="8"/>
<node value="24"/>
</bind>
<bind>
<task value="9"/>
<node value="24"/>
</bind>
<bind>
<task value="10"/>
<node value="28"/>
</bind>
<bind>
<task value="11"/>
<node value="28"/>
</bind>
<bind>
<task value="12"/>
<node value="32"/>
</bind>
<bind>
<task value="13"/>
<node value="32"/>
</bind>
<bind>
<task value="14"/>
<node value="36"/>
</bind>
<bind>
<task value="15"/>
<node value="36"/>
</bind>
<bind>
<task value="16"/>
<node value="9"/>
</bind>
<bind>
<task value="17"/>
<node value="9"/>
</bind>
<bind>
<task value="18"/>
<node value="13"/>
</bind>
<bind>
<task value="19"/>
<node value="13"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,269 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
</dataTypes>
<tasks>
<!-- Tasks 09 generate packets -->
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="2">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="3">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="4">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="5">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="6">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="7">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="8">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="9">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="10"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<!-- Task 10 receives packets -->
<task id="10">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="10" min="10"/>
</requirement>
<!-- <requirement id="1">
<type value="0"/>
<source value="1"/>
<count max="1" min="1"/>
</requirement>
<requirement id="2">
<type value="0"/>
<source value="2"/>
<count max="1" min="1"/>
</requirement>
<requirement id="3">
<type value="0"/>
<source value="3"/>
<count max="1" min="1"/>
</requirement>
<requirement id="4">
<type value="0"/>
<source value="4"/>
<count max="1" min="1"/>
</requirement>
<requirement id="5">
<type value="0"/>
<source value="5"/>
<count max="1" min="1"/>
</requirement>
<requirement id="6">
<type value="0"/>
<source value="6"/>
<count max="1" min="1"/>
</requirement>
<requirement id="7">
<type value="0"/>
<source value="7"/>
<count max="1" min="1"/>
</requirement>
<requirement id="8">
<type value="0"/>
<source value="8"/>
<count max="1" min="1"/>
</requirement>
<requirement id="9">
<type value="0"/>
<source value="9"/>
<count max="1" min="1"/>
</requirement> -->
</requires>
</task>
</tasks>
</data>

View file

@ -1,47 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="10"/>
</bind>
<bind>
<task value="1"/>
<node value="31"/>
</bind>
<bind>
<task value="2"/>
<node value="18"/>
</bind>
<bind>
<task value="3"/>
<node value="38"/>
</bind>
<bind>
<task value="4"/>
<node value="33"/>
</bind>
<bind>
<task value="5"/>
<node value="23"/>
</bind>
<bind>
<task value="6"/>
<node value="26"/>
</bind>
<bind>
<task value="7"/>
<node value="11"/>
</bind>
<bind>
<task value="8"/>
<node value="9"/>
</bind>
<bind>
<task value="9"/>
<node value="17"/>
</bind>
<bind>
<task value="10"/>
<node value="22"/>
</bind>
</map>

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/Test_10_task/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/Test_10_task/10pt_data.xml</dataFile>
<mapFile>config/Test_10_task/10pt_map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

File diff suppressed because it is too large Load diff

View file

@ -1,245 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="2">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="3">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="4">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="5"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<!-- <task id="5">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="6">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="7">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="8">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="9">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="10">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task> -->
<task id="5">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="5" min="5"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,51 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="10"/>
</bind>
<bind>
<task value="1"/>
<node value="31"/>
</bind>
<bind>
<task value="2"/>
<node value="18"/>
</bind>
<bind>
<task value="3"/>
<node value="38"/>
</bind>
<bind>
<task value="4"/>
<node value="33"/>
</bind>
<!-- <bind>
<task value="5"/>
<node value="23"/>
</bind>
<bind>
<task value="6"/>
<node value="26"/>
</bind>
<bind>
<task value="7"/>
<node value="11"/>
</bind>
<bind>
<task value="8"/>
<node value="9"/>
</bind>
<bind>
<task value="9"/>
<node value="17"/>
</bind>
<bind>
<task value="10"/>
<node value="22"/>
</bind> -->
<bind>
<task value="5"/>
<node value="15"/>
</bind>
</map>

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/Test_5_task/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/Test_5_task/5t_data.xml</dataFile>
<mapFile>config/Test_5_task/5t_map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/simple_data.xml</dataFile>
<mapFile>config/simple_map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/simple_test/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/only_config_msg_test/data.xml</dataFile>
<mapFile>config/only_config_msg_test/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,92 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
<dataType id="2">
<name value="ConfigRouter"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="1"/>
<config link="0" destination="3"/>
</destination>
<destination id="1">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="2"/>
<config link="2" destination="3"/>
</destination>
<destination id="2">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="3"/>
<config link="2" destination="0"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
<task id="2">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
<task id="3">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,19 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="0"/>
</bind>
<bind>
<task value="1"/>
<node value="0"/>
</bind>
<bind>
<task value="2"/>
<node value="1"/>
</bind>
<bind>
<task value="3"/>
<node value="2"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/simple_test/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/simple_2_layer_test/data.xml</dataFile>
<mapFile>config/simple_2_layer_test/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,145 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
<dataType id="2">
<name value="ConfigRouter"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="1"/>
<config link="0" destination="3"/>
</destination>
<destination id="1">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="2"/>
<config link="2" destination="3"/>
</destination>
<destination id="2">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="2"/>
<task value="3"/>
<config link="2" destination="0"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
<task id="2">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="3"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="3">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="2"/>
<source value="2"/>
<count max="1" min="1"/>
</requirement>
</requires>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="1"/>
<task value="4"/>
</destination>
<destination id="1">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="1"/>
<task value="4"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="4">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="1"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
<requirement id="1">
<type value="1"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,23 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="0"/>
</bind>
<bind>
<task value="1"/>
<node value="1"/>
</bind>
<bind>
<task value="2"/>
<node value="2"/>
</bind>
<bind>
<task value="3"/>
<node value="0"/>
</bind>
<bind>
<task value="4"/>
<node value="2"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,70 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Streaming"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="2"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="2"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="2">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
<requirement id="1">
<type value="0"/>
<source value="24"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,15 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="8"/>
</bind>
<bind>
<task value="1"/>
<node value="15"/>
</bind>
<bind>
<task value="2"/>
<node value="21"/>
</bind>
</map>

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/simple_test/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/simple_2_point_test/2pt_data.xml</dataFile>
<mapFile>config/simple_2_point_test/2pt_map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

File diff suppressed because it is too large Load diff

View file

@ -1,44 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="1"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="10"/>
</bind>
<bind>
<task value="1"/>
<node value="21"/>
</bind>
</map>

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/simple_data.xml</dataFile>
<mapFile>config/simple_map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

File diff suppressed because it is too large Load diff

View file

@ -1,44 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="1" max="1"/>
<type value="0"/>
<task value="1"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="1" min="1"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,11 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="10"/>
</bind>
<bind>
<task value="1"/>
<node value="21"/>
</bind>
</map>

View file

@ -1,83 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/network.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>synthetic</benchmark>
<synthetic>
<phase name="warmup">
<distribution value="uniform"/>
<start max="100" min="100"/>
<duration max="1090" min="1090"/>
<repeat max="-1" min="-1"/>
<delay max="0" min="0"/>
<injectionRate value="0.002"/>
<count max="1" min="1"/>
<hotspot value="0"/>
</phase>
<phase name="run">
<distribution value="uniform"/>
<start max="1100" min="1100"/>
<duration max="101100" min="1500000"/>
<repeat max="-1" min="-1"/>
<delay max="0" min="0"/>
<injectionRate value="0.002"/>
<count max="1" min="1"/>
<hotspot value="0"/>
</phase>
</synthetic>
<dataFile>src/model/config/data.xml</dataFile>
<mapFile>src/model/config/map.xml</mapFile>
<simulationFile>traffic/pipelinePerformance_2D/PipelineResetTB.xml</simulationFile>
<mappingFile>traffic/pipelinePerformance_2D/PipelineResetTBMapping.xml</mappingFile>
<netraceFile>src/model/traffic/netrace/testraces/example.tra.bz2</netraceFile>
<netraceStartRegion value="0"/>
<isUniform value="false"/>
<numberOfTrafficTypes value="5"/>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10 21 22 25 26 37 38 41 42</bufferReportRouters>
</report>
</configuration>

View file

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="image"/>
</dataType>
<dataType id="1">
<name value="image part"/>
</dataType>
<dataType id="2">
<name value="feature"/>
</dataType>
</dataTypes>
<tasks>
<task id = "0">
<start min = "0" max = "0"/>
<duration min = "-1" max = "-1"/>
<repeat min = "2" max = "2"/>
<requires>
</requires>
<generates>
<possibility id = "0">
<probability value = "1" />
<destinations>
<destination id = "0">
<delay min = "0" max = "0" />
<interval min = "1000" max = "1000"/>
<count min = "1" max = "1" />
<type value = "0" />
<task value = "1" />
</destination>
<destination id = "1">
<delay min = "0" max = "0" />
<interval min = "1000" max = "1000"/>
<count min = "1" max = "1" />
<type value = "2" />
<task value = "2" />
</destination>
</destinations>
</possibility>
<!-- <possibility id = "1">
<probability value = "0.3" />
<destinations>
<destination id = "0">
<delay min = "0" max = "100" />
<interval min = "1000" max = "1000"/>
<count min = "1" max = "1" />
<type value = "0" />
<task value = "3" />
</destination>
</destinations>
</possibility>-->
</generates>
</task>
<task id = "1">
<start min = "0" max = "0"/>
<duration min = "-1" max = "-1"/>
<repeat min = "1" max = "1"/>
<requires>
<requirement id = "0">
<type value = "0"/>
<source value = "0"/>
<count min = "1" max = "1" />
</requirement>
</requires>
<generates>
<possibility id = "0">
<probability value = "1" />
<destinations>
<destination id = "0">
<delay min = "0" max = "100" />
<interval min = "1000" max = "1000"/>
<count min = "1" max = "1" />
<type value = "0" />
<task value = "3" />
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id = "2">
<start min = "0" max = "0"/>
<duration min = "-1" max = "-1"/>
<repeat min = "1" max = "1"/>
<requires>
<requirement id = "0">
<type value = "2"/>
<source value = "0"/>
<count min = "1" max = "1" />
</requirement>
</requires>
<generates>
<possibility id = "0">
<probability value = "1" />
<destinations>
<destination id = "0">
<delay min = "0" max = "100" />
<interval min = "1000" max = "1000"/>
<count min = "1" max = "1" />
<type value = "0" />
<task value = "3" />
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id = "3">
<start min = "0" max = "0"/>
<duration min = "-1" max = "-1"/>
<repeat min = "1" max = "1"/>
<requires>
<requirement id = "0">
<type value = "0"/>
<count min = "1" max = "1" />
</requirement>
</requires>
<generates>
</generates>
</task>
</tasks>
</data>

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value = "0" />
<node value = "8" />
</bind>
<bind>
<task value = "1" />
<node value = "9" />
</bind>
<bind>
<task value = "2" />
<node value = "10" />
</bind>
<bind>
<task value = "3" />
<node value = "11" />
</bind>
<bind>
<task value = "4" />
<node value = "12" />
</bind>
<bind>
<task value = "5" />
<node value = "13" />
</bind>
<bind>
<task value = "6" />
<node value = "14" />
</bind>
<bind>
<task value = "7" />
<node value = "15" />
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="1500000"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/test1/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/test1/data.xml</dataFile>
<mapFile>config/test1/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,95 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="TYPE_PE_TO_PE"/>
</dataType>
<dataType id="1">
<name value="TYPE_IF"/>
</dataType>
<dataType id="2">
<name value="TYPE_WK"/>
</dataType>
<dataType id="3">
<name value="TYPE_OF"/>
</dataType>
</dataTypes>
<!-- Sending from the same task different types of multiple data and once all types are received
sending the another type to a 3rd task, only partially working -->
<tasks>
<!-- IF0,.., WK0,,.. for chiplet0 (All PEs of chiplet0)-->
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="4" max="4"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="10" max="10"/>
<type value="1"/>
<task value="1"/>
</destination>
<destination id="1">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="10" max="10"/>
<type value="2"/>
<task value="1"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<!-- to receive input feature0 and weight kernal0 by PE0 of chiplet0 -->
<task id="1">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="4" min="4"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="2">
<delay min="0" max="100"/>
<interval min="100" max="100"/>
<count min="4" max="4"/>
<type value="3"/>
<task value="2"/>
</destination>
</destinations>
</possibility>
</generates>
<requires>
<requirement id="0">
<type value="1"/>
<source value="0"/>
<count max="10" min="10"/>
</requirement>
<requirement id="1">
<type value="2"/>
<source value="0"/>
<count max="10" min="10"/>
</requirement>
</requires>
</task>
<task id="2">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="4" min="4"/>
<requires>
<requirement id="0">
<type value="3"/>
<source value="1"/>
<count max="4" min="4"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,15 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="8"/>
</bind>
<bind>
<task value="1"/>
<node value="12"/>
</bind>
<bind>
<task value="2"/>
<node value="16"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

View file

@ -1,55 +0,0 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="5000"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/throttle_test/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/throttle_test/data.xml</dataFile>
<mapFile>config/throttle_test/map.xml</mapFile>
</application>
<verbose>
<processingElements>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="true"/>
<receive_flit value="false"/>
<receive_tail_flit value="true"/>
<throttle value="false"/>
<reset value="false"/>
</processingElements>
<router>
<function_calls value="false"/>
<send_flit value="false"/>
<send_head_flit value="false"/>
<receive_flit value="false"/>
<receive_tail_flit value="false"/>
<throttle value="false"/>
<reset value="false"/>
<assign_channel value="false"/>
<buffer_overflow value="true"/>
</router>
<netrace>
<inject value="true"/>
<eject value="true"/>
<router_receive value="true"/>
</netrace>
<tasks>
<function_calls value="true"/>
<xml_parse value="false"/>
<data_receive value="true"/>
<data_send value="true"/>
<source_execute value="false"/>
</tasks>
</verbose>
<report>
<bufferReportRouters>5 6 9 10</bufferReportRouters>
</report>
</configuration>

View file

@ -1,245 +0,0 @@
<?xml version="1.0" ?>
<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dataTypes>
<dataType id="0">
<name value="Packet"/>
</dataType>
<dataType id="1">
<name value="Stream"/>
</dataType>
</dataTypes>
<tasks>
<task id="0">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="1">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="2">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="3">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="4">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="5">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="6">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="7">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="8">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="9">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="10">
<start min="0" max="0"/>
<duration min="-1" max="-1"/>
<repeat min="1" max="1"/>
<generates>
<possibility id="0">
<probability value="1"/>
<destinations>
<destination id="0">
<delay min="0" max="10"/>
<interval min="5" max="5"/>
<count min="10" max="10"/>
<type value="0"/>
<task value="11"/>
</destination>
</destinations>
</possibility>
</generates>
</task>
<task id="11">
<start max="0" min="0"/>
<duration max="-1" min="-1"/>
<repeat max="1" min="1"/>
<requires>
<requirement id="0">
<type value="0"/>
<source value="0"/>
<count max="100" min="100"/>
</requirement>
</requires>
</task>
</tasks>
</data>

View file

@ -1,51 +0,0 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="10"/>
</bind>
<bind>
<task value="1"/>
<node value="31"/>
</bind>
<bind>
<task value="2"/>
<node value="18"/>
</bind>
<bind>
<task value="3"/>
<node value="38"/>
</bind>
<bind>
<task value="4"/>
<node value="33"/>
</bind>
<bind>
<task value="5"/>
<node value="23"/>
</bind>
<bind>
<task value="6"/>
<node value="26"/>
</bind>
<bind>
<task value="7"/>
<node value="11"/>
</bind>
<bind>
<task value="8"/>
<node value="9"/>
</bind>
<bind>
<task value="9"/>
<node value="17"/>
</bind>
<bind>
<task value="10"/>
<node value="22"/>
</bind>
<bind>
<task value="11"/>
<node value="15"/>
</bind>
</map>

File diff suppressed because it is too large Load diff

64
include/configuration.h Normal file
View file

@ -0,0 +1,64 @@
#pragma once
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
using namespace sc_core; // For sc_time
// Global parameters to generalize the design
#define ROUTER_NO 4 // Number of routers
#define CORE_NO 4 // Number of cores per router
#define CORE_FIFO_CAPACITY 8 // Capacity of FIFO in router that receive data from cores
#define ROUTER_RECEIVE_FIFO_CAPACITY 2 // Capacity of FIFO in router that receive data from other routers
#define LOG_NAME "MY_LOG"
struct my_payload : public tlm::tlm_generic_payload {
unsigned int src_core; // Source core ID
unsigned int src_router; // Source router ID
unsigned int dst_core; // Destination core ID
unsigned int dst_router; // Destination router ID
int data; // Data value (random number)
sc_core::sc_time timestamp; // Timestamp field
// Default constructor
my_payload() : src_core(0), src_router(0), dst_core(0), dst_router(0), data(0), timestamp(SC_ZERO_TIME) {
set_data_ptr(reinterpret_cast<unsigned char*>(&data));
set_data_length(sizeof(data));
set_streaming_width(sizeof(data));
}
// Constructor with random data
my_payload(unsigned int source_core, unsigned int src_router_id, unsigned int dst_core_id, unsigned int destination_router_id, int data, sc_time time = SC_ZERO_TIME)
: src_core(source_core), src_router(src_router_id), dst_core(dst_core_id), dst_router(destination_router_id), data(data) {
set_data_ptr(reinterpret_cast<unsigned char*>(&data));
set_data_length(sizeof(data));
set_streaming_width(sizeof(data));
}
// Function to update timestamp at any stage
void update_timestamp(sc_time new_time) {
timestamp = new_time;
}
};
// Define the payload type
// struct my_payload : public tlm::tlm_generic_payload {
// unsigned int dst_core;
// unsigned int dst_router;
// int data;
// my_payload() : dst_core(0), dst_router(0), data(0) {
// set_data_ptr(reinterpret_cast<unsigned char*>(&data));
// set_data_length(sizeof(data));
// set_streaming_width(sizeof(data));
// }
// my_payload(int d) : dst_core(0), dst_router(0), data(d) {
// set_data_ptr(reinterpret_cast<unsigned char*>(&data));
// set_data_length(sizeof(data));
// set_streaming_width(sizeof(data));
// }

35
include/core.h Normal file
View file

@ -0,0 +1,35 @@
#pragma once
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <queue>
#include <iostream>
#include <vector>
#include <string>
#include <iostream>
#include <cstdlib> // For rand()
#include <ctime> // For time()
#include "configuration.h"
// Initiator module (processor core)
SC_MODULE(core) {
tlm_utils::simple_initiator_socket<core> socket;
tlm_utils::simple_target_socket<core> target_socket;
unsigned int source_router_id; // Source router ID for this core
unsigned int source_core_id;
SC_CTOR(core);
// Thread for sending data
void thread();
/// Forwarding function for receiving data from router
tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay);
void log_info(std::string msg);
void log_error(std::string msg);
};

View file

@ -1,24 +1,3 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include <systemc.h>
@ -34,16 +13,16 @@
#include <cstdlib> // For rand()
#include <ctime> // For time()
#include "utils/configuration.h"
#include "utils/semaphore_manager.h"
#include "configuration.h"
#include "semaphore_manager.h"
using namespace sc_core;
// Router module with FIFOs, semaphores, and capacity control for receive FIFO
SC_MODULE(router) {
tlm_utils::simple_target_socket<router> sockets[CORE_NO]; // Sockets to receive data from nis
tlm_utils::simple_initiator_socket<router> core_sockets[CORE_NO]; // Sockets to send data to nis
sc_core::sc_fifo<my_payload*> in_fifo; // FIFO for incoming transactions from nis
tlm_utils::simple_target_socket<router> sockets[CORE_NO]; // Sockets to receive data from cores
tlm_utils::simple_initiator_socket<router> core_sockets[CORE_NO]; // Sockets to send data to cores
sc_core::sc_fifo<my_payload*> in_fifo; // FIFO for incoming transactions from cores
sc_core::sc_fifo<my_payload*> out_fifo; // FIFO for transactions to be processed by the router
@ -51,9 +30,8 @@ SC_MODULE(router) {
// Declare the semaphore for access control
sc_core::sc_semaphore sem;
//int router_id;
//Channel delay change from 10 to 5 NS
const int D = 5; // Base delay for each router communication (in ns)
int router_id;
const int D = 10; // Base delay for each router communication (in ns)
// Pointers to other routers' FIFOs and semaphores for inter-router communication
@ -69,10 +47,10 @@ SC_MODULE(router) {
tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay);
// Thread to process core_fifo
void process_in_fifo();
void process_core_fifo();
// Thread to process router_receive_fifo and forward transactions to nis
void process_out_fifo();
// Thread to process router_receive_fifo and forward transactions to cores
void process_router_receive_fifo();
void log_info(std::string msg);
void log_error(std::string msg);

124
include/semaphore_manager.h Normal file
View file

@ -0,0 +1,124 @@
// semaphore_manager.h
#ifndef SEMAPHORE_MANAGER_H
#define SEMAPHORE_MANAGER_H
#include <systemc>
#include <vector>
#include <queue>
#include <iostream>
#include <mutex>
#include <unordered_set>
#include "configuration.h"
using namespace sc_core;
class semaphore_manager : public sc_module {
public:
SC_HAS_PROCESS(semaphore_manager);
semaphore_manager(sc_module_name name) : sc_module(name) {
semaphore_owners.resize(ROUTER_NO, 0); // Start with all tokens at router 0
request_queues.resize(ROUTER_NO); // Initialize a queue for each semaphore
queue_entries.resize(ROUTER_NO); // Set for each semaphore to track queued routers
semaphore_status.resize(ROUTER_NO, false); // All semaphores are initially free
std::fill_n(last_router_owner, ROUTER_NO, -1); // Initialize all last owners to -1
SC_THREAD(update_semaphores); // Start automatic ownership update thread
sc_report_handler::set_log_file_name("out/report.log");
sc_report_handler::set_actions(LOG_NAME, SC_INFO, SC_LOG|SC_DISPLAY);
}
// Request a token for a semaphore with round-robin and priority ordering
bool request_token(int router_id, int semaphore_id) {
//wait(SC_ZERO_TIME);
std::lock_guard<sc_mutex> lock(mutex); // Ensure atomic access
if (semaphore_id >= 0 && semaphore_id < ROUTER_NO) {
wait(SC_ZERO_TIME);
// Give priority if the request follows round-robin order from the last owner
if (semaphore_owners[semaphore_id] == router_id || semaphore_owners[semaphore_id] == -1 || (!semaphore_status[semaphore_id] && request_queues[semaphore_id].empty()))
{
log_info("Token for destination router " + std::to_string(semaphore_id) + " granted to Router " + std::to_string(router_id));
semaphore_owners[semaphore_id] = router_id;
semaphore_status[semaphore_id] = true; // Mark semaphore as in use
last_router_owner[semaphore_id] = router_id; // Update the last owner
return true;
} else {
if (queue_entries[semaphore_id].find(router_id) == queue_entries[semaphore_id].end()) {
request_queues[semaphore_id].push(router_id);
queue_entries[semaphore_id].insert(router_id); // Track in the set
log_info("Router " + std::to_string(router_id) + " added to queue for semaphore " + std::to_string(semaphore_id));
}
}
}
return false;
}
// Release the token and pass it to the next in the round-robin or queue order
bool release_token(int router_id, int semaphore_id) {
std::lock_guard<sc_mutex> lock(mutex); // Ensure atomic access
if (semaphore_id >= 0 && semaphore_id < ROUTER_NO) {
if (semaphore_owners[semaphore_id] == router_id) {
log_info("Router " + std::to_string(router_id) + " released token for destination router " + std::to_string(semaphore_id));
semaphore_status[semaphore_id] = false; // Mark semaphore as free
//wait(0, SC_NS);
if (!request_queues[semaphore_id].empty()) {
int next_router = request_queues[semaphore_id].front();
request_queues[semaphore_id].pop();
queue_entries[semaphore_id].erase(next_router); // Remove from set when dequeued
semaphore_owners[semaphore_id] = next_router;
semaphore_status[semaphore_id] = true; // Mark semaphore as in use
log_info("Token for destination router " + std::to_string(semaphore_id) + " passed to Router " + std::to_string(next_router));
//request_token(next_router, semaphore_id);
} else {
semaphore_owners[semaphore_id] = -1;
// Assign to next router in round-robin if idle
// semaphore_owners[semaphore_id] = (semaphore_owners[semaphore_id] + 1) % ROUTER_NO;
// log_info("Token for destination router " + std::to_string(semaphore_id) + " passed to Router " + std::to_string(semaphore_owners[semaphore_id]));
}
return true;
}
}
return false;
}
// Periodic update function to rotate token ownership in round-robin if tokens are idle
void update_semaphores() {
while (true) {
wait(20, SC_NS);
for (int i = 0; i < ROUTER_NO; ++i) {
std::lock_guard<sc_mutex> lock(mutex); // Ensure atomic update
if ((!semaphore_status[i] && (semaphore_owners[i] == -1 || request_queues[i].empty()))) {
semaphore_owners[i] = (last_router_owner[i] + 1) % ROUTER_NO;
log_info("Updated owner of semaphore " + std::to_string(i) + " to Router " + std::to_string(semaphore_owners[i]));
last_router_owner[i] = semaphore_owners[i];
}
}
}
}
private:
std::vector<int> semaphore_owners; // Tracks router ownership (-1 means no owner)
std::vector<std::queue<int>> request_queues; // Queue of pending requests per semaphore
std::vector<bool> semaphore_status; // Semaphore availability
sc_mutex mutex; // Mutex to ensure atomic operations
std::vector<std::unordered_set<int>> queue_entries; // Track entries in each queue to prevent duplicates
int last_router_owner[ROUTER_NO]; // Array to track last owner for round-robin assignment
//print log messages
void log_info(std::string msg){
SC_REPORT_INFO(LOG_NAME, msg.c_str());
}
void log_error(std::string msg){
SC_REPORT_ERROR(LOG_NAME, msg.c_str());
}
};
#endif // SEMAPHORE_MANAGER_H

82
main.cpp Normal file
View file

@ -0,0 +1,82 @@
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <queue>
#include <iostream>
#include <vector>
#include <string>
#include <iostream>
#include <cstdlib> // For rand()
#include <ctime> // For time()
#include "configuration.h"
#include "router.h"
#include "core.h"
#include "semaphore_manager.h"
int sc_main(int argc, char* argv[]) {
// Create a semaphore manager instance
semaphore_manager sem_mgr("SemaphoreManager");
// Instantiate ROUTER_NO routers
router* routers[ROUTER_NO];
std::vector<sc_core::sc_semaphore*> router_sems;
std::vector<sc_core::sc_fifo<my_payload*>*> router_out_fifos;
for (int i = 0; i < ROUTER_NO; ++i) {
std::string router_name = "router" + std::to_string(i);
routers[i] = new router(router_name.c_str());
// Assign the router ID
routers[i]-> router_id = i;
// Store semaphores and out_fifos in vectors
router_sems.push_back(&routers[i]->sem);
router_out_fifos.push_back(&routers[i]->out_fifo);
routers[i]->set_semaphore_manager(&sem_mgr); // Pass semaphore manager to each router
}
// Set up pointers to other routers' semaphores and out_fifos for each router
for (int i = 0; i < ROUTER_NO; i++) {
routers[i]->other_sems = router_sems;
routers[i]->other_out_fifos = router_out_fifos;
}
// Instantiate ROUTER_NO*CORE_NO cores (CORE_NO per router)
core* cores[ROUTER_NO][CORE_NO]; // ROUTER_NO routers, each with CORE_NO cores
for (int i = 0; i < ROUTER_NO; ++i) { // Router index
for (int j = 0; j < CORE_NO; ++j) { // Core index within each router
std::string core_name = "core" + std::to_string(i) + "_" + std::to_string(j);
cores[i][j] = new core(core_name.c_str());
cores[i][j]->source_router_id = i; // Set source router ID
cores[i][j]->source_core_id = j; // Set source router ID
}
}
// Bind cores to their respective routers
for (int i = 0; i < ROUTER_NO; ++i) { // Router index
for (int j = 0; j < CORE_NO; ++j) { // Core index within each router
cores[i][j]->socket.bind(routers[i]->sockets[j]); // Core's socket to router's target socket
routers[i]->core_sockets[j].bind(cores[i][j]->target_socket); // Router's initiator socket to core's target socket
routers[i]->current_router_id= i;
}
}
// Start the simulation
sc_core::sc_start(400, SC_NS);
//sc_start();
// Clean up memory to avoid leaks
for (int i = 0; i < ROUTER_NO; ++i) {
for (int j = 0; j < CORE_NO; ++j) {
delete cores[i][j]; // Delete each core
}
delete routers[i]; // Delete each router
}
return 0;
}

BIN
obj/core.o Normal file

Binary file not shown.

BIN
obj/router.o Normal file

Binary file not shown.

BIN
out/noc_simulation Normal file

Binary file not shown.

File diff suppressed because it is too large Load diff

1537
report.txt

File diff suppressed because it is too large Load diff

View file

@ -1,30 +0,0 @@
# main.py
import pandas as pd
import os
from parameters import net_models, result_folder, log_files
from utils import get_total_sim_time, get_throughput, generate_sim_time_graph, generate_throughput_graph
# Process each model and channel delay setting
for delay, logs in log_files.items():
sim_time_data = pd.DataFrame(columns=["architecture", "simulation time (us)", "throughput (packets/us)"])
count = 0
for arch, models in net_models.items():
for model in models:
for log_name, log_type in logs.items():
log_path = os.path.join(result_folder, log_name)
# Extract simulation time & throughput
sim_time = get_total_sim_time(log_path)
throughput = get_throughput(log_path, sim_time)
if sim_time is not None and throughput is not None:
sim_time_data.loc[count] = [f"{arch} ({log_type})", sim_time, throughput]
count += 1
else:
print(f"Warning: No valid simulation time found in {log_path}")
# Generate graphs separately for each delay setting
generate_sim_time_graph(sim_time_data, models[0], delay)
generate_throughput_graph(sim_time_data, models[0], delay)

View file

@ -1,29 +0,0 @@
# parameters.py
# Architecture names
titles = {
"corona": "Corona Optical NoC"
}
# Root directory for results
result_folder = "../../out/"
# Model names
net_models = {
"optical_noc": ["mobilenet"]
}
# Log file names categorized by channel delay
log_files = {
"5ns": {
"report_sepnode_5.log": "Distinct Nodes (5ns)",
"report_samenode_5.log": "Same Node (5ns)"
},
"10ns": {
"report_sepnode_10.log": "Distinct Nodes (10ns)",
"report_samenode_10.log": "Same Node (10ns)"
}
}
# Conversion constants
NS_TO_US = 1000 # Convert nanoseconds to microseconds

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,73 +0,0 @@
# utils.py
import os
import re
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from parameters import titles, NS_TO_US
# Function to extract total simulation time from log file
def get_total_sim_time(log_path):
""" Extracts the total simulation time from a given log file """
with open(log_path, "r") as file:
lines = file.readlines()
last_time_ns = None
for line in reversed(lines): # Read from the end for efficiency
match = re.search(r"(\d+) ns: INFO: MY_LOG:", line)
if match:
last_time_ns = int(match.group(1))
break
return round(last_time_ns / NS_TO_US, 2) if last_time_ns else None
# Function to calculate throughput
def get_throughput(log_path, sim_time):
""" Calculates throughput as packets per microsecond """
if sim_time is None:
return None
last_packet_id = None
with open(log_path, "r") as file:
for line in reversed(file.readlines()): # Read from the end
match = re.search(r"Packet with id (\d+) arrived", line)
if match:
last_packet_id = int(match.group(1))
break
last_packet_id = last_packet_id + 1 # Total packets processed
return round(last_packet_id / sim_time, 2) if last_packet_id else None
# Function to generate the simulation time graph
def generate_sim_time_graph(sim_time_table, model, delay):
""" Plots total simulation time for the given model and delay setting """
plt.figure(figsize=(8, 5))
ax = sns.barplot(data=sim_time_table, x="architecture", y="simulation time (us)", hue="architecture",
palette="Blues", width=0.4, legend=False)
ax.set_title(f"Total Simulation Time ({titles.get(model, model)}) - {delay} Delay")
ax.set_ylabel("Simulation Time (us)")
# Label bars
for container in ax.containers:
ax.bar_label(container, fontsize=10)
plt.savefig(f"simulation_time_{model}_{delay}.png")
plt.savefig(f"simulation_time_{model}_{delay}.pdf")
plt.clf()
# Function to generate the throughput graph
def generate_throughput_graph(sim_time_table, model, delay):
""" Plots throughput for the given model and delay setting """
plt.figure(figsize=(8, 5))
ax = sns.barplot(data=sim_time_table, x="architecture", y="throughput (packets/us)", hue="architecture",
palette="Reds", width=0.4, legend=False)
ax.set_title(f"Throughput ({titles.get(model, model)}) - {delay} Delay")
ax.set_ylabel("Throughput (packets/us)")
# Label bars
for container in ax.containers:
ax.bar_label(container, fontsize=10)
plt.savefig(f"throughput_{model}_{delay}.png")
plt.savefig(f"throughput_{model}_{delay}.pdf")
plt.clf()

125
src/core.cpp Normal file
View file

@ -0,0 +1,125 @@
#include "core.h"
// Initiator module (processor core)
core::core(sc_module_name name) {
sc_report_handler::set_log_file_name("out/report.log");
sc_report_handler::set_actions(LOG_NAME, SC_INFO, SC_LOG|SC_DISPLAY);
SC_THREAD(thread);
target_socket.register_nb_transport_fw(this, &core::nb_transport_fw);
}
// Thread for sending data
void core::thread() {
// Initialize random seed (only once per run, for all cores)
static bool seeded = false;
if (!seeded) {
srand(time(0)); // Seed the random number generator
seeded = true;
}
// Infinite loop for sending data
while (true) {
my_payload* trans = nullptr;
// Core ID and source router ID from main logic
unsigned int source_core = source_core_id;
unsigned int src_router_id = source_router_id; // Source router from the main logic
sc_time delay = SC_ZERO_TIME; // Start with zero delay
sc_time inter_transaction_delay = sc_time(90, SC_NS); // Delay between transactions
// Loop to retry the same transaction
bool retry = false;
do {
if (!retry) {
// Generate random data between 0 and 100
int data = rand() % 101;
// Random destination router (ensuring it's different from source router)
unsigned int destination_router_id;
do {
destination_router_id = rand() % ROUTER_NO; // Random router ID between 0 and ROUTER_NO-1
} while (destination_router_id == src_router_id); // Ensure it's not the same as source router
// Destination core ID (random between 0 and CORE_NO-1)
unsigned int dst_core_id = rand() % CORE_NO;
// Create payload with generated values
trans = new my_payload(source_core, src_router_id, dst_core_id, destination_router_id, data);
trans->update_timestamp(sc_time_stamp()); // Set the current simulation time
// Construct the address (calculation based on router/core IDs)
unsigned int offset = 0x20; // offset
unsigned int address = (destination_router_id << 12) | (dst_core_id << 8) | offset;
trans->set_address(address);
// Print which core is currently sending the data
log_info( "Core " + std::to_string(source_core) + " of Source Router: " + std::to_string(source_router_id)
+ ": Processing data " + std::to_string(trans->data) + " for router " + std::to_string(destination_router_id)
+ " and core " + std::to_string(dst_core_id) + " at time: " + trans->timestamp.to_string());
}
// Set up the rest of the transaction
trans->set_byte_enable_ptr(nullptr);
trans->set_dmi_allowed(false);
trans->set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
tlm::tlm_phase phase = tlm::BEGIN_REQ; // Transaction phase
tlm::tlm_sync_enum status = socket->nb_transport_fw(*trans, phase, delay); // Non-blocking transport
if (status == tlm::TLM_COMPLETED || phase == tlm::END_REQ) {
log_info("Core " + std::string(name()) + ": Transaction successful, data sent: " + std::to_string(trans->data) + " at time: " + sc_time_stamp().to_string());
delete trans; // Clean up the transaction
retry = false; // Move on to the next transaction
wait(inter_transaction_delay);
} else if (status == tlm::TLM_ACCEPTED) {
log_info("Core " + std::string(name()) + ": Transaction accepted, waiting for completion.");
wait(delay); // Wait for response
retry = false; // No need to retry, accepted transaction will continue
} else if (status == tlm::TLM_UPDATED && phase == tlm::BEGIN_REQ) {
log_info("Core " + std::string(name()) + ": FIFO full, retrying...");
//wait(delay); // Wait for some time before retrying
// --i; // Retry the same transaction
wait(delay + sc_time(20, SC_NS)); // Add some delay before retrying
// wait(router->core_fifo_event);
retry = true; // Retry the same transaction
}
} while (retry);
wait(delay);
}
}
/// Forwarding function for receiving data from router
tlm::tlm_sync_enum core::nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay) {
if (phase == tlm::BEGIN_REQ) {
my_payload* my_trans = dynamic_cast<my_payload*>(&trans);
// Print which core is processing the received data
log_info("Core " + std::to_string(source_core_id) + " of parent Router: " + std::to_string(source_router_id)
+ ": Processing transaction " + "and received data: " + std::to_string(my_trans->data));
// log_info("Core " + std::string(name()) + ": Received transaction, data: " + std::to_string(my_trans->data));
// Send acknowledgment or status back
trans.set_response_status(tlm::TLM_OK_RESPONSE);
// Log the received data and remove the payload
delete my_trans;
return tlm::TLM_COMPLETED;
}
return tlm::TLM_ACCEPTED;
}
void core::log_info(std::string msg){
SC_REPORT_INFO(LOG_NAME, msg.c_str());
}
void core::log_error(std::string msg){
SC_REPORT_ERROR(LOG_NAME, msg.c_str());
}

View file

@ -1,65 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "systemc.h"
#include <iostream>
#include <fstream>
#include <string>
#include "boost/program_options.hpp"
#include "ratatoskrUtils/utils/GlobalResources.h"
#include "networkManager/NetworkManager.h"
// #include <boost/bind/bind.hpp>
// using namespace boost::placeholders;
namespace po = boost::program_options;
int sc_main(int arg_num, char *arg_vec[])
{
po::variables_map vm;
po::options_description desc("Allowed Options");
desc.add_options()("configFolder", po::value<std::string>()->default_value(""), "Input path for config.xml and net.xml");
try {
po::store(po::parse_command_line(arg_num, arg_vec, desc), vm);
po::notify(vm);
}
catch (po::error &e) {
cerr << "ERROR: " << e.what() << endl << endl << desc << endl;
return 1;
}
std::string configFolder = vm["configFolder"].as<std::string>();
// start simulation
std::unique_ptr<NetworkManager> networkManager =
std::make_unique<NetworkManager>("Layer", configFolder);
GlobalResources& globalResources = GlobalResources::getInstance();
cout << "Random seed " << globalResources.rd_seed << endl;
cout << endl
<< "Starting Simulation!" << endl;
sc_start(globalResources.simulation_time, SC_NS);
cout << endl
<< "Simulation completed! Time: "<< sc_time_stamp() << endl;
return 0;
}

View file

@ -1,347 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "NetworkInterfaceTlm.h"
#include <iostream>
#include "ratatoskrUtils/traffic/Flit.h"
#include "utils/configuration.h"
// #include "utils/utils.h"
//DECLARE_EXTENDED_PHASE(INTERNAL_PROC_PHASE);
using namespace std;
NetworkInterfaceTlm::NetworkInterfaceTlm(sc_module_name nm, Node& node) :
NetworkInterface(nm, node), lastReceivedCreditID(-1), credit_counter(0), ni_name(nm), resp_in_progress(false)
{
//change the sending tlm function name to different one for identification from receiving function
target_socket.register_nb_transport_fw(this, &NetworkInterfaceTlm::nb_transport_fw);
//sc_report_handler::set_actions(NI_LOG, SC_INFO, SC_LOG|SC_DISPLAY);
sc_report_handler::set_log_file_name("out/report.log");
sc_report_handler::set_actions(LOG_NAME, SC_INFO, SC_LOG|SC_DISPLAY);
try {
this->id = source_ni_id;
this->dbid = rep.registerElement("ProcessingElement", this->id);
this->node = node;
this->packetPortContainer = new PacketPortContainer(
("NI_PACKET_CONTAINER"+std::to_string(this->id)).c_str());
//copy(max_pos, max_pos + 3, this->max_pos);
}
catch (exception& e) {
log_error("Initialization Error: " + string(e.what()));
}
SC_THREAD(thread);
sensitive << clk.pos() << clk.neg();
SC_METHOD(receivePacketFromPE);
sensitive << packetPortContainer->portValidIn.pos();
}
NetworkInterfaceTlm::~NetworkInterfaceTlm() {
delete packetPortContainer;
}
void NetworkInterfaceTlm::initialize(){
/* NOT IMPLEMENTED */
}
void NetworkInterfaceTlm::bind(Connection* con, SignalContainer* sigContIn, SignalContainer* sigContOut) {
if (con==nullptr)
packetPortContainer->bind(sigContIn, sigContOut);
}
void NetworkInterfaceTlm::receiveFlitFromRouter(){
/* NOT IMPLEMENTED */
}
void NetworkInterfaceTlm::receivePacketFromPE() {
if (packetPortContainer->portValidIn.posedge()) {
//LOG(globalReport.verbose_pe_function_calls, "NI" << this->id << "(Node" << node.id << ")\t\t- receive()");
Packet* packet = packetPortContainer->portDataIn.read();
generateFlitsForPacket(packet);
packet_send_queue.push(packet);
}
}
void NetworkInterfaceTlm::getDestination(Packet* p, std::string pos[2]){
pos[0] = to_string(node.pos.x) + "," +
to_string(node.pos.y) + "," + to_string(node.pos.z);
pos[1] = to_string(p->dst.pos.x) + "," +
to_string(p->dst.pos.y) + "," +
to_string(p->dst.pos.z);
}
void NetworkInterfaceTlm::generateFlitsForPacket(Packet* p) {
int flitsPerPacket = p->size;
for (int i = 0; i<flitsPerPacket; ++i) {
FlitType flitType;
if (flitsPerPacket==1)
flitType = SINGLE;
else if (i%flitsPerPacket==0)
flitType = HEAD;
else if (i%flitsPerPacket==flitsPerPacket-1)
flitType = TAIL;
else
flitType = BODY;
int seqNum = i%flitsPerPacket;
Flit* current_flit = new Flit(flitType, seqNum, p, p->dataType, sc_time_stamp().to_double());
p->toTransmit.push_back(current_flit->id);
p->flits.push_back(current_flit);
std::string start_end_pos[2];
getDestination(p, start_end_pos);
log_info("Flits generated for packet of id "+ to_string(p->id)+
" to be sent to "+start_end_pos[1]+" from "+ start_end_pos[0]);
}
}
void NetworkInterfaceTlm::send_packet_to_router() {
my_payload* trans = nullptr;
sc_time delay = sc_time(0, SC_NS);
bool retry = false;
do {
if (!retry) { //When retry is false new flits are generated from packets
Packet* p = packet_send_queue.front();
// if no flits to transmit, generate them
if (p->toTransmit.empty()){
generateFlitsForPacket(p);
}
// get current flit to send
flitID_t f_id = p->toTransmit.front();
auto iter = find_if(p->flits.begin(), p->flits.end(),
[&f_id](Flit* f) { return f->id==f_id; });
Flit* current_flit = *iter;
current_flit->injectionTime = sc_time_stamp().to_double();
auto toDelete_pos = find(p->toTransmit.begin(), p->toTransmit.end(), current_flit->id);
p->toTransmit.erase(toDelete_pos);
p->inTransmit.push_back(current_flit->id);
if (p->toTransmit.empty()) {
packet_send_queue.pop();
}
unsigned int src_ni_id = p->src.id;
int src_router_id = ((src_ni_id - CORE_OFFSET) / CORE_NO);
unsigned int dst_ni_id = p->dst.id;
int destination_router_id = ((dst_ni_id - CORE_OFFSET) /CORE_NO);
std::cout<<"source router id is: "<< src_router_id<<" destination router id is: "<< destination_router_id << std::endl;
std::cout<<"source PE ID: "<<p->src.id<<" destination PE ID: "<<p->dst.id<<std::endl;
trans = new my_payload(src_ni_id, src_router_id, dst_ni_id, destination_router_id, current_flit, sc_time_stamp());
// Construct the address (calculation based on router/ni IDs)
unsigned int offset = 0x20; // Offset remains the same
unsigned int address = (destination_router_id << 16) | (dst_ni_id << 8) | offset;
trans->set_address(address);
log_info( "Network Interface " + std::to_string(src_ni_id) + " of Source Router: " + std::to_string(source_router_id)
+ ": Processing packet flit with ID: " + std::to_string(trans->data->id) + " for router " + std::to_string(destination_router_id)
+ " and Network Interface " + std::to_string(dst_ni_id) + " at time: " + trans->timestamp.to_string());
// Set up the rest of the transaction
trans->set_data_length(p->size);
trans->set_streaming_width(4);
trans->set_byte_enable_ptr(nullptr);
trans->set_dmi_allowed(false);
trans->set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
}
tlm::tlm_phase phase = tlm::BEGIN_REQ; // Transaction phase
tlm::tlm_sync_enum status = socket->nb_transport_fw(*trans, phase, delay); // Non-blocking transport
if (status == tlm::TLM_COMPLETED || phase == tlm::END_REQ) {
log_info("Network Interface " + ni_name + ": Transaction successful, flit sent ID: " + std::to_string(trans->data->id) + " at time: " + sc_time_stamp().to_string());
delete trans; // Clean up the transaction
retry = false; // Move on to the next transaction
//break;
//wait(50, SC_NS);
} else if (status == tlm::TLM_ACCEPTED) {
log_info("Network Interface " + ni_name + ": Transaction accepted, waiting for completion.");
wait(0, SC_NS); // Wait for response
retry = false; // No need to retry, accepted transaction will continue
// break;
} else if (status == tlm::TLM_UPDATED && phase == tlm::BEGIN_REQ) {
log_info("Network Interface " + ni_name + ": FIFO full, retrying...");
//wait(delay + sc_time(20, SC_NS)); // Add some delay before retrying
retry = true; // Retry the same transaction
wait(10, SC_NS); //Retry delay change from 20 to 10 NS
}
} while(retry); //when retry is true, the transaction is tried again since fifo is full
wait(0, SC_NS);
}
void NetworkInterfaceTlm::thread() {
while(true){
//log_info("send_data_process()");
if (clk.posedge()) {
if (!packet_send_queue.empty()) {
//if (credit_counter != 0){
send_packet_to_router();
//}
//else {
// log_info("Waiting for Router!");
//}
}
if (!packet_recv_queue.empty()) {
if (packetPortContainer->portFlowControlIn.read()) {
Packet* p = packet_recv_queue.front();
packet_recv_queue.pop();
packetPortContainer->portValidOut.write(true);
packetPortContainer->portDataOut.write(p);
// log arrival of packet
std::string start_end_pos[2];
getDestination(p, start_end_pos);
log_info("Packet with id " + to_string(p->id) +
" arrived at PE "+start_end_pos[1]);
}
}
}
else if (clk.negedge()) {
packetPortContainer->portValidOut.write(false);
}
wait();
}
}
tlm::tlm_sync_enum NetworkInterfaceTlm::nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay) {
if (phase == tlm::BEGIN_REQ) {
//my_payload* my_trans = dynamic_cast<my_payload*>(&trans);
sc_time current_time = sc_time_stamp();
//manually copy the transaction payload for future use
my_payload* orig_trans = dynamic_cast<my_payload*>(&trans);
my_payload* my_trans = new my_payload();
// Log the time when the ni sent the transaction
sc_time sent_time = orig_trans->timestamp;
my_trans->dst_ni = orig_trans->dst_ni;
my_trans->dst_router = orig_trans->dst_router;
my_trans->data = orig_trans->data;
my_trans->src_router = orig_trans->src_router;
int src_router_id = orig_trans->src_router;
my_trans->src_ni = orig_trans->src_ni;
my_trans->update_timestamp(current_time); // Update the timestamp in the payload
my_trans->set_address(orig_trans->get_address());
my_trans->set_command(orig_trans->get_command());
my_trans->set_data_ptr(reinterpret_cast<unsigned char*>(&my_trans->data));
my_trans->set_data_length(orig_trans->get_data_length());
my_trans->set_streaming_width(orig_trans->get_streaming_width());
my_trans->set_byte_enable_ptr(orig_trans->get_byte_enable_ptr());
my_trans->set_dmi_allowed(orig_trans->is_dmi_allowed());
my_trans->set_response_status(tlm::TLM_INCOMPLETE_RESPONSE);
// Push the transaction into the input FIFO by blocking write
// Print which ni is processing the received data
log_info("Network Interface " + std::to_string(source_ni_id) + " of parent Router: " + std::to_string(source_router_id)
+ ": Processing transaction " + "and received flit ID: " + std::to_string(my_trans->data->id));
// Send acknowledgment or status back
trans.set_response_status(tlm::TLM_OK_RESPONSE);
receive_and_process_flit(*my_trans);
// Log the received data and remove the payload
// delete my_trans;
phase = tlm::END_REQ; // Mark the end of the request phase
return tlm::TLM_COMPLETED;
}
return tlm::TLM_ACCEPTED;
}
void NetworkInterfaceTlm::receive_and_process_flit(tlm::tlm_generic_payload& trans){
trans.set_response_status(tlm::TLM_OK_RESPONSE);
my_payload* my_trans = dynamic_cast<my_payload*>(&trans);
//unsigned char* data_ptr = trans.get_data_ptr();
Flit* received_flit = my_trans->data;//reinterpret_cast<Flit*>(data_ptr);
Packet* p = received_flit->packet;
double time = sc_time_stamp().to_double();
log_info("Receive and process: The received flit id is: " + std::to_string(received_flit->id) + " of the packet with id: " + std::to_string(p->id));
auto position = find(p->inTransmit.begin(), p->inTransmit.end(), received_flit->id);
if (position!=p->inTransmit.end()){
p->inTransmit.erase(position);
log_info("Network Interface " + std::to_string(source_ni_id) + " of parent Router: " + std::to_string(source_router_id)
+ ": erased the received flit " + std::to_string(received_flit->id));
}
p->transmitted.push_back(received_flit->id);
if (received_flit->type==TAIL || received_flit->type==SINGLE){
stringstream ss;
std::string flit_type = received_flit->type==SINGLE ? "Single":"Tail";
ss << "Receive Flit " << flit_type << *received_flit;
log_info(ss.str());
}
if (!p->toTransmit.empty() || !p->inTransmit.empty()) {
stringstream ss;
ss << "Received Tail Flit, but still missing flits! "
<< *received_flit;
log_info(ss.str());
}
globalReport.issueNoCOutputDataAmount(sc_time_stamp(),globalResources.bitWidth);
if (p->toTransmit.empty() && p->inTransmit.empty())
packet_recv_queue.push(p);
//credit_counter++;
// if(resp_in_progress) {
// if(nxt_resp_pend){
// // log_fatal("Attempt to have two pending responses in target");
// nxt_resp_pend = &trans;
// }
// }
//else{ send_response(trans); }
}
void NetworkInterfaceTlm::log_info(std::string msg){
// string log_msg = ni_name + ": (Node" +
// to_string(node.id)+"): "+ msg;
SC_REPORT_INFO(LOG_NAME, (msg).c_str());
}
void NetworkInterfaceTlm::log_error(std::string msg){
// string log_msg = ni_name + ": (Node" +
// to_string(node.id)+"): "+ msg;
SC_REPORT_ERROR(LOG_NAME, (msg).c_str());
}
void NetworkInterfaceTlm::log_fatal(std::string msg){
// string log_msg = ni_name + ": (Node" +
// to_string(node.id)+"): "+ msg;
SC_REPORT_FATAL(LOG_NAME, (msg).c_str());
}

View file

@ -1,117 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
/** NetworkInterfaceTlm, which is a specialized version of NetworkInterface
NetworkInterfaceTlm handles the communication between the router and processing element (PE) in the NoC system.
It manages the sending and receiving of data packets and the flow control between these components. */
#pragma once
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
#endif
#include "systemc.h"
#include "tlm.h"
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <queue>
#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <ctime> // For time()
#include "ratatoskrUtils/utils/Structures.h"
#include "ratatoskrUtils/container/PacketContainer.h"
#include "ratatoskrUtils/utils/TrafficTracer.h"
#include "ratatoskrUtils/utils/GlobalResources.h" ///
#include "ratatoskrUtils/networkInterface/NetworkInterface.h"
#include "utils/configuration.h"
//#include "noc/noc.h"
#include "utils/noc_logger.h"
class NetworkInterfaceTlm : public NetworkInterface {
public:
tlm_utils::simple_initiator_socket<NetworkInterfaceTlm> socket;
tlm_utils::simple_target_socket<NetworkInterfaceTlm> target_socket;
unsigned int source_router_id;
unsigned int source_ni_id;
//typedef simple_initiator_socket_tagged<NetworkInterfaceTlm> ni_init_socket;
//typedef simple_target_socket_tagged<NetworkInterfaceTlm> ni_targ_socket;
std::queue<Packet*> packet_send_queue; //This is a queue where the network interface stores packets that need to be sent.
std::queue<Packet*> packet_recv_queue; //This is a queue for storing received packets, waiting to be processed.
std::string ni_name;
sc_in<bool> clk;
int credit_counter;
bool resp_in_progress;
PacketPortContainer* packetPortContainer; //This manages packet-level communication with the processing element (PE).
int creditCounter; //This keeps track of the available credits (flow control units) that manage how much data the network interface can send to the router.
int lastReceivedCreditID; //This records the last received credit ID from the router to ensure proper flow control and avoid overloading the network.
TrafficTracer& trafficTracer = TrafficTracer::getInstance(); //A reference to a global traffic tracing system. This helps log and analyze the flow of data (packets and flits) through the network interface for performance monitoring.
SC_HAS_PROCESS(NetworkInterfaceTlm);
NetworkInterfaceTlm(sc_module_name nm, Node& node);
~NetworkInterfaceTlm() override;
//Overridden Functions: These functions are inherited from the base NetworkInterface class and are specialized for this NetworkInterfaceVC class:
void initialize() override; //Initializes the network interface. This might involve setting initial values, like clearing the send and receive queues.
void bind(Connection* conn, SignalContainer* sigContIn,
SignalContainer* sigContOut) override; //This binds the network interface to other components (connections, signals) in the system.
void thread() override; //A process that will run in the SystemC simulation. It controls the main operations of the network interface, like handling packet transmission and reception.
void send_packet_to_router();
void receivePacketFromPE() override; //This function handles the reception of packets from the processing element (PE). These packets are placed in the packet_send_queue to be sent over the network.
void receiveFlitFromRouter() override; //Not implemented, another TLM function is used insted. Originally, This function deals with receiving flits from the router and reconstructing them into packets that can be processed by the PE.
void generateFlitsForPacket(Packet *p) override; //Converts a packet into flits to be sent over the network to the router.
void getDestination(Packet* p, std::string pos[2]);
void receive_and_process_flit(tlm::tlm_generic_payload& trans);
/// Forwarding function for receiving data from router
tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& trans, tlm::tlm_phase& phase, sc_time& delay);
void log_info(std::string msg);
void log_error(std::string msg);
void log_fatal(std::string msg);
};

View file

@ -1,129 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "NetworkManager.h"
#include "utils/noc_logger.h"
NetworkManager::NetworkManager(sc_module_name nm, std::string configFolder){
setup_logger();
dbid = rep.registerElement("NetworkManager", 0);
tlmNoc = new NocTlm("NocTlm", configFolder);
networkParticipants.resize(globalResources.nodes.size());
createTrafficPool();
createClocks();
createNetworkParticipants();
//createLinks();
runNoC();
}
void NetworkManager::createClocks() {
clocks.resize(globalResources.nodeTypes.size());
for (const auto &nodeType : globalResources.nodeTypes) {
clocks.at(nodeType->id) = std::make_unique<sc_clock>(
("NodeType" + std::to_string(nodeType->id) + "Clock").c_str(),
nodeType->clockDelay, SC_NS);
}
}
void NetworkManager::createTrafficPool() {
unsigned long numOfPEs = CORE_NO * globalResources.nodes.size() / 2;
#ifndef ENABLE_NETRACE
if (globalResources.benchmark == "task") {
tp = std::make_unique<TaskPool>();
} else if (globalResources.benchmark == "synthetic") {
tp = std::make_unique<SyntheticPool>();
} else {
FATAL("Please specify correct benchmark type");
}
#endif
// #ifdef ENABLE_NETRACE
// tp = std::make_unique<NetracePool>("NetracePool");
// #endif
tp->processingElements.resize(numOfPEs);
}
void NetworkManager::createNetworkParticipants() {
int numOfPEs = tp->processingElements.size();
for (int j = 0; j < ROUTER_NO; ++j) { // NI index within each router
}
for (Node &n : globalResources.nodes) {
if (n.type->model == "ProcessingElement") {
int id = (n.id-CORE_OFFSET)/CORE_NO;
int j = (n.id-CORE_OFFSET)%CORE_NO;
int index = tlmNoc->nis[id][j]->source_ni_id % numOfPEs;
NetworkInterfaceTlm* ni = tlmNoc->nis[id][j];
if (!ni) continue; // Ensure ni is valid
std::string pe_name = "pe_" + std::to_string(n.id) + "_" + std::to_string(j);
ProcessingElementVC *pe = new ProcessingElementVC(pe_name.c_str(), n, tp.get(), index);
auto sig1 = std::make_unique<PacketSignalContainer>(
("packetSigCon1_" + std::to_string(n.id) + "_" + std::to_string(j)).c_str());
auto sig2 = std::make_unique<PacketSignalContainer>(
("packetSigCon2_" + std::to_string(n.id) + "_" + std::to_string(j)).c_str());
ni->bind(nullptr, sig1.get(), sig2.get());
pe->bind(nullptr, sig2.get(), sig1.get());
ni->clk(*clocks.at(n.type->id));
networkParticipants.push_back(dynamic_cast<NetworkParticipant *>(pe));
packetSignalContainers.push_back(move(sig1));
packetSignalContainers.push_back(move(sig2));
if (index < tp->processingElements.size()) {
tp->processingElements[index] = pe;
}
}
}
}
void NetworkManager::runNoC() {
for (auto &r : networkParticipants) {
if (r) {
std::cout << "NM: Initialising network particapants " << endl;
r->initialize();
}
}
tp->start();
}
NetworkManager::~NetworkManager() {
for (auto &r : networkParticipants)
delete r;
networkParticipants.clear();
}
void NetworkManager::log_info(std::string msg){
SC_REPORT_INFO(NM_LOG, (msg).c_str());
}

View file

@ -1,83 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
#endif
#include <ratatoskrUtils/processingElement/ProcessingElementVC.h>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include "systemc.h"
#include "tlm.h"
#include "ratatoskrUtils/utils/Structures.h"
#include "ratatoskrUtils/utils/GlobalResources.h"
#include "ratatoskrUtils/utils/Report.h"
#include "ratatoskrUtils/traffic/TrafficPool.h"
#include "networkInterface/NetworkInterfaceTlm.h"
#include "ratatoskrUtils/traffic/synthetic/SyntheticPool.h"
#include "ratatoskrUtils/traffic/task/TaskPool.h"
#include "ratatoskrUtils/traffic/netrace/NetracePool.h"
#include "router/router.h"
#include "noc/noc.h"
using namespace tlm;
class NetworkManager : public sc_module{
public:
SC_HAS_PROCESS(NetworkManager);
explicit NetworkManager(sc_module_name, std::string);
~NetworkManager() override;
private:
GlobalResources& globalResources = GlobalResources::getInstance();
//GlobalReport& globalReport = GlobalReport::getInstance(); ////
Report& rep = Report::getInstance();
int dbid;
std::vector<std::unique_ptr<sc_clock>> clocks;
std::unique_ptr<TrafficPool> tp;
NocTlm* tlmNoc;
std::vector<NetworkParticipant*> networkParticipants;
std::vector<int> idNis;
std::vector<std::unique_ptr<PacketSignalContainer>> packetSignalContainers;
//std::vector<std::unique_ptr<Link>> links; ////
void createClocks(); //Create clocks for Ratatoskr PEs
void createTrafficPool(); //Create the traffic pool with the tasks for PEs
void createNetworkParticipants(); //Create Network Participants (creates PE and NI, and connects them)
//void createLinks(); //Connects Network Interface to Routers in NoC
void runNoC(); //Initialize routers and starts traffic pool
void log_info(std::string msg);
};

View file

@ -1,130 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
// NocTlm.cpp
#include "noc.h"
#include "utils/noc_logger.h"
#include "utils/utils.h"
NocTlm::NocTlm(sc_module_name nm, std::string config_folder): sc_module(nm) {
setup_logger();
// Create a semaphore manager instance
sem_mgr = new semaphore_manager("SemaphoreManager");
initializeGlobalResources(config_folder);
setup_routers_and_nis();
sc_report_handler::set_actions(N_LOG, SC_INFO, SC_LOG|SC_DISPLAY);
}
NocTlm::~NocTlm() {
// Clean up memory to avoid leaks
for (int i = 0; i < ROUTER_NO; ++i) {
for (int j = 0; j < CORE_NO; ++j) {
delete nis[i][j]; // Delete each NI
}
delete routers[i]; // Delete each router
}
}
void NocTlm::initializeGlobalResources(std::string config_folder) {
// initialize global resources and rep
globalResources = GlobalResources::getInstance();
GlobalReport &globalReport = GlobalReport::getInstance();
Report &rep = Report::getInstance();
sleep(1);
std::string config_path = "config/"+config_folder+"/config.xml";//"config/config.xml";
globalResources.readConfigFile(config_path);
globalReport.readConfigFile(config_path);
std::string network_path = "config/"+config_folder+"/net.xml";
//globalResources.noc_file;
globalResources.readNoCLayout(network_path);
globalResources.readTaskAndMapFiles(globalResources.data_file, globalResources.map_file);
//globalReport.resizeMatrices();
globalResources.activateFlitTracing = false;
globalResources.outputDirectory = "out";
}
void NocTlm::setup_routers_and_nis() {
// Instantiate ROUTER_NO routers
//globalResources.nodes.size()
for (Node &n : globalResources.nodes) {
if (n.type->model == "Router"){
int id = n.id;
std::string router_name = "router" + std::to_string(id);
routers[id] = new router(router_name.c_str());
// Store semaphores and out_fifos in vectors
router_sems.push_back(&routers[id]->sem);
router_out_fifos.push_back(&routers[id]->out_fifo);
routers[id]->set_semaphore_manager(sem_mgr); // Pass semaphore manager to each router
}
}
// Set up pointers to other routers' semaphores and out_fifos for each router
for (Node &n : globalResources.nodes) {
if (n.type->model == "Router"){
int id = n.id;
routers[id]->other_sems = router_sems;
routers[id]->other_out_fifos = router_out_fifos;
}
}
// Instantiate ROUTER_NO * CORE_NO nis (CORE_NO per router)
for (Node &n : globalResources.nodes) {
if (n.type->model == "Router"){
int id = n.id;
for (int j = 0; j < CORE_NO; ++j) { // NI index within each router
std::string ni_name = "ni" + std::to_string(id) + "_" + std::to_string(j);
nis[id][j] = new NetworkInterfaceTlm(ni_name.c_str(), n);
nis[id][j]->source_router_id = id; // Set source router ID
nis[id][j]->source_ni_id = CORE_NO*id + j + CORE_OFFSET; // Set source NI ID
}
}
}
// Bind NIs to their respective routers
for (Node &n : globalResources.nodes) {
if (n.type->model == "Router"){
int id = n.id;
for (int j = 0; j < CORE_NO; ++j) { // NI index within each router
nis[id][j]->socket.bind(routers[id]->sockets[j]); // NI's socket to router's target socket
routers[id]->core_sockets[j].bind(nis[id][j]->target_socket); // Router's initiator socket to ni's target socket
routers[id]->current_router_id = id;
}
}
}
}
void NocTlm::log_info(std::string msg){
SC_REPORT_INFO(N_LOG, (msg).c_str());
}
void NocTlm::log_warn(std::string msg){
SC_REPORT_WARNING(N_LOG, (msg).c_str());
}
void NocTlm::log_error(std::string msg){
SC_REPORT_ERROR(N_LOG, (msg).c_str());
}

View file

@ -1,86 +0,0 @@
/*******************************************************************************
* Copyright (C) 2024
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
// NocTlm.h
// #ifndef NOCTLM_H
// #define NOCTLM_H
#pragma once
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
#endif
#include <systemc.h>
#include <tlm.h>
#include <tlm_utils/simple_initiator_socket.h>
#include <tlm_utils/simple_target_socket.h>
#include <queue>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include "utils/configuration.h"
#include "utils/semaphore_manager.h"
#include "router/router.h"
#include "networkInterface/NetworkInterfaceTlm.h"
#include "ratatoskrUtils/utils/Structures.h"
#include "ratatoskrUtils/utils/GlobalReport.h"
#include "ratatoskrUtils/utils/GlobalResources.h"
using namespace tlm;
class NocTlm : public sc_core::sc_module {
public:
SC_HAS_PROCESS(NocTlm);
// Constructor and destructor
explicit NocTlm(sc_module_name, std::string);
~NocTlm() override;
uint8_t max_pos[3];
std::map<int, int> mapNodePERouter;
void initializeGlobalResources(std::string config_folder);
GlobalResources& globalResources = GlobalResources::getInstance();
router* routers[ROUTER_NO];
NetworkInterfaceTlm* nis[ROUTER_NO][CORE_NO];
std::vector<sc_core::sc_semaphore*> router_sems;
std::vector<sc_core::sc_fifo<my_payload*>*> router_out_fifos;
semaphore_manager* sem_mgr;
// Method to initialize the routers and nis
void setup_routers_and_nis();
void log_info(std::string msg);
void log_warn(std::string msg);
void log_error(std::string msg);
};
// #endif // NOCTLM_H

View file

@ -1,104 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "Container.h"
class ClassicSignalContainer : public SignalContainer {
public:
sc_signal<bool> sigValid;
sc_signal<std::vector<bool>*> sigFlowControl;
sc_signal<Flit*> sigData;
sc_signal<int> sigVc;
ClassicSignalContainer(sc_module_name nm)
:
SignalContainer(nm)
{
};
~ClassicSignalContainer()
{
};
};
class ClassicPortContainer : public PortContainer {
public:
sc_in<bool> portValidIn;
sc_in<std::vector<bool>*> portFlowControlIn;
sc_in<Flit*> portDataIn;
sc_in<int> portVcIn;
sc_out<bool> portValidOut;
sc_out<std::vector<bool>*> portFlowControlOut;
sc_out<Flit*> portDataOut;
sc_out<int> portVcOut;
ClassicPortContainer(sc_module_name nm)
:
PortContainer(nm)
{
};
~ClassicPortContainer()
{
};
void bind(SignalContainer* sIn, SignalContainer* sOut)
{
auto cscin = dynamic_cast<ClassicSignalContainer*>(sIn);
auto cscout = dynamic_cast<ClassicSignalContainer*>(sOut);
assert(cscin);
assert(cscout);
portValidIn(cscin->sigValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portVcIn(cscin->sigVc);
portValidOut(cscout->sigValid);
portFlowControlOut(cscout->sigFlowControl);
portDataOut(cscout->sigData);
portVcOut(cscout->sigVc);
};
void bindOpen(SignalContainer* sIn)
{
auto cscin = dynamic_cast<ClassicSignalContainer*>(sIn);
assert(cscin);
portValidIn(cscin->sigValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portVcIn(cscin->sigVc);
portValidOut(portOpen);
portFlowControlOut(portOpen);
portDataOut(portOpen);
portVcOut(portOpen);
}
};

View file

@ -1,42 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include "ratatoskrUtils/utils/portsOpenConst.h"
class SignalContainer : public sc_module {
public:
explicit SignalContainer(const sc_module_name& nm) { };
~SignalContainer() override = default;
};
class PortContainer : public sc_module {
public:
explicit PortContainer(const sc_module_name& nm) { };
~PortContainer() override = default;
virtual void bind(SignalContainer*, SignalContainer*) = 0;
};

View file

@ -1,109 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "Container.h"
#include "ratatoskrUtils/traffic/Flit.h"
#include "ratatoskrUtils/utils/Structures.h"
class FlitSignalContainer : public SignalContainer {
public:
sc_signal<bool> sigValid;
sc_signal<bool> sigFlowControlValid;
sc_signal<Credit> sigFlowControl;
sc_signal<Flit*> sigData;
sc_signal<int> sigVc;
explicit FlitSignalContainer(const sc_module_name& nm)
:
SignalContainer(nm)
{
}
~FlitSignalContainer() override = default;
};
class FlitPortContainer : public PortContainer {
public:
sc_in<bool> portValidIn;
sc_in<bool> portFlowControlValidIn;
sc_in<Credit> portFlowControlIn;
sc_in<Flit*> portDataIn;
sc_in<int> portVcIn;
sc_out<bool> portValidOut;
sc_out<bool> portFlowControlValidOut;
sc_out<Credit> portFlowControlOut;
sc_out<Flit*> portDataOut;
sc_out<int> portVcOut;
explicit FlitPortContainer(const sc_module_name& nm)
:
PortContainer(nm)
{
}
~FlitPortContainer() override = default;
void bind(SignalContainer* sIn, SignalContainer* sOut) override
{
auto cscin = dynamic_cast<FlitSignalContainer*>(sIn);
auto cscout = dynamic_cast<FlitSignalContainer*>(sOut);
assert(cscin);
assert(cscout);
portValidIn(cscin->sigValid);
portFlowControlValidIn(cscin->sigFlowControlValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portVcIn(cscin->sigVc);
portValidOut(cscout->sigValid);
portFlowControlValidOut(cscout->sigFlowControlValid);
portFlowControlOut(cscout->sigFlowControl);
portDataOut(cscout->sigData);
portVcOut(cscout->sigVc);
}
void bindOpen(SignalContainer* sIn)
{
auto cscin = dynamic_cast<FlitSignalContainer*>(sIn);
assert(cscin);
portValidIn(cscin->sigValid);
portFlowControlValidIn(cscin->sigFlowControlValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portVcIn(cscin->sigVc);
portValidOut(portOpen);
portFlowControlValidOut(portOpen);
portFlowControlOut(portOpen);
portDataOut(portOpen);
portVcOut(portOpen);
}
};

View file

@ -1,90 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "Container.h"
#include "ratatoskrUtils/traffic/Packet.h"
class PacketSignalContainer : public SignalContainer {
public:
sc_signal<bool> sigValid;
sc_signal<bool> sigFlowControl;
sc_signal<Packet*> sigData;
explicit PacketSignalContainer(const sc_module_name& nm)
:
SignalContainer(nm)
{
};
~PacketSignalContainer() override = default;
};
class PacketPortContainer : public PortContainer {
public:
sc_in<bool> portValidIn;
sc_in<bool> portFlowControlIn;
sc_in<Packet*> portDataIn;
sc_out<bool> portValidOut;
sc_out<bool> portFlowControlOut;
sc_out<Packet*> portDataOut;
explicit PacketPortContainer(const sc_module_name& nm)
:
PortContainer(nm)
{
}
~PacketPortContainer() override = default;
void bind(SignalContainer* sIn, SignalContainer* sOut) override
{
auto cscin = dynamic_cast<PacketSignalContainer*>(sIn);
auto cscout = dynamic_cast<PacketSignalContainer*>(sOut);
assert(cscin);
assert(cscout);
portValidIn(cscin->sigValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portValidOut(cscout->sigValid);
portFlowControlOut(cscout->sigFlowControl);
portDataOut(cscout->sigData);
};
void bindOpen(SignalContainer* sIn)
{
auto cscin = dynamic_cast<PacketSignalContainer*>(sIn);
assert(cscin);
portValidIn(cscin->sigValid);
portFlowControlIn(cscin->sigFlowControl);
portDataIn(cscin->sigData);
portValidOut(portOpen);
portFlowControlOut(portOpen);
portDataOut(portOpen);
}
};

View file

@ -1,114 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "Link.h"
Link::Link(sc_module_name nm, const Connection& c, int globalID)
:
id(c.id),
globalID(globalID),
previousTransmissionState(0),
currentTransmissionState(0)
{
classicPortContainer = new FlitPortContainer(
("link_portCont_"+std::to_string(this->id)).c_str());
// this->rawDataOutput = new ofstream((std::string) nm + ".txt");
SC_THREAD(passthrough_thread);
sensitive << clk.pos();
}
Link::~Link()
{
delete classicPortContainer;
// rawDataOutput->close();
// delete rawDataOutput;
}
void Link::passthrough_thread()
{
while (true) {
wait();
wait(0, SC_NS);
std::string outputToFile;
int IDLESTATE = 0;
int HEADSTATE = 1;
int HEADIDLESTATE = 2;
int offset = 3; // three fields: idle, head, headidle
if (!classicPortContainer->portValidIn.read()) {
// this cycle idle
if (previousTransmissionState==IDLESTATE) {
// initially, no flits traverse links
outputToFile = "__;";
currentTransmissionState = IDLESTATE;
}
else if (flitType==HEAD) {
// a head flit traversed previously
outputToFile = std::to_string(flitDataType) + "_;";
currentTransmissionState = HEADIDLESTATE;
}
else {
// a flit already traversed the links
outputToFile = std::to_string(flitDataType) + "_;";
if (flitType!=HEAD && flitType!=BODY && flitType!=TAIL)
continue;
currentTransmissionState = (2*flitDataType) + offset + 1;
}
}
else {
// this cycle active
Flit* currentFlit = classicPortContainer->portDataIn.read();
flitType = currentFlit->type;
flitDataType = currentFlit->dataType;
flitID = currentFlit->id;
if (flitType==HEAD) {
//received head flit
outputToFile = "HD;";
currentTransmissionState = HEADSTATE;
}
else {
// received data flit
outputToFile = std::to_string(flitDataType) + "D;";
if (flitType!=HEAD && flitType!=BODY && flitType!=TAIL)
continue;
currentTransmissionState = (2*flitDataType) + offset;
}
}
//rawDataOutput->write(outputToFile.c_str(), 3);
//rawDataOutput->flush();
report.issueLinkMatrixUpdate(globalID, currentTransmissionState, previousTransmissionState);
previousTransmissionState = currentTransmissionState;
}
}
void Link::bind(SignalContainer* sigContIn, SignalContainer* sigContOut)
{
classicPortContainer->bind(sigContIn, sigContOut);
}
void Link::bindOpen(SignalContainer* sigContIn)
{
classicPortContainer->bindOpen(sigContIn);
}

View file

@ -1,62 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <iostream>
#include <fstream>
#include "ratatoskrUtils/traffic/Flit.h"
#include "ratatoskrUtils/traffic/Packet.h"
#include "ratatoskrUtils/container/FlitContainer.h"
#include "ratatoskrUtils/utils/GlobalResources.h"
#include "ratatoskrUtils/utils/GlobalReport.h"
class Link : public sc_module {
public:
GlobalResources& globalResources = GlobalResources::getInstance();
GlobalReport& report = GlobalReport::getInstance();
int id, globalID;
dataTypeID_t flitDataType;
flitID_t flitID;
FlitType flitType;
int previousTransmissionState;
int currentTransmissionState;
// UNCOMMENT FOR RAW DATA ON LINK (@Lennart)
// ofstream *rawDataOutput;
sc_in<bool> clk;
FlitPortContainer* classicPortContainer;
SC_HAS_PROCESS(Link);
Link(sc_module_name nm, const Connection& c, int globalID);
~Link() override;
void bind(SignalContainer* sigContIn, SignalContainer* sigContOut);
void bindOpen(SignalContainer* sigContIn);
void passthrough_thread();
};

View file

@ -1,45 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <set>
#include <ratatoskrUtils/utils/PacketFactory.h>
#include "ratatoskrUtils/utils/GlobalResources.h"
#include "ratatoskrUtils/utils/GlobalReport.h"
#include "ratatoskrUtils/utils/Report.h"
#include "ratatoskrUtils/container/Container.h"
class NetworkParticipant {
public:
GlobalResources& globalResources = GlobalResources::getInstance();
GlobalReport& globalReport = GlobalReport::getInstance();
Report& rep = Report::getInstance();
PacketFactory& packetFactory = PacketFactory::getInstance();
virtual void initialize() = 0;
virtual void bind(Connection*, SignalContainer*, SignalContainer*) = 0;
~NetworkParticipant() = default;
};

View file

@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "NetworkInterface.h"
NetworkInterface::NetworkInterface(sc_module_name nm, Node& node)
:
id(node.id),
node(node)
{
this->dbid = rep.registerElement("NetworkInterface", this->id);
rep.reportAttribute(dbid, "pos_x", std::to_string(node.pos.x));
rep.reportAttribute(dbid, "pos_y", std::to_string(node.pos.y));
rep.reportAttribute(dbid, "pos_z", std::to_string(node.pos.z));
rep.reportAttribute(dbid, "clock", std::to_string(node.type->clockDelay));
rep.reportAttribute(dbid, "type", node.type->model);
}

View file

@ -1,52 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <queue>
#include <algorithm>
#include "ratatoskrUtils/model/NetworkParticipant.h"
#include "ratatoskrUtils/utils/Structures.h"
#include "ratatoskrUtils/utils/GlobalReport.h"
#include "ratatoskrUtils/traffic/Packet.h"
class NetworkInterface : public NetworkParticipant, public sc_module {
public:
int id;
int dbid;
Node node;
Report& rep = Report::getInstance();
SC_HAS_PROCESS(NetworkInterface);
NetworkInterface(sc_module_name nm, Node& node);
virtual void thread() = 0;
virtual void receivePacketFromPE() = 0;
virtual void receiveFlitFromRouter() = 0;
virtual void generateFlitsForPacket(Packet *p) = 0;
};

View file

@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "ProcessingElement.h"
ProcessingElement::ProcessingElement(sc_module_name mn, Node& node, TrafficPool* tp, int node_id)
:
node(node),
trafficPool(tp)
{
this->id = node_id;//node.id%(globalResources.nodes.size()/2);
this->dbid = rep.registerElement("NetworkInterface", this->id);
rep.reportAttribute(dbid, "pos_x", std::to_string(node.pos.x));
rep.reportAttribute(dbid, "pos_y", std::to_string(node.pos.y));
rep.reportAttribute(dbid, "pos_z", std::to_string(node.pos.z));
rep.reportAttribute(dbid, "clock", std::to_string(node.type->clockDelay));
rep.reportAttribute(dbid, "type", node.type->model);
}

View file

@ -1,51 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <queue>
#include <algorithm>
#include "ratatoskrUtils/model/NetworkParticipant.h"
class TrafficPool;
class ProcessingElement : public NetworkParticipant, public sc_module {
public:
int id;
int dbid;
Node& node;
TrafficPool* trafficPool;
SC_HAS_PROCESS(ProcessingElement);
ProcessingElement(sc_module_name mn, Node& node, TrafficPool* tp, int node_id);
virtual void receive() = 0;
virtual void execute(Task&) = 0;
//virtual void execute(TaskCS&) = 0;
virtual void thread() = 0;
};

View file

@ -1,488 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include <ratatoskrUtils/processingElement/ProcessingElementVC.h>
ProcessingElementVC::ProcessingElementVC(sc_module_name mn, Node& node, TrafficPool* tp, int node_id)
:
ProcessingElement(mn, node, tp, node_id)
{
setup_logger();
sc_report_handler::set_actions(PE_LOG, SC_INFO, SC_LOG|SC_DISPLAY);
this->packetPortContainer = new PacketPortContainer(("NI_PACKET_CONTAINER"+std::to_string(this->id)).c_str());
SC_THREAD(thread);
SC_METHOD(receive);
sensitive << packetPortContainer->portValidIn.pos();
}
void ProcessingElementVC::initialize()
{
packetPortContainer->portValidOut.write(false);
packetPortContainer->portFlowControlOut.write(true);
// sc_spawn(sc_bind(&SyntheticPool::sendThread, this, con.first,
// con.second,initDelay,sp.waveCount,sp.waveDelay,sp.pkgPerWave, sp.name));
}
void ProcessingElementVC::thread()
{
#ifndef ENABLE_NETRACE
while(true) {
int timeStamp = static_cast<int>(sc_time_stamp().value()/1000);
std::vector<DataDestination> removeList;
// EXPLAIN: check if time of the task has already been passed. If it has passed remove it.
for (auto const& tw : destWait) {
DataDestination dest = tw.first;
Task task = destToTask.at(dest);
if (taskTerminationTime.count(task) && taskTerminationTime.at(task)<timeStamp) {
removeList.push_back(dest);
}
}
// EXPLAIN: removing task
for (auto& dest : removeList) {
log_info(std::to_string(this->id) + " Removing task "
+ std::to_string(destToTask.at(dest).id));
Task task = destToTask.at(dest);
destToTask.erase(dest);
taskToDest.erase(task);
taskRepeatLeft.erase(task);
taskStartTime.erase(task);
taskTerminationTime.erase(task);
countLeft.erase(dest);
destWait.erase(dest);
}
// EXPLAIN: loop through all destination that are waiting
for (auto const& pair : destWait) {
DataDestination dest = pair.first;
// EXPLAIN: check if the current time is smaller or equal to the time of the destination if yes generate packet
if (pair.second<=timeStamp) {
std::string curr_task_id = std::to_string(destToTask.at(dest).id);
Task t = globalResources.tasks.at(dest.destinationTask);
Node dstNode = globalResources.nodes.at(t.nodeID);
Packet* p = packetFactory.createPacket(this->node, dstNode, globalResources.flitsPerPacket, sc_time_stamp().to_double(),
dest.dataType);
double time = sc_time_stamp().to_double();
// EXPLAIN: create packet and send it
if ((float) globalResources.synthetic_start_measurement_time<=(time/1000))
globalReport.undeliveredPackages++;
packetPortContainer->portValidOut = true;
packetPortContainer->portDataOut = p;
// EXPLAIN: decrement number of packets left to be sent
countLeft.at(dest)--;
log_info(std::to_string(this->id) + " Node: " + std::to_string(node.id) +
" Packets left to be sent: " + std::to_string(countLeft.at(dest))); ////CORONA
// EXPLAIN: if there are no more packet to this destination remove destination from list of destinations
if (!countLeft.at(dest)) {
countLeft.erase(dest);
destWait.erase(dest);
log_info(std::to_string(this->id) + " Task " + curr_task_id +
" has sent all packets to destination task " +
std::to_string(t.id));
Task task = destToTask.at(dest);
destToTask.erase(dest);
taskToDest.at(task).erase(dest);
// EXPLAIN: There are no more destinations to the task, all packets of the task has been send
if (taskToDest.at(task).empty()) {
taskToDest.erase(task);
execute(task);
}
}
// EXPLAIN: is there are more packets to the destination schedule the next packet
else {
destWait.at(dest) =
globalResources.getRandomIntBetween(dest.minInterval, dest.maxInterval)+timeStamp;
}
break;
}
}
wait(SC_ZERO_TIME);
packetPortContainer->portValidOut = false;
// log_info(std::to_string(this->id) + " Node: " + std::to_string(node.id) +
// " Port valid out is false again"); ////CORONA
int nextCall = -1;
for (auto const& dw : destWait) {
if (nextCall>dw.second || nextCall==-1) {
/* In synthetic mode, we want to apply uniform_batch_mode experiment,
* that means all tasks need to send data once in one interval
* with some random offset in each interval.
*/
/* TODO:
* Attention: we are always taking the minStart and minInterval to calculate the nextCall.
* In the future, we may add randomness to the process,
* by selecting a number between minStart and maxStart,
* and the same thing for minInterval and maxInterval.
*/
if (globalResources.benchmark=="synthetic") {
Task task = this->destToTask.at(dw.first);
int minInterval = dw.first.minInterval;
if (timeStamp<task.minStart) {
nextCall = task.minStart+globalResources.getRandomIntBetween(0, minInterval-1);
}
else {
int numIntervalsPassed = (timeStamp-task.minStart)/minInterval;
int intervalBeginning = task.minStart+(numIntervalsPassed*minInterval);
nextCall = intervalBeginning+minInterval+globalResources.getRandomIntBetween(0, minInterval-1);
}
}
else { // if not synthetic, then execute the original behavior
nextCall = dw.second;
}
}
}
if (nextCall==0) { // limit packet rate
nextCall = 1;
}
if (nextCall!=-1) {
event.notify(nextCall-timeStamp, SC_NS);
}
wait(event);
}
#endif
#ifdef ENABLE_NETRACE
ntNetrace ntnetrace;
int flitsLastPacket= globalResources.flitsPerPacket;
float bytesPerFlit = (float) globalResources.bitWidth / 8.0f;
float bytesPerPacket = ((float) globalResources.flitsPerPacket - 1.0f) * bytesPerFlit; // -1.0f for header flit
nt_packet_t trace_packet;
Node dstNode;
//definition of the netrace mode, in which the PE forwards packets to the NIs. Packets are generated in the central NetracePool.
while(true){
if (globalResources.netraceNodeToTask.find(this->node.id) == globalResources.netraceNodeToTask.end()){
auto clockDelay = this->node.type->clockDelay;
event.notify(clockDelay, SC_NS);
wait(event);
continue;
}
if(ntInject.empty()){
auto clockDelay = this->node.type->clockDelay;
event.notify(clockDelay, SC_NS);
wait(event);
continue;
}
trace_packet = *ntInject.front().first.packet;
ntInject.pop();
float packetSizeInByte = (float) ntnetrace.nt_packet_sizes[trace_packet.type];
int bytesLastPacket = (int)packetSizeInByte % (int)bytesPerPacket;
int packetsLeft = ((int)packetSizeInByte/ (int)bytesPerPacket) + (int)(bool)(bytesLastPacket);
if (0 == bytesLastPacket)
bytesLastPacket = (int)bytesPerPacket;
flitsLastPacket = (int) ceil(bytesLastPacket / bytesPerFlit) + 1; //header flit
dstNode = globalResources.nodes.at(trace_packet.dst);
Packet* p;
do{
if (packetsLeft > 1)
p = packetFactory.createPacket(this->node, dstNode, globalResources.flitsPerPacket, sc_time_stamp().to_double(),1);
else
p = packetFactory.createPacket(this->node, dstNode, flitsLastPacket , sc_time_stamp().to_double(),1);
packetPortContainer->portValidOut = true;
packetPortContainer->portDataOut = p;
wait(SC_ZERO_TIME);
packetPortContainer->portValidOut = false;
auto clockDelay = this->node.type->clockDelay;
event.notify(clockDelay, SC_NS);
wait(event);
}while(--packetsLeft > 0);
}
#endif
}
void ProcessingElementVC::execute(Task& task)
{
log_info(std::to_string(this->id) + " Executing task " + std::to_string(task.id));
// EXPLAIN: if there are no repetitions of the task left, create a new number of repetitions (probably used only in the first call for init)
if (!taskRepeatLeft.count(task)) {
taskRepeatLeft[task] = globalResources.getRandomIntBetween(task.minRepeat, task.maxRepeat);
log_info(std::to_string(this->id) + " Initialized repetitions for task " + std::to_string(task.id) +
" with repeatation count " + std::to_string(taskRepeatLeft[task]));
}
else {
// EXPLAIN: decrement the number of repetitions left by 1 and if they reach 0 after that remove the task from list (task is done).
if (taskRepeatLeft.at(task)>0) {
taskRepeatLeft.at(task)--;
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) +
" repetitions left: " + std::to_string(taskRepeatLeft.at(task)));
}
if (!taskRepeatLeft.at(task)) {
taskRepeatLeft.erase(task);
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id)
+ " completed all repetitions.");
return;
}
}
// EXPLAIN: if there is no start time init one
if (!taskStartTime.count(task)) {
taskStartTime[task] = globalResources.getRandomIntBetween(task.minStart, task.maxStart);
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) +
" start time initialized at " + std::to_string(taskStartTime[task]));
}
// EXPLAIN: if there is no termination time init one
if (!taskTerminationTime.count(task) && task.minDuration!=-1) {
taskTerminationTime[task] =
taskStartTime[task]+globalResources.getRandomIntBetween(task.minDuration, task.maxDuration);
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) +
" termination time set at " + std::to_string(taskTerminationTime[task]));
}
// EXPLAIN: if there are no requirements left start sending
if (task.requirements.empty()) {
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) + " met all requirements, starting sending.");
startSending(task);
}
else {
// EXPLAIN: go through all requirements and add them to lists
for (DataRequirement& r : task.requirements) {
neededFor[r.dataType].insert(task);
neededAmount[std::make_pair(task, r.dataType)] = globalResources.getRandomIntBetween(r.minCount,
r.maxCount);
needs[task].insert(r.dataType);
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) +
" requires data type " + std::to_string(r.dataType) +
" amount: " + std::to_string(neededAmount[std::make_pair(task, r.dataType)]));
}
// maybe all packets have arrived so we check the requirements
checkNeed();
}
}
void ProcessingElementVC::bind(Connection* con, SignalContainer* sigContIn, SignalContainer* sigContOut)
{
packetPortContainer->bind(sigContIn, sigContOut);
}
void ProcessingElementVC::receive()
{
LOG(globalReport.verbose_pe_function_calls,
"PE" << this->id << "(Node" << node.id << ")\t- receive_data_process()");
//log_info(std::to_string(this->id) + " Node: " + std::to_string(node.id) + " Received data process " ); ////CORONA
// EXPLAIN: checks for positive edge of the validIn signal. This is the trigger
if (packetPortContainer->portValidIn.posedge()) {
// EXPLAIN: read packet from port
Packet* received_packet = packetPortContainer->portDataIn.read();
if (received_packet) {
dataTypeID_t type = received_packet->dataType;
log_info(std::to_string(this->id) + " The received packet id: "
+ std::to_string(received_packet->id) + " of type: "
+ std::to_string(received_packet->dataType));
// EXPLAIN: check if receivedData already has a counter for the packet type of the received packet. If yes increment if, if no create one
if (receivedData.count(type)) {
++receivedData.at(type);
}
else {
receivedData[type] = 1;
}
// EXPLAIN: check if now all required data has arrived and if yes start sending data
checkNeed();
// EXPLAIN: delete packet
packetFactory.deletePacket(received_packet);
}
}
}
// EXPLAIN: select possible destinations and set all timings and packet numbers for these destinations they are saved in destWait
void ProcessingElementVC::startSending(Task& task)
{
// EXPLAIN: There are multiple possibilities where to send the data. Select one based on probability
float rn = globalResources.getRandomFloatBetween(0, 1);
int numOfPoss = task.possibilities.size();
/* Additional code to handle destinations and requirements start here*/
int numOfDests = 0;
if(numOfPoss) {
numOfDests = task.possibilities.at(0).dataDestinations.size();
}
// for tasks with no destinations, only requirements
if (!numOfDests) {
taskRepeatLeft.at(task)--;
if (taskRepeatLeft.at(task)){
for (DataRequirement& r : task.requirements) {
log_info(std::to_string(this->id) + " Requirement of id " + std::to_string(r.id) +
" of type " + std::to_string(r.dataType) +
" created for task " + std::to_string(task.id));
neededFor[r.dataType].insert(task);
int amount_req = globalResources.getRandomIntBetween(r.minCount, r.maxCount);
neededAmount[std::make_pair(task, r.dataType)] = amount_req;
//neededAmountHold[std::make_pair(task, r.dataType)] = amount_req;
needs[task].insert(r.dataType);
}
checkNeed();
}
}
/* Additional code to handle destinations and requirements until here*/
for (unsigned int i = 0; i<numOfPoss; ++i) {
if (task.possibilities.at(i).probability>rn) {
// EXPLAIN: A possibility is chosen. Set the destinations of this possibility as the dest of the task
std::vector<DataDestination> destVec = task.possibilities.at(i).dataDestinations;
for (DataDestination& dest : destVec) {
destToTask[dest] = task;
taskToDest[task].insert(dest);
// EXPLAIN: get random packet count per dest
countLeft[dest] = globalResources.getRandomIntBetween(dest.minCount, dest.maxCount);
// EXPLAIN: random delay time to start sending data to dest
int delayTime =
static_cast<int>((sc_time_stamp().value()/1000)
+globalResources.getRandomIntBetween(dest.minDelay, dest.maxDelay));
if (taskStartTime.count(task) && taskStartTime.at(task)>delayTime) {
destWait[dest] = taskStartTime.at(task);
}
else {
destWait[dest] = delayTime;
}
log_info(std::to_string(this->id) + " Task " + std::to_string(task.id) + " with destination of id " +
std::to_string(dest.id) + " and task id " +
std::to_string(dest.destinationTask) + " of type " +
std::to_string(dest.dataType) + " created");
// EXPLAIN: schedule event in systemC
event.notify(SC_ZERO_TIME);
}
break;
}
else {
rn -= task.possibilities.at(i).probability;
}
}
}
void ProcessingElementVC::checkNeed()
{
// EXPLAIN: iterate through received data
for (auto const& data : receivedData) {
dataTypeID_t type = data.first;
std::vector<std::pair<Task, dataTypeID_t>> removeList;
log_info(std::to_string(this->id) + " Checking need for data type: " + std::to_string(type));
// EXPLAIN: check if there are task that need this data
if (neededFor.count(type)) {
// EXPLAIN: iterate over tasks needing the data
for (const Task& t : neededFor.at(type)) {
std::pair<Task, dataTypeID_t> pair = std::make_pair(t, type);
neededAmount.at(pair) -= receivedData.at(type);
log_info(std::to_string(this->id) + " Checking requirements: Task " + std::to_string(t.id) +
" received " + std::to_string(receivedData.at(type)) +
" of type " + std::to_string(type) +
", remaining: " + std::to_string(neededAmount.at(pair)));
/* This line was commented out because if a task requires several packets from several data types,
it says that the task is finished receiving the required packets while in fact, it still needs some packets.
receivedData.at(type) = 0;
*/
receivedData.at(type) = 0; //uncommented, since the nodes generate packets before fullfilling the requirements in the earlier scenario
log_info(std::to_string(this->id) + " Required number of packets of type " + std::to_string(type)+
" for task " + std::to_string(t.id) + " updated and the current value is: " +
std::to_string(neededAmount.at(pair)));
// EXPLAIN: check if the needed amount (datatype for specific task) is reached. If yes remove the pair
if (neededAmount.at(pair)<=0) {
removeList.push_back(pair);
log_info(std::to_string(this->id) + " Task " + std::to_string(t.id) +
" requirement for type " + std::to_string(type) + " is now fulfilled.");
// This line is also commented out for the same reason mentioned above.
// receivedData.at(type) = -neededAmount.at(pair);
receivedData.at(type) = -neededAmount.at(pair); //uncommented due to the data sending before requirement satisfied issue
}
}
}
// EXPLAIN: remove data from lists
for (auto& p : removeList) {
neededFor.erase(p.second);
neededAmount.erase(p);
needs.at(p.first).erase(p.second);
log_info(std::to_string(this->id) + " Removed type " + std::to_string(p.second) +
" from task " + std::to_string(p.first.id) + " requirements.");
// EXPLAIN: check if all data requirements of the task are satisfied. If yes start sending
if (needs.at(p.first).empty()) {
log_info(std::to_string(this->id) + " Task " + std::to_string(p.first.id) +
" has met all requirements and is starting execution.");
startSending(p.first);
}
}
}
}
void ProcessingElementVC::log_info(std::string msg){
SC_REPORT_INFO(PE_LOG, msg.c_str());
}
void ProcessingElementVC::log_error(std::string msg){
SC_REPORT_ERROR(PE_LOG, msg.c_str());
}
void ProcessingElementVC::log_fatal(std::string msg){
SC_REPORT_FATAL(PE_LOG, msg.c_str());
}
ProcessingElementVC::~ProcessingElementVC()
{
delete packetPortContainer;
}

View file

@ -1,88 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <algorithm>
#include <queue>
#include <random>
#include "ratatoskrUtils/traffic/Flit.h"
#include "ratatoskrUtils/traffic/TrafficPool.h"
#include "ratatoskrUtils/utils/GlobalResources.h"
#include "ratatoskrUtils/utils/Report.h"
#include "ratatoskrUtils/utils/Structures.h"
#include <ratatoskrUtils/container/PacketContainer.h>
#include <utils/configuration.h>
#include "utils/noc_logger.h"
#ifdef ENABLE_NETRACE
#include <ratatoskrUtils/traffic/netrace/NetracePool.h>
#endif
#include "ProcessingElement.h"
class ProcessingElementVC : public ProcessingElement {
public:
sc_event event;
PacketPortContainer* packetPortContainer;
std::map<dataTypeID_t, std::set<Task>> neededFor;
std::map<std::pair<Task, dataTypeID_t>, int> neededAmount;
std::map<Task, std::set<dataTypeID_t>> needs;
std::map<dataTypeID_t, int> receivedData;
std::map<DataDestination, Task> destToTask;
std::map<Task, std::set<DataDestination>> taskToDest;
std::map<Task, int> taskRepeatLeft;
std::map<Task, int> taskStartTime;
std::map<Task, int> taskTerminationTime;
std::map<DataDestination, int> countLeft;
std::map<DataDestination, int> destWait;
#ifdef ENABLE_NETRACE
std::queue<std::pair<queue_node_t, unsigned long long int>> ntInject;
std::queue<std::pair<queue_node_t, unsigned long long int>> ntWaiting;
#endif
SC_HAS_PROCESS(ProcessingElementVC);
ProcessingElementVC(sc_module_name mn, Node& node, TrafficPool* tp, int node_id);
~ProcessingElementVC();
void initialize() override;
void bind(Connection*, SignalContainer*, SignalContainer*) override;
void execute(Task&) override;
void receive() override;
void thread() override;
void startSending(Task&);
void checkNeed();
//log functions separately for SPACX
void log_info(std::string msg);
void log_error(std::string msg);
void log_fatal(std::string msg);
};

View file

@ -1,90 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "Flit.h"
#include "Packet.h"
#include "TrafficPool.h"
#include "utils/configuration.h"
long long Flit::idcnt = 0;
Flit::Flit(FlitType type, long long seq_nb, Packet* p)
:
type(type),
seq_nb(seq_nb),
packet(p),
id(++idcnt),
dataType(-1),
injectionTime(0),
headFlit(nullptr)
{
this->dbid = rep.registerElement("Flit", this->id);
rep.reportAttribute(dbid, "flit_packet", std::to_string(p->id));
rep.reportAttribute(dbid, "flit_type", std::to_string(type));
rep.reportAttribute(dbid, "flit_seq", std::to_string(seq_nb));
if (type==FlitType::HEAD || type==FlitType::SINGLE)
this->headFlit = this;
else
this->headFlit = p->flits.at(0);
}
Flit::Flit(FlitType type, long long seq_nb, Packet* p, dataTypeID_t dataType, double generationTime)
:
Flit(type, seq_nb, p)
{
this->generationTime = generationTime;
this->dataType = dataType;
}
ostream& operator<<(ostream& os, const Flit& flit)
{
int processingElementsSize = CORE_NO*GlobalResources::getInstance().nodes.size()/2;
os << "[";
switch (flit.type) {
case HEAD:
os << "H";
break;
case BODY:
os << "B";
break;
case TAIL:
os << "T";
break;
case SINGLE:
os << "S";
break;
}
os << "_" << flit.id << ": " << flit.packet->src.id%processingElementsSize << "-->"
<< flit.packet->dst.id%processingElementsSize << "]";
return os;
}
void sc_trace(sc_trace_file*& tf, const Flit& flit, std::string nm)
{
sc_trace(tf, flit.type, nm+".type");
sc_trace(tf, flit.seq_nb, nm+".seq_nb");
sc_trace(tf, flit.id, nm+".id");
}
Flit::~Flit()
{
}

View file

@ -1,62 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#pragma once
#include "systemc.h"
#include <string>
#include "ratatoskrUtils/utils/Report.h"
#include "ratatoskrUtils/utils/Structures.h"
using flitID_t = long long;
class Packet;
enum FlitType {
HEAD = 10, BODY = 11, TAIL = 12, SINGLE = 13,
};
class Flit {
public:
Report& rep = Report::getInstance();
static flitID_t idcnt;
flitID_t id;
flitID_t dbid;
long long seq_nb;
FlitType type;
Packet* packet;
Flit* headFlit;
dataTypeID_t dataType;
double injectionTime;
double generationTime;
Flit(FlitType type, long long seq_nb, Packet* p);
Flit(FlitType type, long long seq_nb, Packet* p, dataTypeID_t dataType, double generationTime);
friend ostream& operator<<(ostream& os, const Flit& flit);
friend void sc_trace(sc_trace_file*& tf, const Flit& flit, std::string nm);
~Flit();
};

View file

@ -1,56 +0,0 @@
/*******************************************************************************
* Copyright (C) 2018 Jan Moritz Joseph
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
#include "Packet.h"
long long Packet::idcnt = 0;
Packet::Packet(Node& src, Node& dst, int size, double generationTime, dataTypeID_t dataType)
:
src(src),
dst(dst),
size(size),
generationTime(generationTime),
dataType(dataType)
{
this->id = idcnt;
++idcnt;
this->pkgclass = -1;
this->numhops = 0;
this->dbid = rep.registerElement("Packet", this->id);
rep.reportAttribute(dbid, "packet_src", std::to_string(src.id));
rep.reportAttribute(dbid, "packet_dst", std::to_string(dst.id));
}
std::ostream& operator<<(std::ostream& os, const Packet& p)
{
os << "ID: " << p.id << ", SRC: " << p.src.id << ", DST: " << p.dst.id << ", Size: " << p.size << ", Generated at: "
<< p.generationTime << std::endl;
return os;
}
Packet::~Packet()
{
for(auto& f:flits){
delete f;
}
flits.clear();
}

Some files were not shown because too many files have changed in this diff Show more