1: <?php
2:
3: namespace Csim\Model;
4:
5: /**
6: * Describes one simulated instruction and the simulation result.
7: */
8: class Execution {
9:
10: private $instruction;
11: private $hit;
12: private $location;
13:
14: /**
15: * Creates a new instance representing the simulation of the specified instruction.
16: *
17: * @param \Csim\Model\Instruction $instruction The simulated instruction.
18: * @param boolean $isHit true if the specified instruction hit in the cache, false
19: * if it did not.
20: * @param \Csim\Model\CacheCell $location Specifies where the searched data was found if the
21: * instruction hit. Specifies where new data was loaded
22: * if the instruction missed.
23: */
24: public function __construct(\Csim\Model\Instruction $instruction, $isHit,
25: \Csim\Model\CacheCell $location) {
26: $this->instruction = $instruction;
27: $this->hit = $isHit;
28: $this->location = $location;
29: }
30:
31: /**
32: * Return true if this instruction hit in the cache.
33: *
34: * @return boolean
35: */
36: public function isHit() {
37: return $this->hit;
38: }
39:
40: /**
41: * Return the hit/miss cache location of this instruction.
42: *
43: * @return \Csim\Model\CacheCell
44: */
45: public function getLocation() {
46: return $this->location;
47: }
48:
49: /**
50: * Return the executed instruction.
51: *
52: * @return \Csim\Model\Instruction
53: */
54: public function getInstruction() {
55: return $this->instruction;
56: }
57:
58: }
59: