summaryrefslogtreecommitdiff
path: root/cpu8/cpu_and/notes.txt
blob: 62e8b7eb598602e1e37999d2ad7e98c4e56f0979 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
https://www.doulos.com/knowhow/systemc/tutorial/modules_and_processes/
https://www.doulos.com/knowhow/systemc/tutorial/debugging/




#include "systemc.h"
SC_MODULE(nand2)          // declare nand2 sc_module
{
  sc_in<bool> A, B;       // input signal ports
  sc_out<bool> F;         // output signal ports

  void do_nand2()         // a C++ function
  {
    F.write( !(A.read() && B.read()) );
  }

  SC_CTOR(nand2)          // constructor for nand2
  {
    SC_METHOD(do_nand2);  // register do_nand2 with kernel
    sensitive << A << B;  // sensitivity list
  }
};