CIRCT  19.0.0git
LowLevel.h
Go to the documentation of this file.
1 //===- LowLevel.h - Cosim low level implementation --------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef COSIM_LOWLEVEL_H
10 #define COSIM_LOWLEVEL_H
11 
12 #include <atomic>
13 
14 #include "cosim/Utils.h"
15 
16 namespace esi {
17 namespace cosim {
18 
19 // Implements a bi-directional, thread-safe bridge between the RPC server and
20 // DPI functions for low level functionality.
21 class LowLevel {
22 public:
23  LowLevel() = default;
24  ~LowLevel() = default;
25  /// Disallow copying. There is only ONE low level object per RPC server, so
26  /// copying is almost always a bug.
27  LowLevel(const LowLevel &) = delete;
28 
31  std::atomic<unsigned> readsOutstanding = 0;
32 
35  std::atomic<unsigned> writesOutstanding = 0;
36 };
37 
38 } // namespace cosim
39 } // namespace esi
40 
41 #endif
TSQueue< uint32_t > readReqs
Definition: LowLevel.h:29
std::atomic< unsigned > writesOutstanding
Definition: LowLevel.h:35
TSQueue< std::pair< uint64_t, uint8_t > > readResps
Definition: LowLevel.h:30
TSQueue< uint8_t > writeResps
Definition: LowLevel.h:34
LowLevel(const LowLevel &)=delete
Disallow copying.
std::atomic< unsigned > readsOutstanding
Definition: LowLevel.h:31
TSQueue< std::pair< uint32_t, uint64_t > > writeReqs
Definition: LowLevel.h:33
Definition: esi.py:1