Back-ported DVCon turorial changes
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (C) 2017, MINRES Technologies GmbH | ||||
|  * Copyright (C) 2017, 2018, MINRES Technologies GmbH | ||||
|  * All rights reserved. | ||||
|  * | ||||
|  * Redistribution and use in source and binary forms, with or without | ||||
| @@ -35,8 +35,8 @@ | ||||
| #ifndef _ISS_PLUGIN_CYCLE_ESTIMATE_H_ | ||||
| #define _ISS_PLUGIN_CYCLE_ESTIMATE_H_ | ||||
|  | ||||
| #include "iss/vm_plugin.h" | ||||
| #include "iss/instrumentation_if.h" | ||||
| #include "iss/vm_plugin.h" | ||||
| #include <json/json.h> | ||||
| #include <string> | ||||
| #include <unordered_map> | ||||
| @@ -58,38 +58,38 @@ class cycle_estimate: public iss::vm_plugin { | ||||
| 	END_BF_DECL(); | ||||
|  | ||||
| public: | ||||
| 	cycle_estimate() = delete; | ||||
|     cycle_estimate() = delete; | ||||
|  | ||||
| 	cycle_estimate(const cycle_estimate& ) = delete; | ||||
|     cycle_estimate(const cycle_estimate &) = delete; | ||||
|  | ||||
| 	cycle_estimate(const cycle_estimate&&) = delete; | ||||
|     cycle_estimate(const cycle_estimate &&) = delete; | ||||
|  | ||||
| 	cycle_estimate(std::string config_file_name); | ||||
|     cycle_estimate(std::string config_file_name); | ||||
|  | ||||
| 	virtual ~cycle_estimate(); | ||||
|     virtual ~cycle_estimate(); | ||||
|  | ||||
| 	cycle_estimate& operator=(const cycle_estimate& ) = delete; | ||||
|     cycle_estimate &operator=(const cycle_estimate &) = delete; | ||||
|  | ||||
| 	cycle_estimate& operator=(const cycle_estimate&& ) = delete; | ||||
|     cycle_estimate &operator=(const cycle_estimate &&) = delete; | ||||
|  | ||||
| 	bool registration(const char* const version, vm_if& arch) override; | ||||
|     bool registration(const char *const version, vm_if &arch) override; | ||||
|  | ||||
| 	sync_type get_sync() override {return POST_SYNC;}; | ||||
|     sync_type get_sync() override { return POST_SYNC; }; | ||||
|  | ||||
|     void callback(instr_info_t instr_info) override; | ||||
|  | ||||
| 	void callback(instr_info_t instr_info) override; | ||||
| private: | ||||
|     iss::instrumentation_if* arch_instr; | ||||
|     iss::instrumentation_if *arch_instr; | ||||
|     std::vector<instr_desc> delays; | ||||
|     struct pair_hash { | ||||
|     	size_t operator()(const std::pair<uint64_t, uint64_t>& p) const{ | ||||
|     		std::hash<uint64_t> hash; | ||||
|     		return hash(p.first)+hash(p.second); | ||||
|     	} | ||||
|         size_t operator()(const std::pair<uint64_t, uint64_t> &p) const { | ||||
|             std::hash<uint64_t> hash; | ||||
|             return hash(p.first) + hash(p.second); | ||||
|         } | ||||
|     }; | ||||
|     std::unordered_map<std::pair<uint64_t, uint64_t>, uint64_t, pair_hash> blocks; | ||||
|     Json::Value root; | ||||
| }; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| /******************************************************************************* | ||||
|  * Copyright (C) 2017, MINRES Technologies GmbH | ||||
|  * Copyright (C) 2017, 2018, MINRES Technologies GmbH | ||||
|  * All rights reserved. | ||||
|  * | ||||
|  * Redistribution and use in source and binary forms, with or without | ||||
| @@ -42,39 +42,40 @@ | ||||
| namespace iss { | ||||
| namespace plugin { | ||||
|  | ||||
| class instruction_count: public iss::vm_plugin { | ||||
| 	struct instr_delay { | ||||
| 		std::string instr_name; | ||||
| 		size_t size; | ||||
| 		size_t not_taken_delay; | ||||
| 		size_t taken_delay; | ||||
| 	}; | ||||
| class instruction_count : public iss::vm_plugin { | ||||
|     struct instr_delay { | ||||
|         std::string instr_name; | ||||
|         size_t size; | ||||
|         size_t not_taken_delay; | ||||
|         size_t taken_delay; | ||||
|     }; | ||||
|  | ||||
| public: | ||||
| 	instruction_count() = delete; | ||||
|     instruction_count() = delete; | ||||
|  | ||||
| 	instruction_count(const instruction_count& ) = delete; | ||||
|     instruction_count(const instruction_count &) = delete; | ||||
|  | ||||
| 	instruction_count(const instruction_count&&) = delete; | ||||
|     instruction_count(const instruction_count &&) = delete; | ||||
|  | ||||
| 	instruction_count(std::string config_file_name); | ||||
|     instruction_count(std::string config_file_name); | ||||
|  | ||||
| 	virtual ~instruction_count(); | ||||
|     virtual ~instruction_count(); | ||||
|  | ||||
| 	instruction_count& operator=(const instruction_count& ) = delete; | ||||
|     instruction_count &operator=(const instruction_count &) = delete; | ||||
|  | ||||
| 	instruction_count& operator=(const instruction_count&& ) = delete; | ||||
|     instruction_count &operator=(const instruction_count &&) = delete; | ||||
|  | ||||
| 	bool registration(const char* const version, vm_if& arch) override; | ||||
|     bool registration(const char *const version, vm_if &arch) override; | ||||
|  | ||||
| 	sync_type get_sync() override {return POST_SYNC;}; | ||||
|     sync_type get_sync() override { return POST_SYNC; }; | ||||
|  | ||||
|     void callback(instr_info_t instr_info) override; | ||||
|  | ||||
| 	void callback(instr_info_t instr_info) override; | ||||
| private: | ||||
|     Json::Value root; | ||||
|     std::vector<instr_delay> delays; | ||||
|     std::vector<uint64_t> rep_counts; | ||||
| }; | ||||
|  | ||||
| } | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user