Git Product home page Git Product logo

gem5's Introduction

Project Readme

Our project implement an adaptive routing-algorithms on Torus topologies, call Multi-Selectable Shortest Path (MSSP). To avoid deadlock happend, we implement Adaptive Escape Virtual Channel (AEVC) algorithm.

In our codes, we have implemented :

New topologies:
   - 2D-Torus
   - 3D-Torus
New routing-algorithms:
   - Deterministic deadlock free algorithm on Torus (Our algorithm)
   - Deterministic deadlock free algorithm on Torus (Dally's paper)
   - Shortest Path algorithm
   - Random Shortest Path algorithm
   - Multi-Selectable Shortest Path algorithm
New flow-controls:
   - Escape Virtual Channel
   - Adaptive Escape Virtual Channel 

Here, we provide the way to run these algorithm in 2D-Torus.

In another branch, you can run:

# MeshXY
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Mesh_XY --mesh-rows=8 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}

# Deterministic deadlock free algorithm on Torus (Our algorithm)
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --torus-cols=8 --mesh-rows=8 --routing-algorithm=4 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}

# Shortest Path (SP) algorithm
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --torus-cols=8 --mesh-rows=8 --routing-algorithm=6 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}

# Random Shortest Path algorithm
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --torus-cols=8 --mesh-rows=8 --routing-algorithm=8 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}

# Multi-Selectable Shortest Path (MSSP) algorithm
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --torus-cols=8 --mesh-rows=8 --routing-algorithm=6 --espace-algorithm=2 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}

In main branch, you can run:

# Deterministic deadlock free algorithm on Torus (Dally's paper)
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --mesh-rows=8 --routing-algorithm=6 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={} --espace-algorithm=4

# MSSP with one espace VC
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --mesh-rows=8 --routing-algorithm=6 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={} --espace-algorithm=3

# MSSP with Adaptive Escape Virtual Channel (AEVC) algorithm
./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --mesh-rows=8 --routing-algorithm=6 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={} --espace-algorithm=3 --aevc

For data prepare

Experiment 2

Here we prepare the code for getting latency-injectionrate data in uniform_random synthetic for Deterministic deadlock free algorithm on Torus (Our algorithm). You should run this code in another branch.

By changing the instruction in the code, we can get other data.

import os
import numpy as np
import matplotlib.pyplot as plt

synthetic = "uniform_random"
begin = 0.1
end = 0.4

inj_rate_list = np.linspace(begin, end, 60)

cut = True
cut_threshold = 50

os.system("echo > latency_{}.txt".format(synthetic))
for inj_rate in inj_rate_list:
    os.system(
        "echo inject rate: {} >> latency_{}.txt".format(inj_rate, synthetic)
    )
    os.system(
        "./build/NULL/gem5.opt configs/example/garnet_synth_traffic.py --network=garnet --vcs-per-vnet=4 --num-cpus=64 --num-dirs=64 --topology=Torus2D --torus-cols=8 --mesh-rows=8 --routing-algorithm=4 --inj-vnet=0 --synthetic={} --sim-cycles=20000 --injectionrate={}".format(
            synthetic, inj_rate
        )
    )
    os.system(
        "grep 'average_packet_latency' m5out/stats.txt | sed 's/system.ruby.network.average_packet_latency\s*/average_packet_latency = /' >> latency_{}.txt".format(
            synthetic
        )
    )

injection_rate_list = []
torus_latency_1 = []

test_txt = open("latency_{}.txt".format(synthetic), "r")
lines = test_txt.readlines()
test_txt.close()

for line in lines:
    if "inject rate" in line:
        injection_rate_list.append(float(line.split()[2]))
    elif "average_packet_latency" in line:
        if cut and float(line.split()[2]) > cut_threshold:
            torus_latency_1.append(cut_threshold)
        else:
            torus_latency_1.append(float(line.split()[2]))

plt.figure()
plt.title("Average Packet Latency vs. Injection Rate")
plt.plot(
    injection_rate_list,
    torus_latency_1,
    label="Deadlock-Free",
    color="blue",
    linestyle="--",
)
plt.xlabel("Injection Rate")
plt.ylabel("Average Packet Latency")
Experiment 4

Here we prepare the way to get latency-injectionrate data for MSSP with AEVC algorithm in 2D-Trous topology. In main branch, run

python ./configs/example/plot_analyze.py

You can get the latency data in network_stats.txt.

By changing the cmd in plot_analyze.py, you can get the latency data for other algorithm and other synthetic.

Gem5 Readme

This is the gem5 simulator.

The main website can be found at http://www.gem5.org

A good starting point is http://www.gem5.org/about, and for more information about building the simulator and getting started please see http://www.gem5.org/documentation and http://www.gem5.org/documentation/learning_gem5/introduction.

To build gem5, you will need the following software: g++ or clang, Python (gem5 links in the Python interpreter), SCons, zlib, m4, and lastly protobuf if you want trace capture and playback support. Please see http://www.gem5.org/documentation/general_docs/building for more details concerning the minimum versions of these tools.

Once you have all dependencies resolved, type 'scons build//gem5.opt' where CONFIG is one of the options in build_opts like ARM, NULL, MIPS, POWER, SPARC, X86, Garnet_standalone, etc. This will build an optimized version of the gem5 binary (gem5.opt) with the the specified configuration. See http://www.gem5.org/documentation/general_docs/building for more details and options.

The main source tree includes these subdirectories:

  • build_opts: pre-made default configurations for gem5
  • build_tools: tools used internally by gem5's build process.
  • configs: example simulation configuration scripts
  • ext: less-common external packages needed to build gem5
  • include: include files for use in other programs
  • site_scons: modular components of the build system
  • src: source code of the gem5 simulator
  • system: source for some optional system software for simulated systems
  • tests: regression tests
  • util: useful utility programs and files

To run full-system simulations, you may need compiled system firmware, kernel binaries and one or more disk images, depending on gem5's configuration and what type of workload you're trying to run. Many of those resources can be downloaded from http://resources.gem5.org, and/or from the git repository here: https://gem5.googlesource.com/public/gem5-resources/

If you have questions, please send mail to [email protected]

Enjoy using gem5 and please share your modifications and extensions.

gem5's People

Contributors

binkert avatar steve-reinhardt avatar giactra avatar bobbyrbruce avatar andysan avatar nilayvaish avatar odanrc avatar rdreslin avatar beckmabd avatar abmerop avatar relokin avatar powerjg avatar hnpl avatar tiagormk avatar atgutier avatar bkp avatar cdunham avatar kyleroarty avatar ************2 avatar wmin0 avatar sandip4n avatar ramymdsc avatar mkjost0 avatar jthestness avatar aroelke avatar rjc-arch avatar alexdutu avatar sticklyman1936 avatar earlou avatar rogerchang23424 avatar

Watchers

Liangzhi Shi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.