Configuration 2 What system configuration does zsim simulate? Type - - PowerPoint PPT Presentation

configuration
SMART_READER_LITE
LIVE PREVIEW

Configuration 2 What system configuration does zsim simulate? Type - - PowerPoint PPT Presentation

MICRO 2015 Waikiki, Hawaii 5 Dec 2015 ZS IM T UTORIAL Configuration and Stats Configuration 2 What system configuration does zsim simulate? Type and number of cores, caches, how different components are connected to each other.


slide-1
SLIDE 1

MICRO 2015 – Waikiki, Hawaii 5 Dec 2015

Configuration and Stats

ZSIM TUTORIAL

slide-2
SLIDE 2

Configuration

 What system configuration does zsim simulate?  Type and number of cores, caches, how different components are

connected to each other. Beefy Core L1i L1d L2 L3

Wimpy Core

L1i L1d L2 Shared LLC

Beefy Cores Wimpy Cores

2

slide-3
SLIDE 3

Configuration files

Configuration files use XML like syntax, but much simpler 3 Main components

 System - Cores, caches and main memory  Processes - Applications to simulate  Simulation - Miscellaneous simulator knobs

  • Ex. Stats, logging

3

slide-4
SLIDE 4

System Config: Cores

cores = { simpleCore = { cores = 1; type = “Simple”; icache = “l1i”; dcache = “l1d”; }; };

Core L1i L1d

4

slide-5
SLIDE 5

Caches And Memory

caches = { l1i = { size = 32768; }; l1d = { size = 65536; }; l2 = { size = 2097152; children = “l1i | l1d”; # Connect l2 to l1i and lid }; }; mem = { type= “DDR”; };

L1i 32KB L1d 64KB L2 2MB Core DDR Memory

5

slide-6
SLIDE 6

Process Config

process0 = { command = “./helloworld”; env = “PATH=/home/usr/bin/”; startFastForwarded = True; ffiPoints = “10000000 20000000”; };

process1{ …............. }; process2{ …............. };

6

slide-7
SLIDE 7

Simulation Config

sim = { phaseLength = 10000; # Cycles maxTotalInstrs = 10000000000; logToFile = True; }

7

slide-8
SLIDE 8

Core L1i L1d Private L2 LLC Bank

16 Core Tiled Processor

8

slide-9
SLIDE 9

Changes To Single Core Config

 Change no. of instances of core and private caches.  Other parameters remain the same.

simpleCore = { cores = 16; type = “Simple”; icache = “icache”; dcache = “dcache”; } l1i = { caches = 16; size = 32768; } Similarly for l1d and l2

9

slide-10
SLIDE 10

Add Banked L3

l3 = { caches = 1; banks = 16; children = “l2”; size = 8386608; # 8MB total across all banks nuca = { type = “Static”; }; };

networkFile = “net-16-4x4-tiles.txt”

 Network file lists on-chip latency between tiles

tile0 tile7 10 tile0 tile10 13

10

slide-11
SLIDE 11

Debugging

 All configuration variables needed by ZSim have default values.  The values for all variables used by ZSim in a given

simulation(including default values) are dumped to out.cfg

zsim.cfg

  • ut.cfg

ZSim

DEFAULT VALUES

11

slide-12
SLIDE 12

Stats

 Stats organization  Analyzing stats  Adding new stats

12

slide-13
SLIDE 13

Stats organization

 Decouple stats collection and stats output.  Create all stats objects during initialization.  Use different backends to output these stats in desired formats.  Fixed sized stats output

 All the supported stats types are fixed size.  New stats cannot be added after initialization.

13

slide-14
SLIDE 14

Root Cores L1D Cycles Hits Instrs Misses Core1 Core0 L1I

stats.txt stats.h5 stats.abcd

Stats organization

14

slide-15
SLIDE 15

Stats backends

 We support multiple backends that traverse the stats tree and

dump the output.

 ZSim has two kinds of backends.

 Text backend: Prints out a hierarchical listing of all simulator

stats.

 zsim.out

 Hdf5 backend: Dumps stats in hdf5 file format.

 zsim-ev.h5: Eventual stats  zsim.h5: Periodic stats

15

slide-16
SLIDE 16

Stats and Plots

16

slide-17
SLIDE 17

Analyzing Stats

ZSim HDF5 stats Numpy arrays Analysis & Plotting Python h5py library

17

numpy matplotlib.pyplot

slide-18
SLIDE 18

Basic Stats

import h5py import numpy as np f = h5py.File(‘zsim-ev.h5’, ‘r’) dset = f[“stats”][“root”] stats = dset[-1] phases = stats[‘phase’] coreStats = stats[‘core’] totalInstrs = coreStats[‘instrs’] totalCycles = coreStats[‘cycles’] ipc= (1. * totalInstrs)/totalCycles

18

slide-19
SLIDE 19

Periodic Stats

Example 1: l2 hits at the end of 200th stats dump sample = dset[200] L2Hits = sample[‘l2’][‘hGETS’] + sample[‘l2’][‘hGETX’] Example 2: Average IPC between 100th and 200th stats dump instrs = dset[200][‘core’][‘instrs’] - dset[100][‘core’][‘instrs’] cycles = dset[100][‘core’][‘cycles’] - dset[100][‘core’][‘cycles’] ipc = (1. * instrs)/cycles

ZSim dumps stats periodically in zsim.h5.

19

slide-20
SLIDE 20

Adding new stats

AggregateStat* rootStat = new AggregateStat(); rootStat->init(“root”, ”my stats”); ProxyStat* phaseStat = new ProxyStat(); phaseStat->init( "phase", "Phase", &zinfo->numPhases); rootStat->append(phaseStat); std::string statsFile = zinfo->outputDir; statsFile += "/mystats.h5"; stats = new HDF5Backend(gm_strdup(statsFile.c_str()), rootStat, 1<<17, false, false); zinfo->statsBackends->push_back(stats);

Create root

  • f stats tree

Build tree Choose stats file Create backend to dump stats

20

slide-21
SLIDE 21

21

DEMO

slide-22
SLIDE 22

THANK YOU QUESTIONS?

22