feat: assing new config, refactoring

This commit is contained in:
juanmanuel 2024-11-03 14:49:30 -05:00
parent 4517995d04
commit 9e9949faa5
27 changed files with 3995 additions and 21 deletions

21
LICENSE.md Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Juan Neyra
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.

View file

@ -1,9 +1,50 @@
# Defines # TLM NOC Simulator
`cmake -DDEFINE_ENABLE_NETRACE=ON` ## Description
enables netrace mode TLM NOC Simulator
`cmake -DDEFINE_ENABLE_GUI=ON` ## Getting Started
enables GUI mode ### Dependencies
* System C
* TLM
### Installing
* Run build.sh script
```
./build.sh
```
### Executing program
* A configuration is needed to execute the program. The configurations are located inside folder config
* Each configuration must have these four files: config.xml, data.xml, map.xml and net.xml
* config.xml describes the simulation time, the path for data, map and net xml files and other specifications
* data.xml describes all the tasks to execute
* map.xml maps a task to a node in the net
* net.xml describes the organization of the Processing Elements and Routers
* The name of the configuration folder is passed to the program as
```
./sim --configFolder <config_name>
```
* For example, to run configuration "simple_test"
```
./sim --configFolder simple_test
```
## Version History
* 0.1
* Initial Release
## License
This project is licensed under the MIT License - see the LICENSE.md file for details
## Acknowledgments
* [Ratatoskr NoC simulator](https://github.com/jmjos/ratatoskr)

55
config/ai_test/config.xml Executable file
View file

@ -0,0 +1,55 @@
<?xml version="1.0" ?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<general>
<simulationTime value="100000"/>
<outputToFile value="true">report</outputToFile>
</general>
<noc>
<nocFile>config/ai_test/net.xml</nocFile>
<flitsPerPacket value="1"/>
<bitWidth value="32"/>
<Vdd value="5"/>
</noc>
<application>
<benchmark>task</benchmark>
<dataFile>config/ai_test/data.xml</dataFile>
<mapFile>config/ai_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>

2597
config/ai_test/data.xml Executable file

File diff suppressed because it is too large Load diff

339
config/ai_test/map.xml Normal file
View file

@ -0,0 +1,339 @@
<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<bind>
<task value="0"/>
<node value="7"/>
</bind>
<bind>
<task value="1"/>
<node value="14"/>
</bind>
<bind>
<task value="2"/>
<node value="8"/>
</bind>
<bind>
<task value="3"/>
<node value="14"/>
</bind>
<bind>
<task value="4"/>
<node value="8"/>
</bind>
<bind>
<task value="5"/>
<node value="10"/>
</bind>
<bind>
<task value="6"/>
<node value="11"/>
</bind>
<bind>
<task value="7"/>
<node value="5"/>
</bind>
<bind>
<task value="8"/>
<node value="7"/>
</bind>
<bind>
<task value="9"/>
<node value="5"/>
</bind>
<bind>
<task value="10"/>
<node value="15"/>
</bind>
<bind>
<task value="11"/>
<node value="0"/>
</bind>
<bind>
<task value="12"/>
<node value="12"/>
</bind>
<bind>
<task value="13"/>
<node value="13"/>
</bind>
<bind>
<task value="14"/>
<node value="12"/>
</bind>
<bind>
<task value="15"/>
<node value="8"/>
</bind>
<bind>
<task value="16"/>
<node value="8"/>
</bind>
<bind>
<task value="17"/>
<node value="6"/>
</bind>
<bind>
<task value="18"/>
<node value="10"/>
</bind>
<bind>
<task value="19"/>
<node value="1"/>
</bind>
<bind>
<task value="20"/>
<node value="2"/>
</bind>
<bind>
<task value="21"/>
<node value="5"/>
</bind>
<bind>
<task value="22"/>
<node value="11"/>
</bind>
<bind>
<task value="23"/>
<node value="5"/>
</bind>
<bind>
<task value="24"/>
<node value="7"/>
</bind>
<bind>
<task value="25"/>
<node value="12"/>
</bind>
<bind>
<task value="26"/>
<node value="1"/>
</bind>
<bind>
<task value="27"/>
<node value="4"/>
</bind>
<bind>
<task value="28"/>
<node value="14"/>
</bind>
<bind>
<task value="29"/>
<node value="6"/>
</bind>
<bind>
<task value="30"/>
<node value="10"/>
</bind>
<bind>
<task value="31"/>
<node value="14"/>
</bind>
<bind>
<task value="32"/>
<node value="6"/>
</bind>
<bind>
<task value="33"/>
<node value="12"/>
</bind>
<bind>
<task value="34"/>
<node value="13"/>
</bind>
<bind>
<task value="35"/>
<node value="0"/>
</bind>
<bind>
<task value="36"/>
<node value="2"/>
</bind>
<bind>
<task value="37"/>
<node value="0"/>
</bind>
<bind>
<task value="38"/>
<node value="7"/>
</bind>
<bind>
<task value="39"/>
<node value="15"/>
</bind>
<bind>
<task value="40"/>
<node value="0"/>
</bind>
<bind>
<task value="41"/>
<node value="2"/>
</bind>
<bind>
<task value="42"/>
<node value="13"/>
</bind>
<bind>
<task value="43"/>
<node value="7"/>
</bind>
<bind>
<task value="44"/>
<node value="13"/>
</bind>
<bind>
<task value="45"/>
<node value="3"/>
</bind>
<bind>
<task value="46"/>
<node value="7"/>
</bind>
<bind>
<task value="47"/>
<node value="1"/>
</bind>
<bind>
<task value="48"/>
<node value="10"/>
</bind>
<bind>
<task value="49"/>
<node value="10"/>
</bind>
<bind>
<task value="50"/>
<node value="12"/>
</bind>
<bind>
<task value="51"/>
<node value="1"/>
</bind>
<bind>
<task value="52"/>
<node value="3"/>
</bind>
<bind>
<task value="53"/>
<node value="0"/>
</bind>
<bind>
<task value="54"/>
<node value="4"/>
</bind>
<bind>
<task value="55"/>
<node value="3"/>
</bind>
<bind>
<task value="56"/>
<node value="2"/>
</bind>
<bind>
<task value="57"/>
<node value="8"/>
</bind>
<bind>
<task value="58"/>
<node value="12"/>
</bind>
<bind>
<task value="59"/>
<node value="9"/>
</bind>
<bind>
<task value="60"/>
<node value="0"/>
</bind>
<bind>
<task value="61"/>
<node value="4"/>
</bind>
<bind>
<task value="62"/>
<node value="15"/>
</bind>
<bind>
<task value="63"/>
<node value="11"/>
</bind>
<bind>
<task value="64"/>
<node value="4"/>
</bind>
<bind>
<task value="65"/>
<node value="6"/>
</bind>
<bind>
<task value="66"/>
<node value="11"/>
</bind>
<bind>
<task value="67"/>
<node value="9"/>
</bind>
<bind>
<task value="68"/>
<node value="1"/>
</bind>
<bind>
<task value="69"/>
<node value="7"/>
</bind>
<bind>
<task value="70"/>
<node value="12"/>
</bind>
<bind>
<task value="71"/>
<node value="14"/>
</bind>
<bind>
<task value="72"/>
<node value="10"/>
</bind>
<bind>
<task value="73"/>
<node value="2"/>
</bind>
<bind>
<task value="74"/>
<node value="4"/>
</bind>
<bind>
<task value="75"/>
<node value="11"/>
</bind>
<bind>
<task value="76"/>
<node value="4"/>
</bind>
<bind>
<task value="77"/>
<node value="0"/>
</bind>
<bind>
<task value="78"/>
<node value="13"/>
</bind>
<bind>
<task value="79"/>
<node value="15"/>
</bind>
<bind>
<task value="80"/>
<node value="7"/>
</bind>
<bind>
<task value="81"/>
<node value="13"/>
</bind>
<bind>
<task value="82"/>
<node value="5"/>
</bind>
<bind>
<task value="83"/>
<node value="6"/>
</bind>
</map>

879
config/ai_test/net.xml Executable file
View file

@ -0,0 +1,879 @@
<?xml version="1.0" encoding="UTF-8"?>
<network-on-chip xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="layer.xsd">
<bufferDepthType value="single" /> <!-- single, perVC-->
<nodeTypes>
<nodeType id="0">
<model value="Router"/>
<routing value="XYZ"/>
<clockDelay value="1"/>
</nodeType>
<nodeType id="1">
<model value="ProcessingElement"/>
<clockDelay value="1"/>
</nodeType>
</nodeTypes>
<nodes>
<node id="0">
<xPos value="0.000"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="0"/>
<layerType value="0"/>
</node>
<node id="1">
<xPos value="0.000"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="1"/>
<layerType value="0"/>
</node>
<node id="2">
<xPos value="0.000"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="2"/>
<layerType value="0"/>
</node>
<node id="3">
<xPos value="0.000"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="3"/>
<layerType value="0"/>
</node>
<node id="4">
<xPos value="0.333"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="4"/>
<layerType value="0"/>
</node>
<node id="5">
<xPos value="0.333"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="5"/>
<layerType value="0"/>
</node>
<node id="6">
<xPos value="0.333"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="6"/>
<layerType value="0"/>
</node>
<node id="7">
<xPos value="0.333"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="7"/>
<layerType value="0"/>
</node>
<node id="8">
<xPos value="0.667"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="8"/>
<layerType value="0"/>
</node>
<node id="9">
<xPos value="0.667"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="9"/>
<layerType value="0"/>
</node>
<node id="10">
<xPos value="0.667"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="10"/>
<layerType value="0"/>
</node>
<node id="11">
<xPos value="0.667"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="11"/>
<layerType value="0"/>
</node>
<node id="12">
<xPos value="1.000"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="12"/>
<layerType value="0"/>
</node>
<node id="13">
<xPos value="1.000"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="13"/>
<layerType value="0"/>
</node>
<node id="14">
<xPos value="1.000"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="14"/>
<layerType value="0"/>
</node>
<node id="15">
<xPos value="1.000"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="0"/>
<idType value="15"/>
<layerType value="0"/>
</node>
<node id="16">
<xPos value="0.000"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="0"/>
<layerType value="0"/>
</node>
<node id="17">
<xPos value="0.000"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="1"/>
<layerType value="0"/>
</node>
<node id="18">
<xPos value="0.000"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="2"/>
<layerType value="0"/>
</node>
<node id="19">
<xPos value="0.000"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="3"/>
<layerType value="0"/>
</node>
<node id="20">
<xPos value="0.333"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="4"/>
<layerType value="0"/>
</node>
<node id="21">
<xPos value="0.333"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="5"/>
<layerType value="0"/>
</node>
<node id="22">
<xPos value="0.333"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="6"/>
<layerType value="0"/>
</node>
<node id="23">
<xPos value="0.333"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="7"/>
<layerType value="0"/>
</node>
<node id="24">
<xPos value="0.667"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="8"/>
<layerType value="0"/>
</node>
<node id="25">
<xPos value="0.667"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="9"/>
<layerType value="0"/>
</node>
<node id="26">
<xPos value="0.667"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="10"/>
<layerType value="0"/>
</node>
<node id="27">
<xPos value="0.667"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="11"/>
<layerType value="0"/>
</node>
<node id="28">
<xPos value="1.000"/>
<yPos value="0.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="12"/>
<layerType value="0"/>
</node>
<node id="29">
<xPos value="1.000"/>
<yPos value="0.333"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="13"/>
<layerType value="0"/>
</node>
<node id="30">
<xPos value="1.000"/>
<yPos value="0.667"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="14"/>
<layerType value="0"/>
</node>
<node id="31">
<xPos value="1.000"/>
<yPos value="1.000"/>
<zPos value="0.000"/>
<nodeType value="1"/>
<idType value="15"/>
<layerType value="0"/>
</node>
</nodes>
<connections>
<con id="0">
<interface value="0"/>
<ports>
<port id ="0">
<node value="0"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="16"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="1">
<interface value="0"/>
<ports>
<port id ="0">
<node value="0"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="1"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="2">
<interface value="0"/>
<ports>
<port id ="0">
<node value="0"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="4"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="3">
<interface value="0"/>
<ports>
<port id ="0">
<node value="1"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="17"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="4">
<interface value="0"/>
<ports>
<port id ="0">
<node value="1"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="2"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="5">
<interface value="0"/>
<ports>
<port id ="0">
<node value="1"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="5"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="6">
<interface value="0"/>
<ports>
<port id ="0">
<node value="2"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="18"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="7">
<interface value="0"/>
<ports>
<port id ="0">
<node value="2"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="3"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="8">
<interface value="0"/>
<ports>
<port id ="0">
<node value="2"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="6"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="9">
<interface value="0"/>
<ports>
<port id ="0">
<node value="3"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="19"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="10">
<interface value="0"/>
<ports>
<port id ="0">
<node value="3"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="7"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="11">
<interface value="0"/>
<ports>
<port id ="0">
<node value="4"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="20"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="12">
<interface value="0"/>
<ports>
<port id ="0">
<node value="4"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="5"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="13">
<interface value="0"/>
<ports>
<port id ="0">
<node value="4"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="8"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="14">
<interface value="0"/>
<ports>
<port id ="0">
<node value="5"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="21"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="15">
<interface value="0"/>
<ports>
<port id ="0">
<node value="5"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="6"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="16">
<interface value="0"/>
<ports>
<port id ="0">
<node value="5"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="9"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="17">
<interface value="0"/>
<ports>
<port id ="0">
<node value="6"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="22"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="18">
<interface value="0"/>
<ports>
<port id ="0">
<node value="6"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="7"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="19">
<interface value="0"/>
<ports>
<port id ="0">
<node value="6"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="10"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="20">
<interface value="0"/>
<ports>
<port id ="0">
<node value="7"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="23"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="21">
<interface value="0"/>
<ports>
<port id ="0">
<node value="7"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="11"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="22">
<interface value="0"/>
<ports>
<port id ="0">
<node value="8"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="24"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="23">
<interface value="0"/>
<ports>
<port id ="0">
<node value="8"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="9"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="24">
<interface value="0"/>
<ports>
<port id ="0">
<node value="8"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="12"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="25">
<interface value="0"/>
<ports>
<port id ="0">
<node value="9"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="25"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="26">
<interface value="0"/>
<ports>
<port id ="0">
<node value="9"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="10"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="27">
<interface value="0"/>
<ports>
<port id ="0">
<node value="9"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="13"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="28">
<interface value="0"/>
<ports>
<port id ="0">
<node value="10"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="26"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="29">
<interface value="0"/>
<ports>
<port id ="0">
<node value="10"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="11"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="30">
<interface value="0"/>
<ports>
<port id ="0">
<node value="10"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="14"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="31">
<interface value="0"/>
<ports>
<port id ="0">
<node value="11"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="27"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="32">
<interface value="0"/>
<ports>
<port id ="0">
<node value="11"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="15"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="33">
<interface value="0"/>
<ports>
<port id ="0">
<node value="12"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="28"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="34">
<interface value="0"/>
<ports>
<port id ="0">
<node value="12"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="13"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="35">
<interface value="0"/>
<ports>
<port id ="0">
<node value="13"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="29"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="36">
<interface value="0"/>
<ports>
<port id ="0">
<node value="13"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="14"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="37">
<interface value="0"/>
<ports>
<port id ="0">
<node value="14"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="30"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="38">
<interface value="0"/>
<ports>
<port id ="0">
<node value="14"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="15"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
<con id="39">
<interface value="0"/>
<ports>
<port id ="0">
<node value="15"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
<port id ="1">
<node value="31"/>
<bufferDepth value="8"/>
<vcCount value="8"/>
</port>
</ports>
</con>
</connections>
</network-on-chip>

0
config/conc_stream_pack_test/data.xml Normal file → Executable file
View file

0
config/conc_stream_pack_test/map.xml Normal file → Executable file
View file

0
config/conc_stream_pack_test/net.xml Normal file → Executable file
View file

0
config/only_config_msg_test/data.xml Normal file → Executable file
View file

0
config/only_config_msg_test/map.xml Normal file → Executable file
View file

0
config/only_config_msg_test/net.xml Normal file → Executable file
View file

0
config/simple_2_layer_test/data.xml Normal file → Executable file
View file

0
config/simple_2_layer_test/map.xml Normal file → Executable file
View file

0
config/simple_2_layer_test/net.xml Normal file → Executable file
View file

0
config/simple_2_point_test/2pt_data.xml Normal file → Executable file
View file

0
config/simple_2_point_test/2pt_map.xml Normal file → Executable file
View file

0
config/simple_2_point_test/net.xml Normal file → Executable file
View file

0
config/simple_test/net.xml Normal file → Executable file
View file

0
config/simple_test/simple_data.xml Normal file → Executable file
View file

0
config/simple_test/simple_map.xml Normal file → Executable file
View file

26
scripts/gen_map_random.py Normal file
View file

@ -0,0 +1,26 @@
import random
NET_SIZE_X = 4
NET_SIZE_Y = 4
NET_SIZE_Z = 1
NUM_TASKS = 84
MAP_START = """<?xml version="1.0" ?>
<map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">"""
BIND = """ <bind>
<task value="{}"/>
<node value="{}"/>
</bind>"""
MAP_END = "</map>"
NUM_NODES = NET_SIZE_X*NET_SIZE_Y*NET_SIZE_Z
print(MAP_START)
for i in range(NUM_TASKS):
node_id = random.randint(0, NUM_NODES-1)
print(BIND.format(i, node_id))
print(MAP_END)

View file

@ -168,9 +168,9 @@ void NetworkInterfaceTlm::send_flit(PacketCS* p, Flit* f){
sc_time delay = sc_time(REQ_INIT_DELAY, UNITS_DELAY); sc_time delay = sc_time(REQ_INIT_DELAY, UNITS_DELAY);
tlm::tlm_phase send_phase = tlm::BEGIN_REQ; tlm::tlm_phase send_phase = tlm::BEGIN_REQ;
int lay = p->dataType == TYPE_STREAM ? 1:0; string type_name = get_type_name(p->dataType);
log_info("Sending flit of type "+STR_TYPES[p->dataType]+ int lay = type_name == TYPE_STREAM ? 1:0;
" to layer "+to_string(lay)); log_info("Sending flit of type "+ type_name + " to layer "+to_string(lay));
(*initiator[lay])->nb_transport_fw(*trans, send_phase, delay); (*initiator[lay])->nb_transport_fw(*trans, send_phase, delay);
update_credits(*trans, -1); update_credits(*trans, -1);
} }
@ -191,7 +191,7 @@ int NetworkInterfaceTlm::get_packet_id_from_extension(tlm_gp& trans){
bool NetworkInterfaceTlm::check_cs_needed(tlm_gp& trans){ bool NetworkInterfaceTlm::check_cs_needed(tlm_gp& trans){
int type = get_type_from_extension(trans); int type = get_type_from_extension(trans);
return type == TYPE_ROUT_CONFIG; return get_type_name(type) == TYPE_ROUT_CONFIG;
} }
void NetworkInterfaceTlm::send_cs_rout_conf_msg(tlm_gp& trans){ void NetworkInterfaceTlm::send_cs_rout_conf_msg(tlm_gp& trans){
@ -421,7 +421,7 @@ void NetworkInterfaceTlm::receive_and_process_flit(tlm_gp& trans){
//log_info("Credit counter updated: "+to_string(credit_counter)); //log_info("Credit counter updated: "+to_string(credit_counter));
// send response if not type stream // send response if not type stream
if(p->dataType != TYPE_STREAM){ if(get_type_name(p->dataType) != TYPE_STREAM){
if(resp_in_progress) { if(resp_in_progress) {
if(nxt_resp_pend){ if(nxt_resp_pend){
log_fatal("Attempt to have two pending responses in target"); log_fatal("Attempt to have two pending responses in target");
@ -487,7 +487,7 @@ tlm::tlm_sync_enum NetworkInterfaceTlm::send_end_req(tlm_gp& trans){
// Queue internal event to mark beginning of response // Queue internal event to mark beginning of response
int type = get_type_from_extension(trans); int type = get_type_from_extension(trans);
delay = type != TYPE_STREAM ? delay = get_type_name(type) != TYPE_STREAM ?
delay + sc_time(INTERN_PROC_DELAY, UNITS_DELAY) : delay + sc_time(INTERN_PROC_DELAY, UNITS_DELAY) :
SC_ZERO_TIME; // no processing on stream SC_ZERO_TIME; // no processing on stream
target_peq.notify(trans, INTERNAL_PROC_PHASE, delay); target_peq.notify(trans, INTERNAL_PROC_PHASE, delay);
@ -520,10 +520,10 @@ void NetworkInterfaceTlm::send_response(tlm_gp& trans){
} }
void NetworkInterfaceTlm::update_credits(tlm_gp&trans, int added_creds){ void NetworkInterfaceTlm::update_credits(tlm_gp&trans, int added_creds){
int type = get_type_from_extension(trans); string type_name = get_type_name(get_type_from_extension(trans));
int p_id = get_packet_id_from_extension(trans); int p_id = get_packet_id_from_extension(trans);
if(type == TYPE_PACKET || (type==TYPE_ROUT_CONFIG && p_id != -1)){ if(type_name == TYPE_PACKET || (type_name == TYPE_ROUT_CONFIG && p_id != -1)){
credit_counter += added_creds; credit_counter += added_creds;
log_info("Credit counter updated: "+to_string(credit_counter)); log_info("Credit counter updated: "+to_string(credit_counter));
} }

View file

@ -139,10 +139,10 @@ tlm_sync_enum TlmRouterCS::send_end_req(int link, tlm_gp& trans){
} }
delay = SC_ZERO_TIME; // no processing in circuit switching routers delay = SC_ZERO_TIME; // no processing in circuit switching routers
// Queue internal event to mark beginning of response // Queue internal event to mark beginning of response
int type = get_type_from_extension(trans); string type_name = get_type_name(get_type_from_extension(trans));
phase = (type == TYPE_STREAM) ? INTERNAL_PROC_PHASE : phase = (type_name == TYPE_STREAM) ? INTERNAL_PROC_PHASE :
CONF_ROUT_PHASE; CONF_ROUT_PHASE;
log_info(link, trans, "Type of processed message: "+STR_TYPES[type]); log_info(link, trans, "Type of processed message: " + type_name);
target_peq.notify(trans, phase, delay); target_peq.notify(trans, phase, delay);
return status; return status;

View file

@ -46,11 +46,9 @@ typedef tlm::tlm_generic_payload tlm_gp;
// for circuit switching noc // for circuit switching noc
#define NUM_ACC_LAYERS 2 #define NUM_ACC_LAYERS 2
#define NUM_CREDITS_CS 1 #define NUM_CREDITS_CS 1
#define TYPE_PACKET 0 #define TYPE_PACKET "Packet"
#define TYPE_STREAM 1 #define TYPE_STREAM "Stream"
#define TYPE_ROUT_CONFIG 2 #define TYPE_ROUT_CONFIG "ConfigRouter"
const std::string STR_TYPES[3] = {"packet", "stream", "configRouter"};
/********************** EXTENSIONS ****************************/ /********************** EXTENSIONS ****************************/

View file

@ -57,4 +57,14 @@ void get_max_pos(uint8_t max_pos[3]){
gr_pos[1].end())[0]/dists[1]); gr_pos[1].end())[0]/dists[1]);
max_pos[2] = 1+round(max_element(gr_pos[2].begin(), max_pos[2] = 1+round(max_element(gr_pos[2].begin(),
gr_pos[2].end())[0]/dists[2]); gr_pos[2].end())[0]/dists[2]);
}
string get_type_name(dataTypeID_t id){
GlobalResourcesCS& globalResources = GlobalResourcesCS::getInstance();
for(int i=0; i < globalResources.dataTypes.size(); i++){
if(globalResources.dataTypes[i].id == id){
return globalResources.dataTypes[i].name;
}
}
return "";
} }

View file

@ -23,6 +23,7 @@
#include <systemc> #include <systemc>
#include "configuration.h" #include "configuration.h"
#include "ratatoskrUtils/utils/Structures.h"
using namespace sc_core; using namespace sc_core;
@ -62,3 +63,10 @@ void convert_pos_to_int(float pos_float[3], uint8_t pos_int[3]);
* @param max_pos array to store the value of max positions * @param max_pos array to store the value of max positions
*/ */
void get_max_pos(uint8_t max_pos[3]); void get_max_pos(uint8_t max_pos[3]);
/**
* Gets the name of type given the id
*
* @param id id type whose name needs to be returned
*/
std::string get_type_name(dataTypeID_t id);