ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
delay.hpp
Go to the documentation of this file.
1#ifndef _delay_hpp_INCLUDED
2#define _delay_hpp_INCLUDED
3
4#include "global.h"
5
6#include <cstdint>
7#include <limits>
8
10
11namespace CaDiCaL {
12struct Delay {
13 unsigned count;
14 unsigned current;
15
16 Delay () : count (0), current (0) {}
17
18 bool delay () {
19 if (count) {
20 --count;
21 return true;
22 } else {
23 return false;
24 }
25 }
26
27 void bump_delay () {
28 current += current < std::numeric_limits<unsigned>::max ();
29 count = current;
30 }
31
32 void reduce_delay () {
33 if (!current)
34 return;
35 current /= 2;
36 count = current;
37 }
38};
39
40} // namespace CaDiCaL
41
43
44#endif
#define ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_END
void bump_delay()
Definition delay.hpp:27
unsigned current
Definition delay.hpp:14
unsigned count
Definition delay.hpp:13
void reduce_delay()
Definition delay.hpp:32
bool delay()
Definition delay.hpp:18