TraceParser.h revision 10428:0caf62b57dfd
12567SN/A/* 27585SAli.Saidi@arm.com * Copyright (c) 2012-2014, TU Delft 37585SAli.Saidi@arm.com * Copyright (c) 2012-2014, TU Eindhoven 47585SAli.Saidi@arm.com * Copyright (c) 2012-2014, TU Kaiserslautern 57585SAli.Saidi@arm.com * All rights reserved. 67585SAli.Saidi@arm.com * 77585SAli.Saidi@arm.com * Redistribution and use in source and binary forms, with or without 87585SAli.Saidi@arm.com * modification, are permitted provided that the following conditions are 97585SAli.Saidi@arm.com * met: 107585SAli.Saidi@arm.com * 117585SAli.Saidi@arm.com * 1. Redistributions of source code must retain the above copyright 127585SAli.Saidi@arm.com * notice, this list of conditions and the following disclaimer. 137585SAli.Saidi@arm.com * 142567SN/A * 2. Redistributions in binary form must reproduce the above copyright 152567SN/A * notice, this list of conditions and the following disclaimer in the 162567SN/A * documentation and/or other materials provided with the distribution. 172567SN/A * 182567SN/A * 3. Neither the name of the copyright holder nor the names of its 192567SN/A * contributors may be used to endorse or promote products derived from 202567SN/A * this software without specific prior written permission. 212567SN/A * 222567SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 232567SN/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 242567SN/A * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 252567SN/A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 262567SN/A * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 272567SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 282567SN/A * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 292567SN/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 302567SN/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 312567SN/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 322567SN/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 332567SN/A * 342567SN/A * Authors: Omar Naji 352567SN/A * 362567SN/A */ 372567SN/A 382567SN/A#ifndef TRACE_PARSER_H 392665SN/A#define TRACE_PARSER_H 402665SN/A 412567SN/A#include <vector> 422567SN/A#include <string> 438229Snate@binkert.org 448229Snate@binkert.org#include "MemCommand.h" 456757SAli.Saidi@ARM.com#include "MemorySpecification.h" 468286SAli.Saidi@ARM.com#include "CommandAnalysis.h" 478286SAli.Saidi@ARM.com 488286SAli.Saidi@ARM.com 498286SAli.Saidi@ARM.comclass TraceParser { 508706Sandreas.hansson@arm.com public: 512567SN/A // list of parsed commands 527650SAli.Saidi@ARM.com std::vector<Data::MemCommand> cmd_list; 537650SAli.Saidi@ARM.com 542567SN/A // function for parsing one line of the trace 556757SAli.Saidi@ARM.com Data::MemCommand parseLine(std::string line); 568286SAli.Saidi@ARM.com 572567SN/A Data::CommandAnalysis counters; 588885SAli.Saidi@ARM.com // function for parsing the whole file. 598885SAli.Saidi@ARM.com // use this function for small traces ( no out-of-memory issue ) 608885SAli.Saidi@ARM.com void parseFile(Data::MemorySpecification memSpec, 618885SAli.Saidi@ARM.com std::ifstream& trace, 628885SAli.Saidi@ARM.com int window, 638885SAli.Saidi@ARM.com int grouping, 648885SAli.Saidi@ARM.com int interleaving, 658885SAli.Saidi@ARM.com int burst, 668885SAli.Saidi@ARM.com int powerdown, 678885SAli.Saidi@ARM.com int trans); 688706Sandreas.hansson@arm.com}; 698706Sandreas.hansson@arm.com 708706Sandreas.hansson@arm.com#endif // ifndef TRACE_PARSER_H 718706Sandreas.hansson@arm.com