C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
rising_bit.h
Go to the documentation of this file.
1/*
2 © 2023 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14// -*- C++ -*-
15
16#ifndef CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_RISING_BIT_H
17#define CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_RISING_BIT_H
18
20#include "sme/aqpp/print/sme_print.hpp"
21#include <iostream>
22#include <ios>
23namespace sme {
24
25 namespace rules {
26
32 {
33 public:
38 uint8_t m_bit;
39
45 rising_bit( uint8_t _bit)
47 , m_bit( _bit)
48 {
49 }
50
55 virtual ~rising_bit() {;}
56
63 virtual void process_rule( uint64_t _old_value, uint64_t & _new_value) {
64 if( is_active() && is_bound() && ((!(_old_value & (1ULL << m_bit))) && ((_new_value & (1ULL << m_bit)))) ) {
65 SIM_DEBUG_END( "true");
66 m_lambda();
67 } else {
68 SIM_DEBUG_END( "false");
69 }
70 }
71 };
72
73 }
74
75}
76
77#endif /*NOTIFICATION_RULE_RISING_BIT_H_*/
Definition: I_pattern_rule.h:86
std::function< void()> m_lambda
Definition: I_pattern_rule.h:88
virtual _always_inline bool is_bound()
has the lambda callback been bound.
Definition: I_pattern_rule.h:99
_always_inline bool is_active()
reports if rule is active for processing.
Definition: I_pattern_rule.h:73
rule specifically to monitor a single bit for rising edge.
Definition: rising_bit.h:32
virtual void process_rule(uint64_t _old_value, uint64_t &_new_value)
process rule evaluation between old and new values.
Definition: rising_bit.h:63
uint8_t m_bit
The bit which is to change state.
Definition: rising_bit.h:38
rising_bit(uint8_t _bit)
Construct a new rising bit object.
Definition: rising_bit.h:45
virtual ~rising_bit()
Destroy the rising bit object.
Definition: rising_bit.h:55
Definition: expression_vector.h:25