Download presentation
Presentation is loading. Please wait.
Published byRalph Golden Modified over 9 years ago
1
Asim/AWB Training Mohit Gambhir Intel Massachusetts Content: Joel Emer, Michael Pellauer, Chris Weaver
2
Agenda AWB Overview Modular Software Design AWB Abstractions & Terminology AWB Tools Configuration File Formats Asimcore (libasim) Overview
3
AWB Architects Workbench Originally written to create software performance models Core Principle: Modularity AWB facilitates the modular plug-n-play style construction of software and hybrid software/hardware projects
4
AWB (contd.) A suite of tools to support rapid modular construction and analysis of performance model GUI and command-line based Publically released under the GPL (models are not) Across Multiple: Code bases: Different repositories, or even types of repositories Model configurations: Alternative modules, knobs, levels of accuracy ISA variations Benchmark suites Results from different runs, etc.
5
Why Modularity Speed of model development Shared components between products Reuse across generations Encourages isomorphism to design Improved fidelity Facilitates speed/fidelity trade-offs Architectural experimentation Factorial development and evaluations Sharing
6
AWB Abstractions & Terminology Packages (codebases) are stored in repositories Packages can be grouped into related bundles Users check out bundles into local workspaces The set of packages in a workspace is viewed a Union Dir Bundle packages contain modules (modular source code) Modules are arranged into models (configurations) Each workspace can contain multiple model build directories Each build directory can contain multiple benchmark runs
7
AWB Abstractions and Terminology Workspace Configure (a model) Repository Bundle Package Model Module Uniondir Search Path
8
Workspace Directory where one works on the AWB based project awb commands that need a workspace context in which to operate search up the directory tree until they find the root of a workspace. contain a stylized directory structure
9
Workspace
10
Configure Collect a set of source files together that can be built into a specific design or model The specific set of modules (and hence source code) that comprise a specific model are specified in an.apm file. Since a model is created from a pool of modules, the build paradigm adds a new step to “configure” a model source tree from a pool of modules. Thus given an.apm file, the configure process involves placing copies of the designated source files (via symbolic links) and some automatically created glue files into a model-specific subtree in the build area of the workspace.
11
Repository A repository is a source code repository using one of the supported source code management systems. Supported versioning systems - CVS, SVN, Bitkeeper and git Repository specification [/ ] The set of available repository names are specified in a.pack file. /etc/respositories/.pack ~/.asim/respositories/.pack
12
Bundle Collection of repositories (with optional versions) – used to checkout a group of packages together. Bundle specification [/ ] Bundles are specified in bundlefiles /etc/asim/bundles.d/ ~/.asim/bundles.d/ http://asim.csail.mit.edu/redmine/projects/awb/wiki/Bundle files http://asim.csail.mit.edu/redmine/projects/awb/wiki/Bundle files
13
Package
14
Portion of repository that is checked out in the workspace the configure/Makefile.in/Makefile files are optional and do not build a user's model, but simply the tools that might exist in the package Globally installed packages that can be shared by all users /share/asim/ / Private packages: /src/
15
Model An AWB model is a hierarchical representation of a design, where each node of the hierarchy is a module Each workspace may have multiple models configured/built each constructed plug-n-play style out of the pool of modules available in all packages in a workspace Represented in.apm file Typically found in config/pm directory inside a package Can be edited by apm-edit In the AWB editor GUI, models are marked with an icon which looks like a double cog
16
Module Modules represent the unit of “swapability” in source code If two modules provide the same awb type then this is an assertion that they can be swapped for one another and that the result will be a coherent model that will successfully build Each module is specified in an.awb file which specifies ‘awb-type’of the module, Awb-types of the children modules that it 'requires' Source files that implement the module.
17
Uniondir Search Path awb supports a union mount-like directory structure that overlays the files from a set of packages. This set of packages is specified as a uniondir search path File references resolved through search of all package directories in the search path Packages added to search path at checkout awb-resolver config/pm/simcore/model.apm /home/mgambhir/asim/src/asim- simcore/config/pm/simcore/model.pm
18
AWB Operation Example Repositories Workspace
19
AWB Tools awb-shell awb apm-edit
20
Awb-shell This is a program that provides a command line interface to manipulate various ASIM objects. Has default values for these Asim objects Can set reset default values through set command help command displays all possible commands http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awb-shell http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awb-shell awb-shell help quickstart
21
Awb-shell % awb-shell awb> set model pm/Arana/arana_aint_dev.apm awb> clean model awb> configure model awb> build model awb> run model bm/Micro/maxipc.cfg awb> quit % awb-shell awb> set model pm/Arana/arana_aint_dev.apm awb> clean model awb> configure model awb> build model awb> run model bm/Micro/maxipc.cfg awb> quit % awb-shell --package=arana commit package % awb-shell help % awb-shell help code
22
Awb-shell Primer for most commonly used awb-shell wrapped svn commands awb-shell checkout package awb-shell update package awb-shell commit package Make sure that environment variable EDITOR is set to your favorite EDITOR setenv EDITOR vi awb-shell checkout package / To checkout a package branch awb-shell checkout package / To checkout a particular revision of a package
23
Awb-shell Bundle commands awb-shell new bundle [/ ] By default takes a snapshot of packages in the current workspace By default adds the file into ~/.asim/bundles/release Use --head to specify the head version Use --install to publicly install in /p/asim Requires asimadm permissions awb-shell checkout bundle [/ ] awb-shell update bundle [/ ] awb-shell show bundle [/ ]
24
Awb cd into your workspace Type: “awb”
25
Awb
26
Lets Select an ape softsdv model
27
Awb Nuke
28
Awb Configure
29
Awb Build
30
Apm-edit
32
Configuration File formats Workspace configuration: awb.config http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awbconfig http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awbconfig Model description:.apm file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Apm_file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Apm_file Module description:.awb file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awb_file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Awb_file Benchmark description:.cfg file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Cfg_file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Cfg_file Multiple benchmark description:.cfx file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Cfx_file http://asim.csail.mit.edu/redmine/projects/awb/wiki/Cfx_file
33
Asimcore (libasim) overview Clocking Ports Stats
34
Clocking Cycle accurate models: Hierarchical and explicit time control void ASIM_CPU_CLASS::Clock (UINT64 cycle) { efmmbx.Clock(cycle); mbx.Clock(cycle); qbx.Clock(cycle); ibx.Clock(cycle); … } Clock Server bool ASIM_RBOX_CLASS::InitModule () { ostringstream os; os << "SYSINT_CLOCK_DOMAIN_" << myUniqueRboxId; RegisterClock(os.str()); } Clock techniques can be combined
35
Clocking Creating Clock domains void newClockDomain (string name, float freq, INT32 threadId = -1) void newClockDomain (string name, list freqs, INT32 threadId = -1) List of valid frequencies
36
Clocking Set Domain Frequency void setDomainFrequency (string domainName, float freq) Register Clock void RegisterClock (string domainName, UINT32 skew = 0, INT32 threadId = -1, bool referenceDomain = false) void RegisterClock (string domainName, CLOCK_CALLBACK_INTERFACE cb, UINT32 skew = 0, INT32 threadId = -1, bool referenceDomain = false) void RegisterClock (string domainName, CLOCK_CALLBACK_INTERFACE cb, CLK_EDGE ed, UINT32 skew = 0, INT32 threadId = -1, bool referenceDomain = false)
37
Clocking template CLOCK_CALLBACK_INTERFACE newCallback (T *obj, void (T::*meth)(UINT64)) Traditionally all the module work happen in one method: void Clock(UINT64 cycle) Callbacks enable: Having more that one clock method in a module Clocking a module at different frequencies
38
Clocking bool ASIM_CBOX_CLASS::InitModule () { … ostringstream os; os.str(""); os << "RING_CLOCK_DOMAIN_" << myChipNum; RegisterClock(os.str()); os.str(""); os << "CBOX_CLOCK_DOMAIN_" << myChipNum; RegisterClock(os.str(), newCallback(this, &ASIM_CBOX_CLASS::ClockCBOX)); … } void ASIM_CBOX_CLASS::ClockCBOX (const UINT64 cycle) { // Clocked at CBOX frequency …} void ASIM_CBOX_CLASS::Clock (const UINT64 cycle) { // Clocked at Ring frequency …}
39
Ports In an Asim model, time only passes when messages flow through ports Activity within each module is instantaneously fast Each port defines a latency and a bandwidth BW: Number of abstract objects that can enter/exit in a cycle LAT: Number of cycles that objects travel through port Sender defines BW and receiver defines LAT Benefits: LAT and BW are often useful knobs for architectural exploration Separates functionality from timing Encourages reuse Can ease burden of coding “NetworkInUse” 2
40
Ports Connect modules Read port and write port make a connection BW set by writer Latency set be reader What gets passed through ports? Pointers to objects allows for generic interfaces between modules does make it easier to “cheat” by accessing info that shouldn’t be available to certain modules Bools & integers
41
Ports WritePort var1_WPort; var1_WPort.Init("Unique_String"); var1_WPort.SetBandwidth(bandwidth); ReadPort var1_RPort; var1_RPort.Init("Unique_String"); var1_RPort.SetLatency(latency);
42
Ports // Write data into the port in cycle C CPU_INST inst; var1_WPort.Write(inst1, cycle); // Read data in cycle C + latency CPU_INST inst2; var2_RPort.Read(inst2, cycle);
43
Ports WritePort var1_WPort; var1_WPort.Init("Unique_String"); var1_WPort.Config(bandwidth); ReadPort var2_RPort var2_RPort.Init("Unique_String"); var2_RPort.Config(latency); ReadPort var3_RPort var3_RPort.Init("Unique_String"); var3_RPort.Config(latency + 1); ReadPort var4_RPort var4_RPort.Init("Unique_String"); var4_RPort.Config(latency +2);
44
Ports Other Kinds of Ports Stall Ports Enable reader to stall the port to disable write from writing Rate Matcher Ports To connect modules in different frequency domains Skid Ports Allow lazy reading of data
45
Stats Stat Types Scalar Stats that comprise of one value collected over the entire simulation run. For eg. DCacheMisses Multidimensional (Histograms) These stats show the number of times particular clusters of events occur. For eg, the number of times N instructions were issued in a cycle where N for an 8 way processor varies from 0 to 8. Per Instructions Stats Global Per instruction type Per instruction
46
Stats Declare the stats data member of a class as a UINT64, Double, UINT64* or a Double* UINT64 dstreamFull; UINT64 instsRetired[CPU_THREADS]; Register the stats variable with StatsRegistry class RegisterState(dstreamFull, "PremafDstreamFull", "Number of dstream full events"); RegisterState(instsRetired, CPU_THREADS, "RetiredInstructions", "Retired Instructions"); Accumulate Stats dstreamFull++; instRetired[tpu]++;
47
Stats Histograms Stats Declaration HISTOGRAM_TEMPLATE instrIssuedPerCycle Initilization HISTOGRAM_TEMPLATE (UINT32 num_rows, UINT32 num_cols = 1, UINT32 row_size = 1, BOOL row_flex_cap = FALSE, UINT32 col_size = 1, BOOL col_flex_cap = FALSE ) Register RegisterState(&instrIssuedPerCycle, "instrIssuedPerCycle", "Number of instructions issued from the IQ per cycle"); Accumulate Stats AddEvent(UINT32 row_val, UINT32 col_val = 0, UINT64 value = 1) AddEventWideBins(UINT32 row_val, UINT32 col_val = 0, UINT64 value = 1)
48
Stats Command line switches -sc Emit stats file every cycles -sn Emit stats file every nanoseconds -si Emit stats file every instructions -sm Emit stats file every macro instructions -rsc Reset stats on cycle -rsi Reset stats on instruction -rsm Reset stats on macro instruction -rsn Reset stats on nanosecond Adding a p after the previous flags (for instance -rscp) will reset stats periodically after events
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.